-
Notifications
You must be signed in to change notification settings - Fork 268
Open
Description
❓ Question: node-pre-gyp build behavior and documentation discrepancy
While working with node-pre-gyp, I noticed a potential discrepancy between:
- The
README.mdcommand list - The inline code comments
- The actual behavior in source
📌 Context
In the code comments, it says "We map node-pre-gyp build to node-gyp configure build", but in practice, node-pre-gyp build does not trigger node-gyp configure — only node-pre-gyp rebuild does.
However, the README does not mention anything about whether configure is required before running build or rebuild, which could be confusing for users.
Here is the source code:
function build(gyp, argv, callback) {
// Form up commands to pass to node-gyp:
// We map `node-pre-gyp build` to `node-gyp configure build` so that we do not
// trigger a clean and therefore do not pay the penalty of a full recompile
if (argv.length && (argv.indexOf('rebuild') > -1)) {
argv.shift(); // remove `rebuild`
// here we map `node-pre-gyp rebuild` to `node-gyp rebuild` which internally means
// "clean + configure + build" and triggers a full recompile
compile.run_gyp(['clean'], {}, (err3) => {
if (err3) return callback(err3);
configure(gyp, argv, (err4) => {
if (err4) return callback(err4);
return do_build(gyp, argv, callback);
});
});
} else {
return do_build(gyp, argv, callback);
}
}
🧩 My Questions
- Is this behavior intentional?
- Would it be possible to:
- update the README to explicitly mention the need for configure before build?
- clarify the inline comment in build.js to avoid confusion?
Metadata
Metadata
Assignees
Labels
No labels