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

jetbrains.idea-ultimate - aarch64-linux #222947

Conversation

damien-biasotto
Copy link

@damien-biasotto damien-biasotto commented Mar 24, 2023

Description of changes

Adding aarch64-linux as a supported platform for jetbrains.idea-ultimate

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@damien-biasotto damien-biasotto changed the title Feature/jetbrains.idea-ultimate - aarch64-linux jetbrains.idea-ultimate - aarch64-linux Mar 26, 2023
@damien-biasotto
Copy link
Author

Somehow CLion does not compile.

I have to check if it's linked to my changes or not.

$ nix --experimental-features nix-command build --no-link --keep-going --no-allow-import-from-derivation --option build-use-sandbox relaxed -f /home/damien/.cache/nixpkgs-review/rev-2a8770ab7681521d400a6f1f3a6555ae45b75059/build.nix
error: builder for '/nix/store/z3prlqmf5jxjc3ii9z592rxh3yca47qn-clion-2022.3.3.drv' failed with exit code 1;
       last 10 log lines:
       > setting RPATH to: /nix/store/shasq3azl2298vqkvq5mc7vivdqp3yrj-gcc-12.2.0-lib/lib
       > setting interpreter of /nix/store/flw19zmv7rc8ji3w00knlrd9rbxnw12y-clion-2022.3.3/clion/bin/ninja/linux/x64/ninja
       > searching for dependencies of /nix/store/flw19zmv7rc8ji3w00knlrd9rbxnw12y-clion-2022.3.3/clion/bin/ninja/linux/x64/ninja
       >     libstdc++.so.6 -> found: /nix/store/shasq3azl2298vqkvq5mc7vivdqp3yrj-gcc-12.2.0-lib/lib
       > setting RPATH to: /nix/store/shasq3azl2298vqkvq5mc7vivdqp3yrj-gcc-12.2.0-lib/lib
       > auto-patchelf: 1 dependencies could not be satisfied
       > error: auto-patchelf could not satisfy dependency libcrypt.so.1 wanted by /nix/store/flw19zmv7rc8ji3w00knlrd9rbxnw12y-clion-2022.3.3/clion/bin/lldb/linux/x64/lib/python3.8/lib-dynload/_crypt.cpython-38-x86_64-linux-gnu.so
       > auto-patchelf failed to find all the required dependencies.
       > Add the missing dependencies to --libs or use `--ignore-missing="foo.so.1 bar.so etc.so"`.
       > /nix/store/sw36plhp82916wwg6i6097rkzza7d950-stdenv-linux/setup: line 136: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/z3prlqmf5jxjc3ii9z592rxh3yca47qn-clion-2022.3.3.drv'.
error: 1 dependencies of derivation '/nix/store/4wv7m6qw3gh4jrhv82aj67l5nbq6cic5-review-shell.drv' failed to build
1 package failed to build:
jetbrains.clion

16 packages built:
bluej greenfoot jetbrains.datagrip jetbrains.gateway jetbrains.goland jetbrains.idea-community jetbrains.idea-ultimate jetbrains.jcef jetbrains.jdk jetbrains.mps jetbrains.phpstorm jetbrains.pycharm-community jetbrains.pycharm-professional jetbrains.rider jetbrains.ruby-mine jetbrains.webstorm

@damien-biasotto
Copy link
Author

Somehow CLion does not compile.

I have to check if it's linked to my changes or not.

$ nix --experimental-features nix-command build --no-link --keep-going --no-allow-import-from-derivation --option build-use-sandbox relaxed -f /home/damien/.cache/nixpkgs-review/rev-2a8770ab7681521d400a6f1f3a6555ae45b75059/build.nix
error: builder for '/nix/store/z3prlqmf5jxjc3ii9z592rxh3yca47qn-clion-2022.3.3.drv' failed with exit code 1;
       last 10 log lines:
       > setting RPATH to: /nix/store/shasq3azl2298vqkvq5mc7vivdqp3yrj-gcc-12.2.0-lib/lib
       > setting interpreter of /nix/store/flw19zmv7rc8ji3w00knlrd9rbxnw12y-clion-2022.3.3/clion/bin/ninja/linux/x64/ninja
       > searching for dependencies of /nix/store/flw19zmv7rc8ji3w00knlrd9rbxnw12y-clion-2022.3.3/clion/bin/ninja/linux/x64/ninja
       >     libstdc++.so.6 -> found: /nix/store/shasq3azl2298vqkvq5mc7vivdqp3yrj-gcc-12.2.0-lib/lib
       > setting RPATH to: /nix/store/shasq3azl2298vqkvq5mc7vivdqp3yrj-gcc-12.2.0-lib/lib
       > auto-patchelf: 1 dependencies could not be satisfied
       > error: auto-patchelf could not satisfy dependency libcrypt.so.1 wanted by /nix/store/flw19zmv7rc8ji3w00knlrd9rbxnw12y-clion-2022.3.3/clion/bin/lldb/linux/x64/lib/python3.8/lib-dynload/_crypt.cpython-38-x86_64-linux-gnu.so
       > auto-patchelf failed to find all the required dependencies.
       > Add the missing dependencies to --libs or use `--ignore-missing="foo.so.1 bar.so etc.so"`.
       > /nix/store/sw36plhp82916wwg6i6097rkzza7d950-stdenv-linux/setup: line 136: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/z3prlqmf5jxjc3ii9z592rxh3yca47qn-clion-2022.3.3.drv'.
error: 1 dependencies of derivation '/nix/store/4wv7m6qw3gh4jrhv82aj67l5nbq6cic5-review-shell.drv' failed to build
1 package failed to build:
jetbrains.clion

16 packages built:
bluej greenfoot jetbrains.datagrip jetbrains.gateway jetbrains.goland jetbrains.idea-community jetbrains.idea-ultimate jetbrains.jcef jetbrains.jdk jetbrains.mps jetbrains.phpstorm jetbrains.pycharm-community jetbrains.pycharm-professional jetbrains.rider jetbrains.ruby-mine jetbrains.webstorm

So I can build and run CLion against this branch, but for whatever reason when running nixpkgs-reviews, libcrypt is not found despite openssl being in the buildInputs.

@lilyinstarlight
Copy link
Member

Am I misreading this diff, or does this remove all of the x86_64-darwin info from pkgs/applications/editors/jetbrains/versions.json?

@lilyinstarlight
Copy link
Member

This diff allows clion to build correctly again, btw:

diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix
index f331b6ba93e..c40b787ebf7 100644
--- a/pkgs/applications/editors/jetbrains/default.nix
+++ b/pkgs/applications/editors/jetbrains/default.nix
@@ -65,7 +65,8 @@ let
           ls -d $PWD/bin/lldb/linux/x64/lib/python3.8/lib-dynload/* |
           xargs patchelf \
             --replace-needed libssl.so.10 libssl.so \
-            --replace-needed libcrypto.so.10 libcrypto.so
+            --replace-needed libcrypto.so.10 libcrypto.so \
+            --replace-needed libcrypt.so.1 libcrypt.so
 
           autoPatchelf $PWD/bin
 

@damien-biasotto
Copy link
Author

Am I misreading this diff, or does this remove all of the x86_64-darwin info from pkgs/applications/editors/jetbrains/versions.json?

Good catch, I might have removed it inadvertently when I rebased onto master. I added it back,

@damien-biasotto damien-biasotto force-pushed the feature/idea-ultimate-aarch64-linux branch from 6cb8c8d to 47ef011 Compare March 28, 2023 05:08
Copy link
Member

@lilyinstarlight lilyinstarlight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments. I don't use jetbrains stuff so I'm a bit out of my depth for reviewing this

@@ -11,7 +11,7 @@
, lib
, ant
, ninja

, clang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this clang ever get used in this file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I will delete it. Good catch again :)

Comment on lines -183 to +206
extract_jar "$JOGAMP_DIR"/gluegen-rt-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH"


if [ "$OS" == "macosx" ] || [ "$TARGET_ARCH" == "x86_64" ]; then
extract_jar "$JOGAMP_DIR"/gluegen-rt-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH"
fi
jmod create --class-path gluegen-rt.jar --libs lib gluegen.rt.jmod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the motivation for this? Are no native libs required at all for aarch64-linux?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like it, it's backported from the original script (from the JetBrains repo). Without it, the aarch64 build would fail IIRC.

Taken from : https://github.com/JetBrains/jcef/blob/dev/jb/tools/common/create_modules.sh#L46

@damien-biasotto damien-biasotto marked this pull request as draft March 29, 2023 10:11
@damien-biasotto
Copy link
Author

damien-biasotto commented Mar 29, 2023

Not sure why, but when I try to build this package on my Nixos (running on M1) I got a segmentation fault (that I didn't have when running in a VM).

I put the PR back to draft until I figure something out.

Opened an issue in Jetbrains JBR repository: JetBrains/JetBrainsRuntime#224

@drupol
Copy link
Contributor

drupol commented Jun 5, 2023

Hi!

Is this PR still up-to-date as of today?

@damien-biasotto
Copy link
Author

Hey @drupol it's not up-to-date yet, I will try to pull the latest changes and backport my changes.

But the issue still occurs on my end, I can compile ARM64 using a VM, but using real hardware (M1, M1 Pro CPUs) I keep getting a segfault when compiling jcef.nix. May be someone with a less exotic CPU could try to see if it compiles or not.

@sequencer
Copy link
Contributor

I didn't use jbr.nix, replacing it with the native jdk to make it runs well.

@wegank
Copy link
Member

wegank commented Oct 13, 2023

Merge conflict, please rebase.

@wegank wegank closed this Oct 13, 2023
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

5 participants