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

raspberrypifw: fix cross 'builds' #44349

Merged

Conversation

georgewhewell
Copy link
Contributor

Motivation for this change

unprefixed ar is not found when cross compiling. the change in this PR allows it to build

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@georgewhewell georgewhewell changed the title rasperrypifw: fix cross 'builds' raspberrypifw: fix cross 'builds' Aug 2, 2018
@matthewbauer
Copy link
Member

@GrahamcOfBorg build pkgsCross.raspberryPi.raspberrypiWirelessFirmware

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: pkgsCross.raspberryPi.raspberrypiWirelessFirmware

Partial log (click to expand)

unpacking sources
unpacking source archive /nix/store/lqm5hnip4g4b05x6w248fcqxwbjlypcb-bluez-firmware_1.2-3+rpt5.debian.tar.xz
unpacking source archive /nix/store/pqcwn6nq03f2dixwbkmq9c528l4y0v09-firmware-brcm80211_20161130-3+rpt3_all.deb
source root is .
setting SOURCE_DATE_EPOCH to timestamp 1525089442 of file ./debian/patches/series
patching sources
configuring
no configure script, doing nothing
installing
/nix/store/fanqskh220zsnxawsvwx6l3bzy9pyc3h-raspberrypi-wireless-firmware-2018-05-30-armv6l-unknown-linux-gnueabihf

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

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

Looks okay. This is actually something where we could make it a fixed output so that it is the same for all versions. There is no real cross compilation going on here.

See https://nixos.org/nix/manual/#sec-advanced-attributes and outputHash, outputHashAlgo, outputHashMode.

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: pkgsCross.raspberryPi.raspberrypiWirelessFirmware

Partial log (click to expand)

post-installation fixup
patching script interpreter paths in /nix/store/j3q1fga69iyxr7gd5r8j8nx2hidp4w3z-armv6l-unknown-linux-gnueabihf-stage-static-gcc-debug-wrapper-7.3.0
building '/nix/store/cr067wcz3jva6s4a2b6bkqi33l3dwva2-stdenv-darwin.drv'...
cannot build derivation '/nix/store/jrlhaz3vcd58jg5ii4l2aama5xii54qp-glibc-2.27-armv6l-unknown-linux-gnueabihf.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/bb47wkwzmii22wk7bn6mgbkl8hph5l6d-armv6l-unknown-linux-gnueabihf-binutils-wrapper-2.30.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5afw0blzkkdfnxj7zk46hl2c7wb02yi7-armv6l-unknown-linux-gnueabihf-stage-final-gcc-debug-7.3.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/820kw5613vhaa30i2idczmgx986y3fr3-armv6l-unknown-linux-gnueabihf-stage-final-gcc-debug-wrapper-7.3.0.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/1cx81ax9ndsah42m0nyrh51y63jbzmdr-stdenv-darwin.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ri5lnnzk6zz8z7w88l0bjv4kgywmdf1f-raspberrypi-wireless-firmware-2018-05-30-armv6l-unknown-linux-gnueabihf.drv': 1 dependencies couldn't be built
error: build of '/nix/store/ri5lnnzk6zz8z7w88l0bjv4kgywmdf1f-raspberrypi-wireless-firmware-2018-05-30-armv6l-unknown-linux-gnueabihf.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: pkgsCross.raspberryPi.raspberrypiWirelessFirmware

Partial log (click to expand)

unpacking source archive /nix/store/lqm5hnip4g4b05x6w248fcqxwbjlypcb-bluez-firmware_1.2-3+rpt5.debian.tar.xz
unpacking source archive /nix/store/pqcwn6nq03f2dixwbkmq9c528l4y0v09-firmware-brcm80211_20161130-3+rpt3_all.deb
source root is .
setting SOURCE_DATE_EPOCH to timestamp 1525089442 of file ./debian/patches/series
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
no configure script, doing nothing
installing
/nix/store/g4mvw4y7v0467vmihjx5586g443f5mby-raspberrypi-wireless-firmware-2018-05-30-armv6l-unknown-linux-gnueabihf

@dezgeg
Copy link
Contributor

dezgeg commented Aug 3, 2018

Yeah, changing to fixed-output sounds better. Or maybe instead of open-coding the ar + tar, use dpkg -x.

@dezgeg
Copy link
Contributor

dezgeg commented Aug 3, 2018

Or actually, both should be done, they are not mutually exclusive. tar xf data.tar.xz will break if the archive format changes from xz to something else.

@georgewhewell georgewhewell force-pushed the fix-raspberrypifw-wireless-cross branch from 810cda9 to bed0266 Compare August 5, 2018 20:22
@georgewhewell
Copy link
Contributor Author

@dezgeg Thanks, I added fixed output attributes. Not sure what you mean about using dpkg- I haven't seen derivation that unpacks two src before so don't know best practice

@dezgeg
Copy link
Contributor

dezgeg commented Aug 5, 2018

What I mean is you can use dpkg -x to unpack the thing in place of the ar + tar like here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/version-management/gitkraken/default.nix#L72

@georgewhewell georgewhewell force-pushed the fix-raspberrypifw-wireless-cross branch from bed0266 to 22ce4af Compare August 5, 2018 20:52
@georgewhewell
Copy link
Contributor Author

@dezgeg oh, of course. have updated

@dezgeg dezgeg merged commit a052e52 into NixOS:master Aug 6, 2018
@georgewhewell georgewhewell deleted the fix-raspberrypifw-wireless-cross branch August 6, 2018 11:51
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

4 participants