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

naja: 0-unstable-2024-08-27 -> 0-unstable-2025-01-13, fix cross #373848

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

FliegendeWurst
Copy link
Member

Simple update with some fixes for cross-compiling.

Things done

  • Built on platform(s)
    • x86_64-linux: and cross to aarch64
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jan 14, 2025
Copy link
Contributor

@eljamm eljamm left a comment

Choose a reason for hiding this comment

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

This seems to be building fine, but the executable doesn't work. I think we need to wrap it with the library as well:

./result/bin/naja_edit: error while loading shared libraries: libnaja_bne.so: cannot open shared object file: No such file or directory

@FliegendeWurst
Copy link
Member Author

Fixed. Though I don't really understand why "libnaja_bne.so" wasn't put in the lib output automatically.

@eljamm
Copy link
Contributor

eljamm commented Jan 15, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 373848


x86_64-linux

✅ 3 packages built:
  • naja
  • naja.dev
  • naja.lib

x86_64-darwin

✅ 3 packages built:
  • naja
  • naja.dev
  • naja.lib

aarch64-darwin

✅ 3 packages built:
  • naja
  • naja.dev
  • naja.lib

@eljamm
Copy link
Contributor

eljamm commented Jan 15, 2025

With nix build .#pkgsCross.aarch64-multiplatform.naja, I'm unable to cross-compile this from x86_64-linux to aarch64:

 last 25 log lines:
 > [ 42%] Compiling Cap'n Proto schema snl_implementation.capnp
 > /nix/store/5mh7kaj2fyv8mk4sfq1brwxgc02884wi-bash-5.2p37/bin/bash: line 1: /nix/store/5pbqr4hhyphm1fmfv56y6279vig684xd-capnproto-aarch64-unknown-linux-gnu-1.0.2/bin/capnp: cannot execute binary file: Exec format error
 > make[2]: *** [src/snl/snl/serialization/capnp/CMakeFiles/naja_snl_dump.dir/build.make:81: src/snl/snl/serialization/capnp/snl_interface.capnp.c++] Error 126
 > make[2]: *** Waiting for unfinished jobs....
 > [ 43%] Building CXX object src/snl/formats/verilog/CMakeFiles/naja_snl_verilog.dir/backend/SNLVRLDumper.cpp.o
 > /nix/store/5mh7kaj2fyv8mk4sfq1brwxgc02884wi-bash-5.2p37/bin/bash: line 1: /nix/store/5pbqr4hhyphm1fmfv56y6279vig684xd-capnproto-aarch64-unknown-linux-gnu-1.0.2/bin/capnp: cannot execute binary file: Exec format error
 > make[2]: *** [src/snl/snl/serialization/capnp/CMakeFiles/naja_snl_dump.dir/build.make:74: src/snl/snl/serialization/capnp/snl_common.capnp.c++] Error 126
 > /nix/store/5mh7kaj2fyv8mk4sfq1brwxgc02884wi-bash-5.2p37/bin/bash: line 1: /nix/store/5pbqr4hhyphm1fmfv56y6279vig684xd-capnproto-aarch64-unknown-linux-gnu-1.0.2/bin/capnp: cannot execute binary file: Exec format error
 > make[2]: *** [src/snl/snl/serialization/capnp/CMakeFiles/naja_snl_dump.dir/build.make:88: src/snl/snl/serialization/capnp/snl_implementation.capnp.c++] Error 126
 > make[1]: *** [CMakeFiles/Makefile2:864: src/snl/snl/serialization/capnp/CMakeFiles/naja_snl_dump.dir/all] Error 2
 > make[1]: *** Waiting for unfinished jobs....
 > [ 45%] Building CXX object src/snl/snippets/cpp/CMakeFiles/snl_snippet.dir/SNLSnippet.cpp.o
 > [ 46%] Building CXX object src/dnl/CMakeFiles/naja_dnl.dir/DNL.cpp.o
 > [ 46%] Building CXX object src/snl/formats/liberty/CMakeFiles/naja_snl_liberty.dir/SNLBooleanTree.cpp.o
 > [ 46%] Linking CXX executable snl_snippet
 > [ 46%] Built target snl_snippet
 > [ 46%] Linking CXX static library libnaja_snl_liberty.a
 > [ 46%] Built target naja_snl_liberty
 > [ 46%] Linking CXX shared library libnaja_dnl.so
 > [ 46%] Built target naja_dnl
 > [ 46%] Linking CXX static library libnaja_snl_verilog.a
 > [ 46%] Built target naja_snl_verilog
 > [ 47%] Linking CXX static library libnaja_snl_visual.a
 > [ 47%] Built target naja_snl_visual
 > make: *** [Makefile:136: all] Error 2

Fixed. Though I don't really understand why "libnaja_bne.so" wasn't put in the lib output automatically.

Yeah, I'm quite curious as well.

@FliegendeWurst
Copy link
Member Author

Oh right. I fixed capnproto cross some time ago but didn't get around to making a PR.

@FliegendeWurst FliegendeWurst marked this pull request as draft January 15, 2025 09:00
@FliegendeWurst FliegendeWurst marked this pull request as ready for review January 15, 2025 09:27
@FliegendeWurst
Copy link
Member Author

Fixed now, without modifying capnproto.

@eljamm
Copy link
Contributor

eljamm commented Jan 15, 2025

Yup, it cross-compiles fine now for aarch64.

I fixed capnproto cross some time ago but didn't get around to making a PR.

Should we perhaps add a note to remove those two flags after the capnproto fix is merged?

@eljamm
Copy link
Contributor

eljamm commented Jan 15, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 373848


x86_64-linux

✅ 3 packages built:
  • naja
  • naja.dev
  • naja.lib

x86_64-darwin

✅ 3 packages built:
  • naja
  • naja.dev
  • naja.lib

aarch64-darwin

✅ 3 packages built:
  • naja
  • naja.dev
  • naja.lib

Copy link
Contributor

@eljamm eljamm left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot!

@eljamm eljamm added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Jan 15, 2025
@fricklerhandwerk fricklerhandwerk merged commit bd041a3 into NixOS:master Jan 15, 2025
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants