Build failure: zigbee2mqtt (buildNpmPackage cross compilation) #355165
Labels
0.kind: build failure
A package fails to build
6.topic: cross-compilation
Building packages on a different platform than they will be used on
6.topic: nodejs
Steps To Reproduce
Build log
Without the
npmFlags
hack:With
npmFlags
hack, the package builds, but (as per runCommand) refers to the wrong nodejs and ends up being non-executable on ARM:Additional context
I'm trying to build an sdImage for Raspberry Pi 0 (armv6l) on a x86_64 system. Wanted to include zigbee2mqtt.
I've found #327653 which fixed nodejs building itself. It looks like this alone may not be sufficient.
I've done some digging and it looks to me
buildNpmPackage
is not cross-compile aware/ready. It pulls innodejs
in bothbuildInputs
andnativeBuildInputs
. Thenpm
used during setup is ofcourse thenativeBuildInputs
one, so x86_64 specific (explains-m64
presence, wrong script exec wrapper). It seems thebuildInputs
one is not present in any way during the build.Interestingly, when inspecting rootfs I found that both
nodejs
outputs (x86_64 and arm) are in/nix/store/
, withzigbee2mqtt
being the only one as "referer" (nix-store).FWIW If I do this (+
npmFlags
) to thezigbee2mqtt
override I can get it actually start (didn't check beyond that) on the resulting rootfs, but it's a nasty hack:Plenty of files in the
zigbee2mqtt
output in store still refer to the wrong nodejs in shebangs.Notify maintainers
@aduh95
@tie
@Cynerd
@sweber83
Metadata
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: