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

chickenPackages_5.chicken: fix cross-compilation #145194

Closed
wants to merge 1 commit into from

Conversation

Artturin
Copy link
Member

@Artturin Artturin commented Nov 9, 2021

Motivation for this change

Supersedes #104775

Things done

nix build ".#pkgsCross.aarch64-multiplatform.chicken"
nix build ".#chicken"

  • 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 wip"
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 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.

@Artturin Artturin mentioned this pull request Nov 9, 2021
14 tasks
Copy link
Contributor

@corngood corngood left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@Artturin
Copy link
Member Author

Artturin commented Nov 9, 2021

chickenPackages.egg2nix fails with > /nix/store/ffcrrgb6k5h7crr93dj90bi9fy1jvj16-binutils-2.35.1/bin/ld: cannot find crti.o: No such file or directory

@siraben
Copy link
Member

siraben commented Nov 9, 2021

nix-build .#pkgsCross.raspberryPi.chicken fails:

$ nix log /nix/store/x503zkjmvxvhwz7y5dpd802gcnp6jyx6-chicken-5.2.0.drv | ix
http://ix.io/3Evw

@Mic92
Copy link
Member

Mic92 commented Nov 9, 2021

Did egg2nix already fail before?
@GrahamcOfBorg build egg2nix

Copy link
Contributor

@Mindavi Mindavi left a comment

Choose a reason for hiding this comment

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

Make sure that it also works with clang / compilers with a different prefix.

Otherwise, LGTM.

Tested building chickenPackages_5.chicken as native build and cross-compiled to aarch64-multiplatform.

Tested both native version and cross version by running csi (using qemu-aarch64 for the cross case). I don't know the language and haven't actually tried any expressions, but the interpreter seems to at least run.

"PREFIX=$(out)"
"HOSTSYSTEM=${hostPlatform.config}"
"TARGETSYSTEM=${targetPlatform.config}"
"LIBRARIAN=$(HOSTSYSTEM)-gcc-ar"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work without the -gcc part?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Nov 15, 2021
@siraben
Copy link
Member

siraben commented Nov 21, 2021

@Mindavi you can try (define (fact n) (if (= n 0) 1 (* n (fact (- n 1))))) (fact 6)

@Artturin
Copy link
Member Author

nix build ".#pkgsCross.aarch64-multiplatform.chickenPackages_5.egg2nix"

chicken-matchable> /nix/store/9wxfxzd1bdfpirvv90nasik7ww10fyqw-stdenv-linux/setup: line 1345: chicken-install: command not found

if i do

diff --git a/pkgs/development/compilers/chicken/5/eggDerivation.nix b/pkgs/development/compilers/chicken/5/eggDerivation.nix
index a6d19eaeb13..61a3c92de5a 100644
--- a/pkgs/development/compilers/chicken/5/eggDerivation.nix
+++ b/pkgs/development/compilers/chicken/5/eggDerivation.nix
@@ -17,8 +17,8 @@ in
 stdenv.mkDerivation ({
   name = "chicken-${name}";
   propagatedBuildInputs = buildInputs;
-  nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ chicken ];
+  nativeBuildInputs = [ makeWrapper chicken ];
+  buildInputs = [ ];
 
   CSC_OPTIONS = lib.concatStringsSep " " cscOptions;
 

then it fails with

chicken-matchable> /nix/store/rc7ny3a5slwxzy3scgrmm8vg7m72birv-chicken-aarch64-unknown-linux-gnu-5.2.0/bin/chicken-install: line 3: /nix/store/rc7ny3a5slwxzy3scgrmm8vg7m72birv-chicken-aarch64-unknown-linux-gnu-5.2.0/bin/.chicken-install-wrapped: cannot execute binary file:Exec format error

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 sort platform than than they will be run on 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12.approvals: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants