-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A question about manylinux compliance for Hugo binaries #41
Comments
I hope to have posted this in the right forum for release-related discussion. Lest it is to be flagged as a discussion elsewhere that is more appropriate or visible, please feel free to close this here and direct me to a different location for posting this query. Thanks! |
@agriyakhetarpal sorry for the late reply, I have to many repositories on my watch list. What you ask about is a little bit technical even from me. But if I understand the core of your problem is GLIBC version compatibility. I have struggled with this myself, with build hosts (Vercel, Netlify) that has relatively old Linux build setups. There are some insights in this thread: gohugoio/hugo#11414 (comment) Which lead me to maintain my own Docker image for the latest Go version: https://github.com/bep/dockerfiles/blob/master/ci-go/Dockerfile Which uses the |
Hello @bep, I thank you for your response and I do not mind the delay in receiving it. Thanks for the thread you linked as well, could not have found it myself with much ease. I think Vercel and Netlify have Linux builds that despite being older are still relatively newer than what is defined in the manylinux2014 specification, so a solution to my issue with the specification's compliance would be to rather not go forward with it and choose something newer like In the meantime before your response and my initial opening of this issue, I was able to retrieve the I am open to the inclusion of this currently unofficial PyPI package Here is a link to the GitHub repository, whose README has documentation on how isolation works: https://github.com/agriyakhetarpal/hugo-python-distributions/ – essentially, it comes from virtual environments in Python and tools like |
Update: I have started to use the Doing so revealed that an additional Please feel free to close this issue, since my initial query has been answered and resolved. |
@bep
Hi! Thanks for setting this tool up. I am trying to build a Python (
pip
-installable) binary distribution for Hugo at https://github.com/agriyakhetarpal/hugo-python-distributions/ that embeds binaries for the extended version of Hugo for various platforms and architectures, which will be a subset of Hugo's own platform set owing to the lack of tooling for platform tags for BSD-like platforms for Python.I am using
cibuildwheel
to build and package these wheels in CI and plan to upload these to PyPI (edit: have done so for Hugo 0.121.1 and 0.121.2), so that one can run the commandpip install python-hugo
and run commands likehugo version
andhugo server --disableFastRender
just like they would normally. I know that Python is not the first choice for most packagers and users of Hugo, but with this distribution I wanted to learn if it's possible to embed Go binaries in Python packages, and I have succeeded so far :)While building Linux amd64 wheels (and arm64/aarch64 wheels under QEMU emulation), I am able to obtain the correct specification for the wheel, but the ABI tags for the wheel are constrained due to manylinux policies (see below). I was wondering if some information can be shared w.r.t the version of GLIBC being used to build Hugo from source, e.g., GLIBC has backward compatibility but not forward compatibility, so I can explore using an older manylinux2014 base Docker image with an older GCC to compile, or I'm not sure if this is coming from the Go toolchain (I am using 1.21.5 since the minimum version was bumped to 1.20 recently).
This is what I get when I run
auditwheel
, a tool for Linux wheel repair for Python wheels, locally:Output
(This is coming from the Hugo unix executable file in the wheel).
On a macOS arm64 machine, this is what I get from
otool
when I run it on the executable:Output
which doesn't help a lot (note that I am mangling the executable name to conform to the platform and architecture rather than
lipo
-ing it). I tried on a Docker image and received these symbols:Output from ldd
``` ldd hugo-0.120.4-linux-arm64 linux-vdso.so.1 (0x0000ffff84bc2000) libresolv.so.2 => /lib/aarch64-linux-gnu/libresolv.so.2 (0x0000ffff84b6b000) libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff84b3a000) libstdc++.so.6 => /usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000ffff84962000) libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff848b7000) libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff848a3000) libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffff8487f000) libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff8470b000) /lib/ld-linux-aarch64.so.1 (0x0000ffff84b92000) ```
I can manually modify the platform tag in the filename(s) to adhere to such compliance, given that the Hugo binary and its commands are working without any issues, but there are risks to this approach and make wheels non-reproducible and non-compliant on older Linux platforms, due to issues such as old system-provided libraries, missing or unresolved symbols, and the like. If the newer versions of the Hugo binaries are supposed to work just on modern systems, then there shouldn't be a problem with manually overwriting these tags – but I thought I should ask around first. Another option I am considering is to use a very old Docker image that comes with a very old GLIBC for this purpose, but building Hugo from source might break in that case. I'm not as familiar with Golang and building packages with it, which is diametrically on the other end in comparison to my experience with Python tooling, and therefore this is a new area for me – I would appreciate a response :))
(P.S. This is a problem on just the Linux wheels I have been trying to compile. I have packaging infrastructure for Windows amd64 wheels and macOS arm64 + amd64 wheels set up—with universal2 wheels too for the latter—I tested the Hugo binary for
0.120.4
manually and it works on Intel MacBooks as old as those released in 2015!)The text was updated successfully, but these errors were encountered: