Closed ChoqueCastroLD closed 1 year ago
Which compiler/version are you using?
I'm getting the same error on my system:
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.5.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.9 found at "/opt/homebrew/opt/python@3.10/bin/python3.10"
...
npm ERR! gyp ERR! System Darwin 22.5.0
npm ERR! gyp ERR! node -v v20.5.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
Using c++17
instead of c++14
seems to fix this issue:
diff --git a/binding.gyp b/binding.gyp
index 5b7d9f4..9e89fb8 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -37,7 +37,7 @@
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET": "10.10",
"OTHER_CFLAGS": [
- "-std=c++14",
+ "-std=c++17",
"-stdlib=libc++",
"-Wall",
"-Werror"
But there is also a compilation warning in the latest nan: https://github.com/nodejs/nan/issues/953.
So, -Werror
also breaks Node.js 20 builds. But this part should not be specific to mac.
I tried running splunk-otel
build in CI with those changes and it looks like linux build have some other issues as well:
> @splunk/otel@2.2.4 prebuild:os /__w/splunk-otel-js/splunk-otel-js
> node scripts/prebuild-os.js "20.0.0"
make: Entering directory '/__w/splunk-otel-js/splunk-otel-js/build'
CXX(target) Release/obj.target/metrics/src/native_ext/util/arena.o
CXX(target) Release/obj.target/metrics/src/native_ext/util/hex.o
CXX(target) Release/obj.target/metrics/src/native_ext/module.o
In file included from /tmp/prebuildify/node/20.0.0/include/node/v8-object.h:9:0,
from /tmp/prebuildify/node/20.0.0/include/node/v8-array-buffer.h:13,
from /tmp/prebuildify/node/20.0.0/include/node/v8.h:24,
from ../src/native_ext/splunk_v8.h:[6](https://github.com/lbeschastny/splunk-otel-js/actions/runs/5729232560/job/15525541275#step:6:7),
from ../src/native_ext/metrics.h:3,
from ../src/native_ext/module.cpp:1:
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:106:40: error: 'is_lvalue_reference_v' is not a member of 'std'
template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
^~~
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:106:66: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
^
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:106:6[7](https://github.com/lbeschastny/splunk-otel-js/actions/runs/5729232560/job/15525541275#step:6:8): error: template argument 1 is invalid
template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
^
/tmp/prebuildify/node/20.0.0/include/node/v[8](https://github.com/lbeschastny/splunk-otel-js/actions/runs/5729232560/job/15525541275#step:6:9)-maybe.h:106:71: error: expected unqualified-id before '>' token
template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
^
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:106:71: error: expected constructor, destructor, or type conversion before '>' token
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:123:38: error: 'is_lvalue_reference_v' is not a member of 'std'
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
^~~
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:123:64: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
^
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:123:65: error: template argument 1 is invalid
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
^
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:123:70: error: expected unqualified-id before '=' token
template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
^
/tmp/prebuildify/node/20.0.0/include/node/v8-maybe.h:123:70: error: expected constructor, destructor, or type conversion before '=' token
In file included from ../node_modules/nan/nan.h:60:0,
from ../src/native_ext/module.cpp:3:
/tmp/prebuildify/node/20.0.0/include/node/node.h:702:28: error: 'std::string_view' has not been declared
Environment* env, std::string_view main_script_source_utf8);
^~~~~~~~~~~
In file included from ../src/native_ext/module.cpp:3:0:
../node_modules/nan/nan.h: In function 'bool Nan::IdleNotification(int)':
../node_modules/nan/nan.h:687:32: warning: 'bool v8::Isolate::IdleNotificationDeadline(double)' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
idle_time_in_ms * 0.001);
^
In file included from /tmp/prebuildify/node/20.0.0/include/node/v8-initialization.h:13:0,
from /tmp/prebuildify/node/20.0.0/include/node/v8.h:34,
from ../src/native_ext/splunk_v8.h:6,
from ../src/native_ext/metrics.h:3,
from ../src/native_ext/module.cpp:1:
/tmp/prebuildify/node/20.0.0/include/node/v8-isolate.h:12[9](https://github.com/lbeschastny/splunk-otel-js/actions/runs/5729232560/job/15525541275#step:6:10)3:8: note: declared here
bool IdleNotificationDeadline(double deadline_in_seconds);
^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Release/obj.target/metrics/src/native_ext/module.o] Error 1
metrics.target.mk:126: recipe for target 'Release/obj.target/metrics/src/native_ext/module.o' failed
make: Leaving directory '/__w/splunk-otel-js/splunk-otel-js/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.15.0-[10](https://github.com/lbeschastny/splunk-otel-js/actions/runs/5729232560/job/15525541275#step:6:11)41-azure
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--target=20.0.0" "--devdir=/tmp/prebuildify/node" "--arch=x64" "--release"
gyp ERR! cwd /__w/splunk-otel-js/splunk-otel-js
gyp ERR! node -v v14.0.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @splunk/otel@2.2.4 prebuild:os: `node scripts/prebuild-os.js "20.0.0"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @splunk/otel@2.2.4 prebuild:os script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /github/home/.npm/_logs/2023-08-01T16_[13](https://github.com/lbeschastny/splunk-otel-js/actions/runs/5729232560/job/15525541275#step:6:14)_[20](https://github.com/lbeschastny/splunk-otel-js/actions/runs/5729232560/job/15525541275#step:6:21)_103Z-debug.log
Error: Process completed with exit code 1.
Version 2.3.1
should fix the issue for Node.js 20, please reopen or let us know if it still happens.
When updating to node 20.4.0 I get this error no matter the otel version I try