prebuild / prebuildify

Create and package prebuilds for native modules
MIT License
194 stars 36 forks source link

Deleting unwanted prebuilds for Yocto #60

Open jakew009 opened 2 years ago

jakew009 commented 2 years ago

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?

mafintosh commented 2 years ago

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