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

shared_library builds have moved location #2233

Open
rvagg opened this issue Oct 6, 2020 · 12 comments
Open

shared_library builds have moved location #2233

rvagg opened this issue Oct 6, 2020 · 12 comments

Comments

@rvagg
Copy link
Member

rvagg commented Oct 6, 2020

There's some urgency to this with the pending npm@7 release.

Ref: nodejs/node#35474

node-gyp 5.1.0 (current npm version):

build/
build/binding.target.mk
build/ping.target.mk
build/config.gypi
build/binding.Makefile
build/Release
build/Release/.deps
build/Release/.deps/Release
build/Release/.deps/Release/ping.so.d
build/Release/.deps/Release/obj.target
build/Release/.deps/Release/obj.target/binding
build/Release/.deps/Release/obj.target/binding/binding.o.d
build/Release/.deps/Release/obj.target/ping.so.d
build/Release/.deps/Release/obj.target/binding.node.d
build/Release/.deps/Release/obj.target/ping
build/Release/.deps/Release/obj.target/ping/ping.o.d
build/Release/.deps/Release/binding.node.d
build/Release/ping.so
build/Release/obj.target
build/Release/obj.target/binding
build/Release/obj.target/binding/binding.o
build/Release/obj.target/ping.so
build/Release/obj.target/binding.node
build/Release/obj.target/ping
build/Release/obj.target/ping/ping.o
build/Release/binding.node
build/Makefile

current node-gyp master:

build/
build/binding.target.mk
build/ping.target.mk
build/config.gypi
build/binding.Makefile
build/Release
build/Release/.deps
build/Release/.deps/Release
build/Release/.deps/Release/lib.target
build/Release/.deps/Release/lib.target/ping.so.d
build/Release/.deps/Release/obj.target
build/Release/.deps/Release/obj.target/binding
build/Release/.deps/Release/obj.target/binding/binding.o.d
build/Release/.deps/Release/obj.target/ping.so.d
build/Release/.deps/Release/obj.target/binding.node.d
build/Release/.deps/Release/obj.target/ping
build/Release/.deps/Release/obj.target/ping/ping.o.d
build/Release/.deps/Release/binding.node.d
build/Release/lib.target
build/Release/lib.target/ping.so
build/Release/obj.target
build/Release/obj.target/binding
build/Release/obj.target/binding/binding.o
build/Release/obj.target/ping.so
build/Release/obj.target/binding.node
build/Release/obj.target/ping
build/Release/obj.target/ping/ping.o
build/Release/binding.node
build/Makefile

Note the difference in location of ping.so. The test is expecting it to be in build/${common.buildType}/ping.so.

binding.gyp is @ https://github.com/nodejs/node/blob/master/test/addons/dlopen-ping-pong/binding.gyp

@targos

About #1975 (review):
Back in 2012, node-gyp made a local patch to gyp, changing where shared libraries would be written.
When I reunited the gyp code between node-gyp and Node.js last year, this change was reverted as we didn't find why it was done in the first place, and keeping it was breaking the Node.js builds.

npm@7 is about to go out with our latest code and it's going to mean shared libraries are in a different location, arguably an internal build location that shouldn't be of concern to consumers (like obj.target). This is going to mean people using shared library builds need to add yet another location to search for their .so on top of the current list (see https://ghub.io/bindings for the full list so far).

IMO this is a bug and we should fix it. But we need to figure out how to get it addressed here for our needs but not break nodejs/node.

This is mostly a question for @nodejs/gyp people since I think the bulk of the work needs to be done there.

/cc @nodejs/node-gyp

@ryzokuken
Copy link
Contributor

So, I have two thoughts. On one hand, I think I'd be really happy if we figured out what the more appropriate behavior was, and switch to that, atleast in the longer run. One another, I think we should really fix this behavior for node-gyp right now, handle it properly in node core (since that doesn't affect the ecosystem) and only change it if needed in a major release.

@rvagg
Copy link
Member Author

rvagg commented Oct 7, 2020

I'm inclined to think that the appropriate behaviour is what it's always done, which is to place the final .so in the same place as standard target builds. Getting it baked into a major release of npm is going to be painful for us and the ecosystem—we're either going to have to adapt to it or quickly push out a "fix" for it because we were wrong.

Re a2ed0df

I can't really make sense of the original behaviour. And this comment prefixing it all just makes it even more confusing:

# Xcode puts shared_library results into PRODUCT_DIR, and some gyp files
# rely on this. Emulate this behavior for mac.

Combined with the self.flavor != 'mac' leaves me scratching my head. Why is it good enough for mac to put it in PRODUCT_DIR but ever other platform to go deeper into lib.X? There must be some original precedent that made that the appropriate choice but then when they added Xcode support it had a different behaviour and they decided to unify the make behaviour on mac with the Xcode version. But it was too baked in at the time to move every other platform?

But IMO Nate baked in the behaviour for node-gyp that it should be in the top of $(builddir), so changing it is our problem now.

Maybe it's simply that gyp wasn't originally designed to build exposed shared libraries and that shared libraries were just intermediate targets to build the final exposed targets, so shared libraries were somehow meant to be hidden behind all of the gyp cruft (kind of weird with shared libraries, but perhaps?). But with node-gyp we're allowing users to expose shared libraries so the use-case is different to gyp's original intent.

What are the implications of changing this for nodejs/node?

@targos
Copy link
Member

targos commented Oct 7, 2020

I don't remember what the implications are. We need to try a new CI run to see the exact errors. My first thought is that it can be an issue for cross-compiled builds, because the output for target and host would overwrite themselves.

@targos
Copy link
Member

targos commented Oct 7, 2020

@rvagg do you know any project / npm module that relies on shared libraries being output in a specific place and will be broken by npm 7? We haven't found one in CITGM.

@rvagg
Copy link
Member Author

rvagg commented Oct 9, 2020

Yeah, good question. Here's some candidates (not exhaustive since there are projects that have sub-definitions in files not named binding.gyp): https://github.com/search?l=&q=%22shared_library%22+filename%3Abinding.gyp&type=code

appmetrics is in the list, I imagine that's quite popular and worth testing out.

@rvagg
Copy link
Member Author

rvagg commented Oct 9, 2020

OK, here's why we need to fix this: MylesBorins/node@73150f9#diff-0e3a10eceb23013e92432a2df0befd92

-module.exports.load(`${path.dirname(bindingPath)}/ping.so`);
+
+let pingSOPath = `${path.dirname(bindingPath)}/lib.target/ping.so`;
+
+if (common.isOSX) {
+  pingSOPath = `${path.dirname(bindingPath)}/ping.so`;
+}
+
+console.log('module.exports.load:', pingSOPath);
+module.exports.load(pingSOPath);

we have divergent behaviour between the Xcode generator and the make generator, as per the note in GYP about this. So not only would users need to adapt to a new location for shared libraries, they need to branch on platform.

Now I don't know who this would break for, there are plenty of projects out there using shared_library but I don't know if many are actually loading them from Node rather than simply using them for intermediates in their build. So maybe the impact is low. But the platform discrepancy is enough of a problem on its own that we should fix this.

@targos
Copy link
Member

targos commented Oct 9, 2020

I agree that it is worth fixing, but I'm not certain it should be done in gyp itself. Would it be possible to move the files from node-gyp? How does it work with the .node binary now?

@rvagg
Copy link
Member Author

rvagg commented Oct 9, 2020

It just defers entirely to gyp. node-gyp's role is to simply serve as a JS wrapper to setup the environment and invoke it with the right arguments.

@richardlau
Copy link
Member

richardlau commented Oct 9, 2020

The .node binary is a loadable module:

node-gyp/addon.gypi

Lines 7 to 8 in 1e2e94d

'target_defaults': {
'type': 'loadable_module',

node-gyp/addon.gypi

Lines 41 to 43 in 1e2e94d

'target_conditions': [
['_type=="loadable_module"', {
'product_extension': 'node',

which means it doesn't get follow the same path as shared_libarary:

def _InstallableTargetInstallPath(self):
"""Returns the location of the final output for an installable target."""
# Xcode puts shared_library results into PRODUCT_DIR, and some gyp files
# rely on this. Emulate this behavior for mac.
if self.type == "shared_library" and (
self.flavor != "mac" or self.toolset != "target"
):
# Install all shared libs into a common directory (per toolset) for
# convenient access with LD_LIBRARY_PATH.
return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias)
return "$(builddir)/" + self.alias

In practical terms perhaps we could add a switch the toggle the behavior in gyp and then pass/trigger that when calling gyp from node-gyp?

@richardlau
Copy link
Member

Yeah, good question. Here's some candidates (not exhaustive since there are projects that have sub-definitions in files not named binding.gyp): https://github.com/search?l=&q=%22shared_library%22+filename%3Abinding.gyp&type=code

appmetrics is in the list, I imagine that's quite popular and worth testing out.

FWIW appmetrics is broken by this but it currently depends on node-gyp 5 so it isn't immediately obvious when testing with the current v15.0.0-proposal (with npm 7):
https://github.com/RuntimeTools/appmetrics/blob/4862e6882e85b63ea22c55cb4b273f17ef4820cb/package.json#L10

Changing that to `7.x` gives:
make: *** No rule to make target `Release/libagentcore.so', needed by `../omr-agentcore/libagentcore.so'.  Stop.
-bash-4.2$ PATH=/home/riclau/sandbox/bin/testnode/bin/:$PATH npm_config_nodedir=/home/riclau/sandbox/bin/testnode npm install
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

> appmetrics@5.1.1 install
> node showBuildInfo.js && node-gyp rebuild

Fri, 09 Oct 2020 11:20:45 GMT
********************************************************************************
You are installing the Node Application Metrics monitoring and profiling module.
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
********************************************************************************


********************************************************************************
Appmetrics uses node-gyp to compile and build local binary libraries to enhance execution performance. If the following compilation and build logs contain errors, make sure you have the node-gyp pre-requisites installed (https://github.com/nodejs/node-gyp#installation). If you have them and the build still had errors, see if there are any related issues at https://github.com/RuntimeTools/appmetrics/issues). If there aren't, feel free to open a new issue to report the bug.
********************************************************************************


gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.0
gyp info using node@15.0.0 | linux | x64
gyp info find Python using Python version 2.7.5 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/home/users/riclau/sandbox/github/appmetrics/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/users/riclau/sandbox/github/appmetrics/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/users/riclau/sandbox/github/appmetrics/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/riclau/sandbox/bin/testnode/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/riclau/sandbox/bin/testnode',
gyp info spawn args   '-Dnode_gyp_dir=/home/users/riclau/sandbox/github/appmetrics/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/riclau/sandbox/bin/testnode/$(Configuration)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/users/riclau/sandbox/github/appmetrics',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/users/riclau/sandbox/github/appmetrics/build'
make: Warning: File `omr-agentcore/memoryplugin.target.mk' has modification time 28 s in the future
  ACTION binding_gyp_appmetrics_target_Set_appmetrics_reported_version_build_level Release/obj.target/appmetrics/geni/appmetrics.cpp
infile: ./src/appmetrics.cpp
outfile: /home/users/riclau/sandbox/github/appmetrics/build/Release/obj.target/appmetrics/geni/appmetrics.cpp
Replacing '"99\.99\.99\.29991231"' with '"5.1.1.202010090720"'
  CXX(target) Release/obj.target/appmetrics/geni/appmetrics.o
Release/obj.target/appmetrics/geni/appmetrics.cpp: In function ‘void emitMessage(uv_async_t*, int)’:
Release/obj.target/appmetrics/geni/appmetrics.cpp:424:44: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
         listener->callback->Call(argc, argv);
                                            ^
In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:22:0:
../node_modules/nan/nan.h:1742:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
  CXX(target) Release/obj.target/appmetrics/src/headlessutils.o
../src/headlessutils.cpp: In function ‘void headless::asyncfunc(uv_async_t*)’:
../src/headlessutils.cpp:51:39: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
    headless::zipFunction->Call(1, argv);
                                       ^
In file included from ../src/headlessutils.h:21:0,
                 from ../src/headlessutils.cpp:18:
../node_modules/nan/nan.h:1742:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
  CXX(target) Release/obj.target/appmetrics/src/objecttracker.o
  SOLINK_MODULE(target) Release/obj.target/appmetrics.node
  COPY Release/appmetrics.node
  CXX(target) Release/obj.target/heapdump/src/heapdump/heapdump.o
../src/heapdump/heapdump.cc: In function ‘void {anonymous}::InvokeCallback(const char*)’:
../src/heapdump/heapdump.cc:143:32: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
                      argc, argv);
                                ^
In file included from ../src/heapdump/heapdump.cc:15:0:
/home/riclau/sandbox/bin/testnode/include/node/node.h:191:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/riclau/sandbox/bin/testnode/include/node/node.h:108:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/heapdump.node
  COPY Release/heapdump.node
  ACTION omr_agentcore_binding_gyp_agentcore_target_Set_core_reported_version_build_level Release/obj.target/agentcore/geni/monitoring/agent/Agent.cpp
infile: ./src/ibmras/monitoring/agent/Agent.cpp
outfile: /home/users/riclau/sandbox/github/appmetrics/build/Release/obj.target/agentcore/geni/monitoring/agent/Agent.cpp
Replacing '"99\.99\.99\.29991231"' with '"3.2.9.202010090720"'
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/Logger.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/LogManager.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/MemoryManager.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/util/FileUtils.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/util/LibraryUtils.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/port/linux/Thread.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/port/linux/Process.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/port/Lock.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/port/ThreadData.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/Properties.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/PropertiesFile.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/util/strUtils.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/common/util/sysUtils.o
  CXX(target) Release/obj.target/agentcore/geni/monitoring/agent/Agent.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/agent/threads/ThreadPool.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/agent/threads/WorkerThread.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/agent/SystemReceiver.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/connector/ConnectorManager.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/agent/Bucket.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/agent/BucketList.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/Plugin.o
  CXX(target) Release/obj.target/agentcore/omr-agentcore/src/ibmras/monitoring/connector/configuration/ConfigurationConnector.o
  SOLINK(target) Release/obj.target/omr-agentcore/libagentcore.so
  COPY Release/lib.target/libagentcore.so
  CXX(target) Release/obj.target/hcapiplugin/omr-agentcore/src/ibmras/monitoring/connector/api/APIConnector.o
  SOLINK(target) Release/obj.target/omr-agentcore/libhcapiplugin.so
  COPY Release/lib.target/libhcapiplugin.so
  CXX(target) Release/obj.target/envplugin/omr-agentcore/src/ibmras/monitoring/plugins/common/environment/envplugin.o
  SOLINK(target) Release/obj.target/omr-agentcore/libenvplugin.so
  COPY Release/lib.target/libenvplugin.so
  CXX(target) Release/obj.target/cpuplugin/omr-agentcore/src/ibmras/monitoring/plugins/common/cpu/cpuplugin.o
  SOLINK(target) Release/obj.target/omr-agentcore/libcpuplugin.so
  COPY Release/lib.target/libcpuplugin.so
  CXX(target) Release/obj.target/memoryplugin/omr-agentcore/src/ibmras/monitoring/plugins/common/memory/MemoryPlugin.o
  SOLINK(target) Release/obj.target/omr-agentcore/libmemoryplugin.so
  COPY Release/lib.target/libmemoryplugin.so
  CXX(target) Release/obj.target/headlessplugin/omr-agentcore/src/ibmras/monitoring/connector/headless/HLConnector.o
  SOLINK(target) Release/obj.target/omr-agentcore/libheadlessplugin.so
  COPY Release/lib.target/libheadlessplugin.so
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Clients.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/LinkedList.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Log.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Messages.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTAsync.o
../omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTAsync.c: In function ‘MQTTAsync_cycle’:
../omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTAsync.c:2561:13: warning: variable ‘nosockets_count’ set but not used [-Wunused-but-set-variable]
  static int nosockets_count = 0;
             ^~~~~~~~~~~~~~~
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPacket.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPacketOut.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPersistence.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPersistenceDefault.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTProtocolClient.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTProtocolOut.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/SocketBuffer.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Socket.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/StackTrace.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Thread.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Tree.o
  CC(target) Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/utf-8.o
  CXX(target) Release/obj.target/hcmqtt/omr-agentcore/src/ibmras/monitoring/connector/mqtt/MQTTConnector.o
  SOLINK(target) Release/obj.target/omr-agentcore/libhcmqtt.so
  COPY Release/lib.target/libhcmqtt.so
make: *** No rule to make target `Release/libagentcore.so', needed by `../omr-agentcore/libagentcore.so'.  Stop.
make: Leaving directory `/home/users/riclau/sandbox/github/appmetrics/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/users/riclau/sandbox/github/appmetrics/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:327:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 3.10.0-1062.12.1.el7.x86_64
gyp ERR! command "/home/users/riclau/sandbox/bin/testnode/bin/node" "/home/users/riclau/sandbox/github/appmetrics/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/users/riclau/sandbox/github/appmetrics
gyp ERR! node -v v15.0.0
gyp ERR! node-gyp -v v7.1.0
gyp ERR! not ok
npm ERR! code 1
npm ERR! path /home/users/riclau/sandbox/github/appmetrics
npm ERR! command failed
npm ERR! command sh -c node showBuildInfo.js && node-gyp rebuild

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/users/riclau/.npm/_logs/2020-10-09T11_20_54_148Z-debug.log
-bash-4.2$ find . -type f -name '*.so'
./omr-agentcore/libagentcore.so
./omr-agentcore/plugins/libhcmqtt.so
./omr-agentcore/plugins/libcpuplugin.so
./omr-agentcore/plugins/libenvplugin.so
./omr-agentcore/plugins/libmemoryplugin.so
./omr-agentcore/plugins/libhcapiplugin.so
./omr-agentcore/plugins/libheadlessplugin.so
./build/Release/obj.target/omr-agentcore/libagentcore.so
./build/Release/obj.target/omr-agentcore/libhcapiplugin.so
./build/Release/obj.target/omr-agentcore/libenvplugin.so
./build/Release/obj.target/omr-agentcore/libcpuplugin.so
./build/Release/obj.target/omr-agentcore/libmemoryplugin.so
./build/Release/obj.target/omr-agentcore/libheadlessplugin.so
./build/Release/obj.target/omr-agentcore/libhcmqtt.so
./build/Release/lib.target/libagentcore.so
./build/Release/lib.target/libhcapiplugin.so
./build/Release/lib.target/libenvplugin.so
./build/Release/lib.target/libcpuplugin.so
./build/Release/lib.target/libmemoryplugin.so
./build/Release/lib.target/libheadlessplugin.so
./build/Release/lib.target/libhcmqtt.so
-bash-4.2$

@rvagg
Copy link
Member Author

rvagg commented Oct 9, 2020

this seems to work for nodejs/node https://github.com/nodejs/node/compare/master...rvagg:rvagg/gyp-lib.target?expand=1

essentially winding back the use of lib.target for any top-level target & dependency for make.

good across the containered tests which include a shared library build https://ci.nodejs.org/job/node-test-commit-linux-containered/22729/

running a full suite @ https://ci.nodejs.org/job/node-test-commit/41218/, the ARM cross compiler might be a concern, but it seems that removing lib.target entirely for targets in gyp-next might be a practical and solve the problem here and still supporting nodejs/node.

I'm off for the day if someone else is inclined to pick this up. I'm not sure I want to be the one to push this through tbh, I have quite a bit on my plate at the moment so I'd appreciate whatever effort others can throw at this.

@rvagg
Copy link
Member Author

rvagg commented Oct 9, 2020

had a problem with the Pi3s, I had to restart them all, clear out workspaces and have restarted the arm-fanned here https://ci.nodejs.org/job/node-test-commit-arm-fanned/16803/

(actually heading off now)

rvagg added a commit to nodejs/gyp-next that referenced this issue Oct 13, 2020
rvagg added a commit to rvagg/io.js that referenced this issue Oct 13, 2020
ryzokuken pushed a commit to nodejs/gyp-next that referenced this issue Oct 13, 2020
rvagg added a commit to ryzokuken/node that referenced this issue Oct 14, 2020
ryzokuken pushed a commit to nodejs/node that referenced this issue Oct 14, 2020
Ref: nodejs/node-gyp#2233
Ref: nodejs/gyp-next#69

PR-URL: #35635
Refs: https://github.com/nodejs/gyp-next/releases/tag/v0.6.0
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
BethGriggs pushed a commit to nodejs/node that referenced this issue Dec 8, 2020
Ref: nodejs/node-gyp#2233
Ref: nodejs/gyp-next#69

PR-URL: #35635
Refs: https://github.com/nodejs/gyp-next/releases/tag/v0.6.0
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
joesepi pushed a commit to joesepi/node that referenced this issue Jan 8, 2021
Ref: nodejs/node-gyp#2233
Ref: nodejs/gyp-next#69

PR-URL: nodejs#35635
Refs: https://github.com/nodejs/gyp-next/releases/tag/v0.6.0
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
springmeyer pushed a commit to mapbox/node-pre-gyp that referenced this issue Oct 21, 2021
hyj1991 pushed a commit to X-Profiler/node-pre-gyp that referenced this issue Jun 16, 2023
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

4 participants