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

jdk11_headless: fix the build on amd64 #51860

Merged
merged 1 commit into from
Dec 13, 2018
Merged

Conversation

ivan
Copy link
Member

@ivan ivan commented Dec 11, 2018

This fixes #51859:

checking user specified JVM feature list...
configure: error: Cannot continue
configure: Unknown JVM features specified: "zgc--enable-headless-only"
configure: The available JVM features are: "aot cds cmsgc compiler1 compiler2 dtrace epsilongc g1gc graal jfr jni-check jvmci jvmti link-time-opt management minimal nmt parallelgc serialgc services static-build vm-structs zero zgc"
configure exiting with result code 1
builder for '/nix/store/1awwzd98crcgxad3srdkv8smhxgiz2qp-openjdk-11.0.1-b13.drv' failed with exit code 1
Motivation for this change

Fix build breakage introduced in 1629147

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

I verified that this unbreaks the configure step; it now does

<3>====================================================
<3>A new configuration has been successfully created in
<3>/build/jdk11u-jdk-11.0.1+13/build/linux-x86_64-normal-server-release
<3>using configure arguments '--prefix=/nix/store/hc9zyzfvzijra93b3n0a97q7wzazw0w0-openjdk-11.0.1-b13 --with-boot-jdk=/nix/store/i0himc6fzacdjkhasw5bmwkywdmpi89b-openjdk-bootstrap/lib/openjdk --with-update-version=11.0.1 --with-build-number=13 --with-milestone=fcs --enable-unlimited-crypto --disable-debug-symbols --with-zlib=system --with-giflib=system --with-stdc++lib=dynamic --with-extra-cflags='-Wno-error=deprecated-declarations -Wno-error=format-contains-nul -Wno-error=unused-result' --with-jvm-features=zgc --enable-headless-only'.
<3>

This fixes:

checking user specified JVM feature list...
configure: error: Cannot continue
configure: Unknown JVM features specified: "zgc--enable-headless-only"
configure: The available JVM features are: "aot cds cmsgc compiler1 compiler2 dtrace epsilongc g1gc graal jfr jni-check jvmci jvmti link-time-opt management minimal nmt parallelgc serialgc services static-build vm-structs zero zgc"
configure exiting with result code 1
builder for '/nix/store/1awwzd98crcgxad3srdkv8smhxgiz2qp-openjdk-11.0.1-b13.drv' failed with exit code 1
@pbogdan
Copy link
Member

pbogdan commented Dec 11, 2018

Couldn't this use configureFlags instead of stringing the bash array together directly? That would seem a bit less error prone if possible.

@ivan
Copy link
Member Author

ivan commented Dec 13, 2018

@pbogdan I tried to switch this over to configureFlags in ivan@f97a095, but the build fails with:

Using autoconf at /nix/store/sbyml1y5m5d6zp4mf9lrb7n5x7p8bkfj-autoconf-2.69/bin/autoconf [autoconf (GNU Autoconf) 2.69]
configure: error: unrecognized option: `-Wno-error=format-contains-nul'
Try `/build/jdk11u-jdk-11.0.1+13/configure --help' for more information

That happens with or without the inner \" quotes.

I suspect this used configureFlagsArray because configureFlags doesn't appear to retain spaces inside arguments?

@alyssais
Copy link
Member

Does this work?

{
  # ...
  configureFlags = lib.escapeShellArgs [
    "foo"
    "bar"
    "baz"
  ];
  # ...
}

@ivan
Copy link
Member Author

ivan commented Dec 13, 2018

ivan@8619db9#diff-077ce81757f14244afe7a85de7a5bcadR67 gives me

configuring
configure flags: --prefix=/nix/store/jk5fhnac8clq6zzkwla7dky4w0xbci9v-openjdk-11.0.1-b13 \'--with-boot-jdk=/nix/store/i0himc6fzacdjkhasw5bmwkywdmpi89b-openjdk-bootstrap/lib/openjdk\' \'--with-update-version=11.0.1\' \'--with-build-number=13\' \'--with-milestone=fcs\' \'--enable-unlimited-crypto\' \'--disable-debug-symbols\' \'--with-zlib=system\' \'--with-giflib=system\' \'--with-stdc++lib=dynamic\' \'--with-extra-cflags=-Wno-error=deprecated-declarations -Wno-error=format-contains-nul -Wno-error=unused-result\' \'--with-jvm-features=zgc\' \'--enable-headless-only\'
Runnable configure script is not present
Generating runnable configure script at /build/jdk11u-jdk-11.0.1+13/build/.configure-support/generated-configure.sh
Using autoconf at /nix/store/sbyml1y5m5d6zp4mf9lrb7n5x7p8bkfj-autoconf-2.69/bin/autoconf [autoconf (GNU Autoconf) 2.69]
configure: error: invalid variable name: `'--with-boot-jdk'
configure exiting with result code 1
builder for '/nix/store/lp2nz72hzb7ra6g0v0m4c5c78hzny3a1-openjdk-11.0.1-b13.drv' failed with exit code 1
error: build of '/nix/store/lp2nz72hzb7ra6g0v0m4c5c78hzny3a1-openjdk-11.0.1-b13.drv' failed

@alyssais
Copy link
Member

Okay, I think the current approach is fine then.

@alyssais
Copy link
Member

@GrahamcOfBorg build jdk11_headless

@alyssais
Copy link
Member

Built successfully on x86_64-linux locally.

@alyssais alyssais merged commit c5b825c into NixOS:master Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jdk11_headless fails to build
4 participants