Skip to content

Commit

Permalink
Build our wheels against the latest elfutils
Browse files Browse the repository at this point in the history
Download and build the latest `elfutils` so that `auditwheel` can vendor
the latest `libdebuginfod` into our wheels.

Signed-off-by: Matt Wozniski <[email protected]>
  • Loading branch information
godlygeek committed May 6, 2024
1 parent 05352db commit 9c10baa
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,20 @@ manylinux-i686-image = "manylinux2010"

[tool.cibuildwheel.linux]
before-all = [
"yum install -y libunwind-devel lz4-devel gdb",
"if ! yum install -y lldb; then echo lldb is not available; fi",
# Build the latest elfutils from source.
"yum install -y curl-devel lz4-devel",
"cd /",
"VERS=0.191",
"curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2",
"tar -xf elfutils.tar.bz2",
"cd elfutils-$VERS",
#"patch libdwfl/dwfl_segment_report_module.c < {package}/build_scripts/elfutils_contiguous_segments.diff",
"CFLAGS=-w LDFLAGS=-lrt ./configure --prefix=/usr --enable-libdebuginfod --disable-debuginfod --disable-nls",
"make install",

# Install Memray's other build and test dependencies
"yum install -y libunwind-devel gdb",
"if ! yum install -y lldb; then echo lldb is not available; fi"
]

[tool.cibuildwheel.macos]
Expand Down Expand Up @@ -112,5 +124,39 @@ show_missing = true
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = [
"apk add --update libunwind-dev lz4-dev gdb lldb",
# Remove gettext-dev, which conficts with the musl-libintl, which is a build
# dependency of elfutils.
"apk del gettext-dev glib-dev",

# Build musl-fts from source. This is a build dependency of elfutils, but
# isn't in the Alpine repos of the musllinux_1_1 image. The build steps come
# from https://git.alpinelinux.org/aports/tree/main/musl-fts/APKBUILD
# Setting PATH before calling boostrap.sh fixes an automake failure. I think
# the failure may be caused by a different pkg-config in /usr/local/bin.
"cd /",
"apk add --update automake autoconf libtool",
"VERS=1.2.7",
"curl -L https://github.com/void-linux/musl-fts/archive/refs/tags/v$VERS.tar.gz > ./musl-fts.tar.gz",
"tar -xf musl-fts.tar.gz",
"cd musl-fts-$VERS",
"PATH=/usr/bin:/bin ./bootstrap.sh",
"CFLAGS=-fPIC ./configure --prefix=/usr",
"make install",

# Build the latest elfutils from source. The build steps come from
# https://git.alpinelinux.org/aports/tree/main/elfutils, and the need to
# set the FNM_EXTMATCH macro to get the build to succeed is seen here:
# https://git.alpinelinux.org/aports/tree/main/elfutils/musl-macros.patch
"cd /",
"apk add --update argp-standalone bison bsd-compat-headers bzip2-dev curl-dev flex-dev libtool linux-headers musl-libintl musl-obstack-dev xz-dev zlib-dev zstd-dev",
"VERS=0.191",
"curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2",
"tar -xf elfutils.tar.bz2",
"cd elfutils-$VERS",
#"patch libdwfl/dwfl_segment_report_module.c < {package}/build_scripts/elfutils_contiguous_segments.diff",
"CFLAGS='-Wno-error -DFNM_EXTMATCH=0 -g -O2' ./configure --prefix=/usr --enable-libdebuginfod --disable-debuginfod --disable-nls --with-zstd",
"make install",

# Install Memray's other build and test dependencies
"apk add --update libunwind-dev lz4-dev gdb lldb"
]

0 comments on commit 9c10baa

Please sign in to comment.