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

logrotate fails to finalize on riscv64 build #168829

Closed
Madouura opened this issue Apr 15, 2022 · 4 comments
Closed

logrotate fails to finalize on riscv64 build #168829

Madouura opened this issue Apr 15, 2022 · 4 comments
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@Madouura
Copy link
Contributor

Describe the bug

As the title states, it does not finish (cross) compiling to riscv64.

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0
shrinking /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0/sbin/logrotate
gzipping man pages under /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0/share/man/
riscv64-unknown-linux-gnu-strip is /nix/store/pmbl1qd8iqk4b44sdrj3advh8s9gcfbq-riscv64-unknown-linux-gnu-stage-final-gcc-debug-wrapper-10.3.0/bin/riscv64-unknown-linux-gnu-strip
stripping (with command riscv64-unknown-linux-gnu-strip and flags -S) in /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0/sbin
patching script interpreter paths in /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0
checking for references to /build/ in /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0...
moving /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0/sbin/* to /nix/store/yl7lljq9mcqci0k7wlbns4xm8fjz6321-logrotate-riscv64-unknown-linux-gnu-3.19.0/bin
building '/nix/store/n3nq3d79cvsf98b5pw1z88jn74xp43fv-logrotate.conf.drv'...
/build/.attr-0: line 14: /nix/store/76ry6fv0c7n31ah9jg0jm3mqci2n5knb-coreutils-riscv64-unknown-linux-gnu-9.0/bin/id: cannot execute binary file: Exec format error
builder for '/nix/store/n3nq3d79cvsf98b5pw1z88jn74xp43fv-logrotate.conf.drv' failed with exit code 126
cannot build derivation '/nix/store/a02x84vy2bak2b78m5vasdik8sd3nbf8-unit-logrotate-checkconf.service.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/cjzi5xqb95swyk490c3fv5jy0p4fwzw5-unit-logrotate.service.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vacc5bn1szk99p3pyb2q220xphyl6srj-system-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/wh3v282827cxpa4zfmlp5j7mrgxrjhk0-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/x24y87d0lpdz6ql2yfv3gfhkyfmabr6x-nixos-system-nixos-22.05pre-git.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/wp1h969krwbwlfdcqnrf106cgx062x8m-ext4-fs.img.zst-riscv64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7rv1nz4ksch76g316s6wqpcghqzxklxl-nixos-sd-image-22.05pre-git-riscv64-linux-visionfive.img-riscv64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
error: build of '/nix/store/7rv1nz4ksch76g316s6wqpcghqzxklxl-nixos-sd-image-22.05pre-git-riscv64-linux-visionfive.img-riscv64-unknown-linux-gnu.drv' failed

Steps To Reproduce

Steps to reproduce the behavior:

  1. Set up cross compilation either in nix-build or in your system.
  2. Attempt to finalize logrotate build
  3. ???
  4. It's borked!

Expected behavior

It should have compiled.

Additional context

Currently attempting a cross-compile for VisionFive.

Notify maintainers

@viric

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.16.19, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.16`
 - channels(root): `"nixos-21.11, home-manager-21.11"`
 - channels(mado): `"home-manager-21.11, nixos-21.11.337053.2f06b87f64b, nixos-unstable-22.05pre369117.ff9efb0724d"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@Madouura Madouura added the 0.kind: bug Something is broken label Apr 15, 2022
@Madouura Madouura mentioned this issue Apr 15, 2022
14 tasks
@Madouura
Copy link
Contributor Author

/build/.attr-0: line 14: /nix/store/76ry6fv0c7n31ah9jg0jm3mqci2n5knb-coreutils-riscv64-unknown-linux-gnu-9.0/bin/id: cannot execute binary file: Exec format error
builder for '/nix/store/n3nq3d79cvsf98b5pw1z88jn74xp43fv-logrotate.conf.drv' failed with exit code 126

Yeah, I think this is a cross-compilation issue.
Of course an x86 host can't execute a riscv64 program.
Now then... How to fix this... hmm...

@Madouura
Copy link
Contributor Author

Aha! It was in modules/services/logging/logrotate.nix after all!
Specifically, configFile.checkPhase where it calls pkgs.coreutils and pkgs.logrotate/sbin/logrotate may fail as well!

@Madouura
Copy link
Contributor Author

Looks like disabling checkConfig works for my problem, however keeping this open as I'm pretty sure this should be working even when cross-compiling.

@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Apr 22, 2022
@Madouura
Copy link
Contributor Author

Madouura commented May 1, 2022

Fixed by #166992

@Madouura Madouura closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests

2 participants