You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the issue with that particular test is that it looks at the default_configuration whereas most other add-on tests simply load the the binding.node from a hard-coded path. Does this patch fix the issue for you?
diff --git a/test/addons/repl-domain-abort/test.js b/test/addons/repl-domain-abort/test.js
index 5591b4f..057af4f 100644
--- a/test/addons/repl-domain-abort/test.js+++ b/test/addons/repl-domain-abort/test.js@@ -4,8 +4,7 @@ var assert = require('assert');
var repl = require('repl');
var stream = require('stream');
var path = require('path');
-var buildType = process.config.target_defaults.default_configuration;-var buildPath = path.join(__dirname, 'build', buildType, 'binding');+var buildPath = path.join(__dirname, 'build/Release/binding');
// On Windows, escape backslashes in the path before passing it to REPL.
if (common.isWindows)
buildPath = buildPath.replace(/\\/g, '/');
Should build/Debug be created or should the correct path be build/Release/binding?
As mentioned, most tests use a hard-coded path but that is arguably wrong: node-gyp builds add-ons in debug mode when a) --debug is passed, or b) the node binary used to build it is a debug build; the latter is something of a historical artifact.
IOW, build/Debug is the correct path some of the time but the tests don't currently respect it.
I don't mean to high jack this issue but it is somewhat related. I had an issue getting the add-on tests to run again after configured with --debug. What I mean is that I re-ran ./configure without the --debug option to generate a Release build.
My issue was that when running the tests, the build-addons target would not update the addon's config.gypi which still referred to "default_configuration": "Debug". To force an update I deleted test/addons/.buildstamp, and this allowed me to run the tests.
Should the removal of test/addons/.buildstamp perhaps be part of a target like clean or distclean?
Activity
bnoordhuis commentedon Jul 24, 2016
I think the issue with that particular test is that it looks at the default_configuration whereas most other add-on tests simply load the the binding.node from a hard-coded path. Does this patch fix the issue for you?
As mentioned, most tests use a hard-coded path but that is arguably wrong: node-gyp builds add-ons in debug mode when a)
--debugis passed, or b) the node binary used to build it is a debug build; the latter is something of a historical artifact.IOW, build/Debug is the correct path some of the time but the tests don't currently respect it.
fhinkel commentedon Jul 24, 2016
Thanks, that fixes it. I can't figure out how to generate build/Debug. I thought
BUILDTYPE=Debugwould do that.bnoordhuis commentedon Jul 25, 2016
You have to pass
--debugon the command line ornpm_config_debug=1in the environment.danbev commentedon Jul 26, 2016
I don't mean to high jack this issue but it is somewhat related. I had an issue getting the add-on tests to run again after configured with
--debug. What I mean is that I re-ran./configurewithout the--debugoption to generate a Release build.My issue was that when running the tests, the
build-addonstarget would not update the addon's config.gypi which still referred to"default_configuration": "Debug". To force an update I deletedtest/addons/.buildstamp, and this allowed me to run the tests.Should the removal of
test/addons/.buildstampperhaps be part of a target likecleanordistclean?fhinkel commentedon Jul 27, 2016
@danbev I'm having similar issues. Especially after switching back from older branches.
danbev commentedon Jul 27, 2016
@fhinkel Good to know that it is not just me :) I'll create a PR with a suggestion for handling.
build: adding config.gypi dep to addons/.buildstamp
build: adding config.gypi dep to addons/.buildstamp
build: adding config.gypi dep to addons/.buildstamp
build: adding config.gypi dep to addons/.buildstamp
build: adding config.gypi dep to addons/.buildstamp
build: adding config.gypi dep to addons/.buildstamp
build: adding config.gypi dep to addons/.buildstamp
Trott commentedon Jul 9, 2017
@fhinkel Should this issue remain open?
fhinkel commentedon Mar 19, 2018
No 🤣