prebuildify icon indicating copy to clipboard operation
prebuildify copied to clipboard

Deleting unwanted prebuilds for Yocto

Open jakew009 opened this issue 4 years ago • 1 comments

This is kind of a follow on to this: https://github.com/prebuild/prebuildify/issues/54

We use a package (msgpackr-extract) that relies on prebuildify to do it's prebuilding.

The problem we have is that prebuildify leaves the various prebuilt binaries on the OS, even the ones that cannot possibly run (like 64 bit ones on a 32 bit system).

This is obviously normally not a problem, except for when you try and use it with a system like Yocto to build an OS.

Yocto has various QA systems and uses objcopy to move the binaries across. It blows up when you try and copy a 64 bit binary to a 32 bit OS because it knows it could never possibly run.

My current solution is rm -rf node_modules/msgpackr-extract/prebuilds after npm install has finished, to wipe out all the prebuilt binaries (the one we need isn't shipped anyway). Obviously, this is a bit of an ugly hack.

Is there any way that this situation could be handled differently to make it more compatible with build systems?

jakew009 avatar Feb 01 '22 11:02 jakew009

Nothing in prebuildify for that no, but you could make a prune tool / option that removes all non-relevant builds

mafintosh avatar Feb 01 '22 11:02 mafintosh