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

Feature request: possibility to work completely offline #254

Closed
alejandroclaro opened this issue Aug 25, 2021 · 4 comments
Closed

Feature request: possibility to work completely offline #254

alejandroclaro opened this issue Aug 25, 2021 · 4 comments

Comments

@alejandroclaro
Copy link

I have a project where the build must be performed completely offline and only audited components can be used during the build. We have been developing some native NodeJS modules, and we are trying to use CMake instead of node-gyp. However, looks like that if "cmake-js compile" is executed during the "install" script, it always tries to download the runtime instead of looking for common places where it could be already located.

It should be possible to control the dependencies that cmake-js is using without unexpected surprises.

@milahu
Copy link
Contributor

milahu commented Sep 14, 2021

offline build is also needed for nixos

cmake-js/lib/dist.js

Lines 102 to 106 in 18f4cbe

Dist.prototype.ensureDownloaded = async function () {
if (!this.downloaded) {
await this.download();
}
};

the files in dist.downloaded (deps/v8/include/v8.h ...) are part of the nodejs source at https://github.com/nodejs/node (version must match the node binary, of course)

so the hardest part is getting the dist.internalPath

new (require('cmake-js')).Dist().internalPath == "/home/user/.cmake-js/node-x64/v16.8.0"

@alejandroclaro
Copy link
Author

Why not considered the definition of npm_config_nodedir variable that is use in other build systems like node-gyp and electron-gyp?

They allow the definition of this variable thought npm config set and use the path instead or trying to download the runtime headers if this is defined.

@unbornchikken
Copy link
Member

Ty for #260

Can you confirm that it solves your issue there?

@alejandroclaro
Copy link
Author

It solves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants