-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[v12.x] node-api: allow retrieval of add-on file name #37328
Merged
richardlau
merged 1 commit into
nodejs:v12.x-staging
from
gabrielschulhof:backport-node-api-module-file-name-to-v12.x
Mar 17, 2021
Merged
[v12.x] node-api: allow retrieval of add-on file name #37328
richardlau
merged 1 commit into
nodejs:v12.x-staging
from
gabrielschulhof:backport-node-api-module-file-name-to-v12.x
Mar 17, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gabrielschulhof
added
semver-minor
PRs that contain new features and should be released in the next minor version.
node-api
Issues and PRs related to the Node-API.
labels
Feb 12, 2021
nodejs-github-bot
added
c++
Issues and PRs that require attention from people who are familiar with C++.
lib / src
Issues and PRs related to general changes in the lib or src directory.
v12.x
labels
Feb 12, 2021
The solution to the conflict in this backport backport consists of restoring the names of the macros used in the test: Whereas on the main branch it was
on this branch it is the old
|
mhdawson
approved these changes
Feb 19, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
legendecas
approved these changes
Feb 20, 2021
richardlau
force-pushed
the
v12.x-staging
branch
from
February 23, 2021 12:51
0692611
to
6cef0e3
Compare
Unlike JS-only modules, native add-ons are always associated with a dynamic shared object from which they are loaded. Being able to retrieve its absolute path is important to native-only add-ons, i.e. add-ons that are not themselves being loaded from a JS-only module located in the same package as the native add-on itself. Currently, the file name is obtained at environment construction time from the JS `module.filename`. Nevertheless, the presence of `module` is not required, because the file name could also be passed in via a private property added onto `exports` from the `process.dlopen` binding. As an attempt at future-proofing, the file name is provided as a URL, i.e. prefixed with the `file://` protocol. Fixes: nodejs/node-addon-api#449 PR-URL: nodejs#37195 Backport-PR-URL: nodejs#37328 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
richardlau
force-pushed
the
backport-node-api-module-file-name-to-v12.x
branch
from
March 17, 2021 21:12
6666b73
to
f569209
Compare
Landed in f569209. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c++
Issues and PRs that require attention from people who are familiar with C++.
lib / src
Issues and PRs related to general changes in the lib or src directory.
node-api
Issues and PRs related to the Node-API.
semver-minor
PRs that contain new features and should be released in the next minor version.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unlike JS-only modules, native add-ons are always associated with a
dynamic shared object from which they are loaded. Being able to
retrieve its absolute path is important to native-only add-ons, i.e.
add-ons that are not themselves being loaded from a JS-only module
located in the same package as the native add-on itself.
Currently, the file name is obtained at environment construction time
from the JS
module.filename
. Nevertheless, the presence ofmodule
is not required, because the file name could also be passed in via a
private property added onto
exports
from theprocess.dlopen
binding.
As an attempt at future-proofing, the file name is provided as a URL,
i.e. prefixed with the
file://
protocol.Fixes: nodejs/node-addon-api#449
PR-URL: #37195
Co-authored-by: @mhdawson
Reviewed-By: @mhdawson