bbc / speculate

Automatically generates an RPM Spec file for your Node.js project
Other
66 stars 28 forks source link

add ability to define npm rebuild arguments #40

Closed scripter-co closed 7 years ago

scripter-co commented 7 years ago

Reason for this PR:

Recently our build agents upgraded to version 1.4.4 of mock and in version 1.4.1 they added the following:

Mock previously used chroot technology. Few past releases Mock offered systemd-nspawn which is modern container technology for better isolation. This release use systemd-nspawn as default. If you want to preserve previous behaviour you can use --old-chroot option. NOTE: network is disabled inside container by default now; take a look into site-defaults.cfg for desired options (like rpmbuild_networking).

This, tied with the fact node-gyp will require the internet when doing an npm rebuild, we need the ability to add arguments to the npm rebuild command.

This PR adds an npmRebuildArgs parameter (open to suggestions on this name) which will allow us to do something like what has been added to the README.md:

{
  "spec": {
    "npmRebuildArgs": "--nodedir=/usr/lib"
  }
}
Mousius commented 7 years ago

Further investigation shows that this can be done using build environment variables and doesn't actually fix the issue we were seeing 😿