-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Build failures with ninja #9861
Comments
I think this may be a linux specific issue, I'm not having an issue on macOS Sierra (ccache 3.3.2, ninja 1.7.1), current master (330e63c). |
PR-URL: #4767 Refs: nodejs/docs#38 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
cc @bnoordhuis since you made that commit. It still builds fine for me on OS X 10.10.5 |
ninja-on-linux probably puts the .a in a different location when standalone_static_library is on. Long shot but does this patch help? diff --git a/common.gypi b/common.gypi
index d87205e..f9f1597 100644
--- a/common.gypi
+++ b/common.gypi
@@ -42,7 +42,7 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
- ['GENERATOR == "ninja" or OS== "mac"', {
+ ['OS=="mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, { |
@bnoordhuis With the patch:
|
I'm experiencing this error while trying to patch Nixos's nodejs distribution to use the OS's v8 install. I can't figure out how to change the dependency on |
With the patch, libv8_base.a is referenced twice in the link step with different paths: diff --git a/common.gypi b/common.gypi
index d87205e..3afd4c4 100644
--- a/common.gypi
+++ b/common.gypi
@@ -42,12 +42,19 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
- ['GENERATOR == "ninja" or OS== "mac"', {
+ ['OS=="mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
- 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
- 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
+ 'conditions': [
+ ['GENERATOR=="ninja"', {
+ 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
+ 'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
+ }, {
+ 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
+ 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
+ }],
+ ],
}],
['openssl_fips != ""', {
'OPENSSL_PRODUCT': 'libcrypto.a', Actually, I suspect this patch makes things needlessly complex. Third take: diff --git a/common.gypi b/common.gypi
index d87205e..07a3970 100644
--- a/common.gypi
+++ b/common.gypi
@@ -43,11 +43,9 @@
'v8_postmortem_support%': 'true',
}],
['GENERATOR == "ninja" or OS== "mac"', {
- 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
- 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
- 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
+ 'V8_BASE': '<(LIB_DIR)/deps/v8/src/libv8_base.a',
}],
['openssl_fips != ""', {
'OPENSSL_PRODUCT': 'libcrypto.a',
diff --git a/node.gyp b/node.gyp
index e5f02d7..b077902 100644
--- a/node.gyp
+++ b/node.gyp
@@ -764,10 +764,10 @@
{
'action_name': 'node_dtrace_provider_o',
'inputs': [
- '<(OBJ_DIR)/node/src/node_dtrace.o',
+ '<(LIB_DIR)/node/src/node_dtrace.o',
],
'outputs': [
- '<(OBJ_DIR)/node/src/node_dtrace_provider.o'
+ '<(LIB_DIR)/node/src/node_dtrace_provider.o'
],
'action': [ 'dtrace', '-G', '-xnolibs', '-s', 'src/node_provider.d',
'<@(_inputs)', '-o', '<@(_outputs)' ]
@@ -817,7 +817,7 @@
'<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
],
'outputs': [
- '<(OBJ_DIR)/node/src/node_dtrace_ustack.o'
+ '<(LIB_DIR)/node/src/node_dtrace_ustack.o'
],
'conditions': [
[ 'target_arch=="ia32"', {
@@ -978,7 +978,7 @@
{
'action_name': 'expfile',
'inputs': [
- '<(OBJ_DIR)'
+ '<(LIB_DIR)'
],
'outputs': [
'<(PRODUCT_DIR)/node.exp' Please let me know whether they work for you. |
@bnoordhuis Second take:
Third take:
|
Okay, I'm going to leave this one for someone who cares about ninja. At least you know where to look now. :-) |
@bnoordhuis I've worked upon your second take and have arrived at the following patch which appears to fix the issue. Worthy of a PR?: diff --git a/common.gypi b/common.gypi
index 0fa36197be..8ce2aa72ab 100644
--- a/common.gypi
+++ b/common.gypi
@@ -42,12 +42,19 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
- ['GENERATOR == "ninja" or OS== "mac"', {
+ ['OS=="mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
- 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
- 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
+ 'conditions': [
+ ['GENERATOR=="ninja"', {
+ 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
+ 'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
+ }, {
+ 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
+ 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
+ }],
+ ],
}],
['openssl_fips != ""', {
'OPENSSL_PRODUCT': 'libcrypto.a',
diff --git a/node.gyp b/node.gyp
index e3f8aa83af..e48a5cf982 100644
--- a/node.gyp
+++ b/node.gyp
@@ -392,7 +392,7 @@
['OS in "linux freebsd" and node_shared=="false"', {
'ldflags': [
'-Wl,--whole-archive,'
- '<(PRODUCT_DIR)/obj.target/deps/openssl/'
+ '<(OBJ_DIR)/deps/openssl/'
'<(OPENSSL_PRODUCT)',
'-Wl,--no-whole-archive',
], |
Looks reasonable to me as long as the make-based build keeps working. Untested, but perhaps you can even get rid of the
|
Unfortunately doesn't seem to work :(
diff --git a/common.gypi b/common.gypi
index 0fa36197be..65b05112fd 100644
--- a/common.gypi
+++ b/common.gypi
@@ -42,12 +42,12 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
- ['GENERATOR == "ninja" or OS== "mac"', {
+ ['OS=="mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
- 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
- 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
+ 'OBJ_DIR': '<(INTERMEDIATE_DIR)/../..',
+ 'V8_BASE': '<(OBJ_DIR)/deps/v8/src/libv8_base.a',
}],
['openssl_fips != ""', {
'OPENSSL_PRODUCT': 'libcrypto.a',
diff --git a/node.gyp b/node.gyp
index e3f8aa83af..e48a5cf982 100644
--- a/node.gyp
+++ b/node.gyp
@@ -392,7 +392,7 @@
['OS in "linux freebsd" and node_shared=="false"', {
'ldflags': [
'-Wl,--whole-archive,'
- '<(PRODUCT_DIR)/obj.target/deps/openssl/'
+ '<(OBJ_DIR)/deps/openssl/'
'<(OPENSSL_PRODUCT)',
'-Wl,--no-whole-archive',
], But yeah, the diff I posted still passes |
Replacing |
On Linux, `ninja` appears to place `libv8_base.a` inside `OBJ_DIR`, as opposed to `ninja` on OS X which places it outside of that directory. Furthermore, the expected `OBJ_DIR` value (`obj.target/`) is actually just `obj/` for `ninja`. This patch solves both of these issues by setting `OBJ_DIR` and `V8_BASE` to the correct values for `ninja` on Linux specifically. Fixes: nodejs#9861
On Linux, `ninja` appears to place `libv8_base.a` inside `OBJ_DIR`, as opposed to `ninja` on OS X which places it outside of that directory. Furthermore, the expected `OBJ_DIR` value (`obj.target/`) is actually just `obj/` for `ninja`. This patch solves both of these issues by setting `OBJ_DIR` and `V8_BASE` to the correct values for `ninja` on Linux specifically. PR-URL: nodejs#11348 Fixes: nodejs#9861 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
On Linux, `ninja` appears to place `libv8_base.a` inside `OBJ_DIR`, as opposed to `ninja` on OS X which places it outside of that directory. Furthermore, the expected `OBJ_DIR` value (`obj.target/`) is actually just `obj/` for `ninja`. This patch solves both of these issues by setting `OBJ_DIR` and `V8_BASE` to the correct values for `ninja` on Linux specifically. PR-URL: #11348 Fixes: #9861 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Versions
Worth raising an issue to cover ninja build issues in these comments, reported by @sam-github and @kenany.
Info:
(copied from above thread)
Git bisect shows breaking commit as: e03a7b2
The text was updated successfully, but these errors were encountered: