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

rpcsvc-proto: fix cross-compilation #101234

Merged
merged 1 commit into from Oct 21, 2020
Merged

Conversation

@danielfullmer
Copy link
Contributor

@danielfullmer danielfullmer commented Oct 21, 2020

Tested pkgsCross.armv7l-hf-multiplatform.rpvscv-proto

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@Ma27
Copy link
Member

@Ma27 Ma27 commented Oct 21, 2020

@danielfullmer On your branch (ed5bda1 to be precise) I still get the following build failure when running nix-build -A pkgsCross.armv7l-hf-multiplatform.rpcsvc-proto:

building
build flags: SHELL=/nix/store/k8p54jg8ipvnfz435mayf5bnqhw4qqap-bash-4.4-p23/bin/bash
make  all-recursive
make[1]: Entering directory '/build/source'
Making all in rpcgen
make[2]: Entering directory '/build/source/rpcgen'
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_clntout.o rpc_clntout.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_cout.o rpc_cout.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_hout.o rpc_hout.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_main.o rpc_main.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_parse.o rpc_parse.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_sample.o rpc_sample.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_scan.o rpc_scan.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_svcout.o rpc_svcout.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_tblout.o rpc_tblout.c
armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -c -o rpc_util.o rpc_util.c
armv7l-unknown-linux-gnueabihf-gcc  -g -O2   -o rpcgen rpc_clntout.o rpc_cout.o rpc_hout.o rpc_main.o rpc_parse.o rpc_sample.o rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o
make[2]: Leaving directory '/build/source/rpcgen'
Making all in rpcsvc
make[2]: Entering directory '/build/source/rpcsvc'
../rpcgen/rpcgen -h -o klm_prot.h klm_prot.x
/nix/store/k8p54jg8ipvnfz435mayf5bnqhw4qqap-bash-4.4-p23/bin/bash: ../rpcgen/rpcgen: cannot execute binary file: Exec format error
make[2]: *** [Makefile:582: klm_prot.h] Error 126
make[2]: Leaving directory '/build/source/rpcsvc'
make[1]: *** [Makefile:391: all-recursive] Error 1
make[1]: Leaving directory '/build/source'
make: *** [Makefile:332: all] Error 2
error: --- Error --- build-remote
build of '/nix/store/7gznyxfrzy5z8c86d5kimyvzixc5dcn9-rpcsvc-proto-1.4.2-armv7l-unknown-linux-gnueabihf.drv' on 'ssh://builder-ng' failed: error: --- Error --- nix-store
builder for '/nix/store/7gznyxfrzy5z8c86d5kimyvzixc5dcn9-rpcsvc-proto-1.4.2-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2
error: --- Error ------------------------------------------------------------------------------------------------------------------- nix-build
error: --- Error --- nix-daemon
builder for '/nix/store/7gznyxfrzy5z8c86d5kimyvzixc5dcn9-rpcsvc-proto-1.4.2-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 1

@danielfullmer
Copy link
Contributor Author

@danielfullmer danielfullmer commented Oct 21, 2020

I had boot.binfmt.emulatedSystems = [ "armv7l-linux" ]; in my nixos configuration, so I missed this! I'll take a look at this soon.

Tested pkgsCross.armv7l-hf-multiplatform.rpvscv-proto
@danielfullmer danielfullmer force-pushed the cross-rpcsvc-proto branch from ed5bda1 to 91493df Oct 21, 2020
@danielfullmer
Copy link
Contributor Author

@danielfullmer danielfullmer commented Oct 21, 2020

Just pushed a fix. Also verified that the generated headers under result/include/rpcsvc were the same between the native and cross-compiled version.

Ma27
Ma27 approved these changes Oct 21, 2020
@Ma27 Ma27 merged commit a3b1b42 into NixOS:master Oct 21, 2020
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants