Skip to content
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

Build on ubuntu 20.04 #814

Merged
merged 1 commit into from
Mar 15, 2023
Merged

Conversation

psiroky
Copy link
Contributor

@psiroky psiroky commented Mar 13, 2023

 * building on ubuntu:22.04 produces binaries which require too recent glibc
   version (2.32+) and that means the binary no longer works on
   older ubuntu versions, like 20.04 and 18.04.

 * building on ubuntu:20.04 fixes the problem and the binary again works
   on ubuntu 18.04 and 20.04

 * also bumped the version in the release workflow which got forgotten
@psiroky psiroky marked this pull request as ready for review March 13, 2023 21:13
@psiroky
Copy link
Contributor Author

psiroky commented Mar 13, 2023

Hmm, so this moves the glibc version requirement to 2.17, which is better than the current state, but still not quite on par with 2.12.

./mvnd/maven-1.0.0-m5-SNAPSHOT-mvnd-m39-linux-amd64/bin/mvnd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by ./mvnd/maven-1.0.0-m5-SNAPSHOT-mvnd-m39-linux-amd64/bin/mvnd)

@psiroky
Copy link
Contributor Author

psiroky commented Mar 14, 2023

Reading through #730, it says

An explicit glibc requirement also removes a side effect of changing the build system. When update the build system from ubuntu 18.04 to 20.04, the glibc requirement may also increase to match the new os. On the other hand, glibc 2.12 is required by graalvm.

which is not really the case (anymore?). We bumped the build system and as a side-effect glibc version got bumped as well. GraalVM got updated from 22.2.0 to 22.3.1 in the meantime, in case that could be somehow related.

@psiroky psiroky marked this pull request as draft March 14, 2023 13:52
@psiroky
Copy link
Contributor Author

psiroky commented Mar 14, 2023

I wasn't able to make this work so that the glibc requirement would still be 2.12 (released on 2010-12-13). I tried to follow a similar approach with glibc.redef as there already is, but that feels like magic, redefining symbols in "random" libraries and hoping for the best. I believe this will also break again in the future when we upgrade the build system (or maybe even new Graal version).

There is a library (not even sure which one to be honest) which is using GLIBC_2.17 clock_gettime and I could not get rid of that (e.g. redefine the symbols to use older version -- the build then fails, with errors like

/usr/bin/ld: /mvnd/client/target/graalvm-libs-for-glibc-2.12/libpthread.a(pthread_create.o): in function `allocate_stack':
/build/glibc-SzIz7B/glibc-2.31/nptl/allocatestack.c:525: undefined reference to `_dl_stack_flags'
/usr/bin/ld: /build/glibc-SzIz7B/glibc-2.31/nptl/allocatestack.c:647: undefined reference to `_dl_stack_flags'
/usr/bin/ld: /mvnd/client/target/graalvm-libs-for-glibc-2.12/libpthread.a(pthread_getattr_np.o): in function `pthread_getattr_np':
/build/glibc-SzIz7B/glibc-2.31/nptl/pthread_getattr_np.c:99: undefined reference to `_dl_pagesize'
/usr/bin/ld: /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_getattr_np.c:137: undefined reference to `_dl_pagesize'
/usr/bin/ld: /mvnd/client/target/graalvm-libs-for-glibc-2.12/libpthread.a(elision-lock.o): in function `do_set_elision_enable':
/build/glibc-SzIz7B/glibc-2.31/nptl/../sysdeps/unix/sysv/linux/x86/elision-conf.c:66: undefined reference to `_dl_x86_cpu_features'
collect2: error: ld returned 1 exit status
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.handleLinkerFailure(NativeImageViaCC.java:191)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.write(NativeImageViaCC.java:135)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:704)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:521)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)

I double-checked and CentOS 6 is indeed using glibc 2.12, but it is also end-of-life for more than two years now (https://wiki.centos.org/HowTos/EOL). Maybe it would make sense to bump the glibc version anyway and support 2.17, which is the one used in CentOS 7?

I think it would still make sense to merge this PR, as it makes things slightly better:

  1. It aligns the builder images for early access and release workflows
  2. ubuntu:18.04 will be removed soon. The Ubuntu 18.04 Actions runner image will begin deprecation on 2022/08/08 and will be fully unsupported by 2023/04/03 actions/runner-images#6002 says 1st of April 2023 - two weeks from now, and I guess then we would not be able to release at all

@psiroky psiroky marked this pull request as ready for review March 14, 2023 17:41
@gnodet gnodet merged commit a59c7cd into apache:master Mar 15, 2023
@gnodet gnodet added this to the 1.0.0-m5 milestone Mar 15, 2023
oehme pushed a commit to oehme/maven-mvnd that referenced this pull request Mar 30, 2023
* building on ubuntu:22.04 produces binaries which require too recent glibc
   version (2.32+) and that means the binary no longer works on
   older ubuntu versions, like 20.04 and 18.04.

 * building on ubuntu:20.04 fixes the problem and the binary again works
   on ubuntu 18.04 and 20.04

 * also bumped the version in the release workflow which got forgotten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux native binary no longer works on ubuntu 18.04 and ubuntu 20.04 (and likely any linux with glibc < 2.34)
2 participants