Skip to content

shared_library builds have moved location #2233

Open
@rvagg

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions