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

graalvm8: 19.1.1 -> 19.2.1 #72331

Merged
merged 1 commit into from Jan 20, 2020
Merged

graalvm8: 19.1.1 -> 19.2.1 #72331

merged 1 commit into from Jan 20, 2020

Conversation

hlolli
Copy link
Member

@hlolli hlolli commented Oct 30, 2019

Motivation for this change

Bumping graalvm8

Things done

I fixed fastr and truffleruby so these are now included. I was planing to make it work for darwin, but I'll have to find time later for that, next weekend or next week. I refactored the cache generation into the postUnpack phase. I guess I could refactor some of the patching from the mxgitcaches into the postPatch phase later on.

  • [ x ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • [ x ] NixOS
    • [ x ] macOS
    • other Linux distributions
  • [ x ] 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 nix-review --run "nix-review wip"
  • [ x ] 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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @volth

@hlolli
Copy link
Member Author

hlolli commented Nov 7, 2019

I'm noticing some hash mismatches as I'm trying to implement for darwin. Please wait with reviewing.

@hlolli
Copy link
Member Author

hlolli commented Nov 12, 2019

I'll have to admit my inability to get it running on darwin. I was able to get svm running, but I realized that I compiled with clang and not gcc, I asked on graalvm slack, and they re-iterated that graalvm relies on gcc. And while trying to get this running, the gcc call, which is coming from substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/codegen/CCompilerInvoker.java doesn't seem to take anything from the environment into account, hence these CoreFoundation patches, because it seemed, no matter how hard I tried or how much gcc manual I read, I couldn't make CoreFoundation.h discoverable (except with direct reference but then all the other headers which CoreFoundation imports will fail).

So anybody with darwin experience, please help. The current error message is

 [lli:32101]    classlist:   3,945.83 ms
[polyglot:32100]    classlist:   3,986.76 ms
[polyglot:32100]        (cap):     617.01 ms
[polyglot:32100]        setup:   1,097.46 ms
Error: Error compiling query code (in /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-13236726821528075/PosixDirectives.c). Compiler command  /nix/store/by6a964hw1pcx2mwg8782096vi7b8jw8-gcc-8.3.0/bin/gcc -F /nix/store/732051j6rg2p3zb3nr5crfqlpaib158z-apple-framework-CoreFoundation/Library/Frameworks -framework CoreFoundation /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-13236726821528075/PosixDirectives.c -o /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-13236726821528075/PosixDirectives output included error: /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-13236726821528075/PosixDirectives.c:78:10: fatal error: CoreFoundation/CoreFoundation.h: No such file or directory
    C file contents around line 78:
    /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-13236726821528075/PosixDirectives.c:77: #include </nix/store/701x446sv332xjff12adla3dvzpf53hk-zlib-1.2.11-dev/include/zlib.h>
    /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-13236726821528075/PosixDirectives.c:78: #include <CoreFoundation/CoreFoundation.h>
    /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-13236726821528075/PosixDirectives.c:79: #include <sys/event.h>
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
[lli:32101]        (cap):     646.13 ms
[lli:32101]        setup:   1,169.34 ms
Error: Error compiling query code (in /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-4470645386342471800/LibCHelperDirectives.c). Compiler command  /nix/store/by6a964hw1pcx2mwg8782096vi7b8jw8-gcc-8.3.0/bin/gcc -F /nix/store/732051j6rg2p3zb3nr5crfqlpaib158z-apple-framework-CoreFoundation/Library/Frameworks -framework CoreFoundation /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-4470645386342471800/LibCHelperDirectives.c -o /var/folders/9k/hr12t49132lgnpzq88w_h6740000gn/T/SVM-4470645386342471800/LibCHelperDirectives output included error: collect2: error: ld returned 1 exit status
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
Process Process-362:

@volth

The current head on my PR is in a messed state, I'll either stop trying to get it running on darwin and clean it up for linux and submit this PR that way. Or I find a way to solve it and I keep this PR open.

@arturovm
Copy link

Hi, I'm interested in getting this working on Darwin as well. I could take a look! I'm pretty new to Nix so this might take a little while. If this is a blocker for this PR, then I could do this on a separate branch.

@hlolli
Copy link
Member Author

hlolli commented Nov 17, 2019

I'm pretty close to getting this done on Darwin. Still an unrelated gcc problem in the way.

@regadas
Copy link
Contributor

regadas commented Nov 17, 2019

That’s nice! I actually ended up creating a custom pkg with the pre built Graal binaries (easier and kinda online with other jdk packages)

@hlolli
Copy link
Member Author

hlolli commented Nov 24, 2019

I successfully got all the polyglots working with Darwin, it's quite invasive, becuase the changes to libdispatch, which is required by System framework, requires absolutely everything to be rebuilt. Also I needed to add Java frameworks which weren't implemented.

Anyway, a quick question, I'm back on linux verifying that everything still works as expected, but I'm encountering

these derivations will be built:
  /nix/store/qppx0ipxy1w2vc9ggd3glg9q73ansab6-graal-19.2.1.drv
building '/nix/store/qppx0ipxy1w2vc9ggd3glg9q73ansab6-graal-19.2.1.drv'...
/nix/store/30b80ymkvhryc8kkifc93psy7mppwz3q-jvmci-19.3-b04/nix-support/setup-hook: line 1: JAVA_HOME: unbound variable
builder for '/nix/store/qppx0ipxy1w2vc9ggd3glg9q73ansab6-graal-19.2.1.drv' failed with exit code 1
error: build of '/nix/store/qppx0ipxy1w2vc9ggd3glg9q73ansab6-graal-19.2.1.drv' failed

Which is strange since the setup-hook is everywhere the same for java

$ cat /nix/store/30b80ymkvhryc8kkifc93psy7mppwz3q-jvmci-19.3-b04/nix-support/setup-hook
if [ -z "$JAVA_HOME" ]; then export JAVA_HOME=/nix/store/30b80ymkvhryc8kkifc93psy7mppwz3q-jvmci-19.3-b04; fi

I'm super happy to see it working on darwin after 24 days of struggling.

Could you start @GrahamcOfBorg @volth ? This JAVA_HOME error is most likely some strangeness happening for me locally.

@hlolli
Copy link
Member Author

hlolli commented Nov 25, 2019

sorry, I always had the idea that @GrahamcOfBorg didn't try to built unless instructed to. I fixed that hash mismatch, crossing fingers.

@hlolli
Copy link
Member Author

hlolli commented Jan 17, 2020

@Mic92 done

- - nixpkgs now with full darwin support
@hlolli
Copy link
Member Author

hlolli commented Jan 18, 2020

sorry was rebased against master, changed it to staging @Mic92

@Mic92 Mic92 merged commit 61c0185 into NixOS:staging Jan 20, 2020
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.

None yet

6 participants