[v14.x] node-api: allow retrieval of add-on file name#37327
Closed
gabrielschulhof wants to merge 1 commit into
Closed
[v14.x] node-api: allow retrieval of add-on file name#37327gabrielschulhof wants to merge 1 commit into
gabrielschulhof wants to merge 1 commit into
Conversation
gabrielschulhof
force-pushed
the
backport-node-api-module-file-name-to-v14.x
branch
from
February 12, 2021 03:07
866dd16 to
dd3936e
Compare
Collaborator
Contributor
Author
|
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
|
legendecas
approved these changes
Feb 20, 2021
MylesBorins
force-pushed
the
v14.x-staging
branch
from
April 6, 2021 19:54
11505ad to
6b115d7
Compare
Collaborator
Member
|
This conflicts with #37728 |
danielleadams
force-pushed
the
v14.x-staging
branch
from
May 8, 2021 18:15
23ede20 to
f755fc4
Compare
gabrielschulhof
force-pushed
the
backport-node-api-module-file-name-to-v14.x
branch
from
June 4, 2021 14:19
dd3936e to
6b6f28e
Compare
Contributor
Author
|
@targos rebased. |
Contributor
Author
|
@danielleadams rebased. |
targos
force-pushed
the
v14.x-staging
branch
4 times, most recently
from
June 11, 2021 07:31
49c8441 to
50b3bd0
Compare
richardlau
force-pushed
the
v14.x-staging
branch
2 times, most recently
from
July 5, 2021 16:02
1f06fcf to
16dcd9c
Compare
richardlau
force-pushed
the
v14.x-staging
branch
from
July 19, 2021 11:19
8ea39c6 to
4ac719f
Compare
richardlau
force-pushed
the
v14.x-staging
branch
from
July 29, 2021 16:40
073941c to
0061e5d
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 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
targos
force-pushed
the
backport-node-api-module-file-name-to-v14.x
branch
from
August 8, 2021 08:23
6b6f28e to
db14845
Compare
Collaborator
Member
|
Landed in d98d193 |
targos
pushed a commit
that referenced
this pull request
Aug 8, 2021
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: #37195 Backport-PR-URL: #37327 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
BethGriggs
pushed a commit
that referenced
this pull request
Aug 12, 2021
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: #37195 Backport-PR-URL: #37327 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
MylesBorins
pushed a commit
that referenced
this pull request
Aug 31, 2021
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: #37195 Backport-PR-URL: #37327 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
foxxyz
pushed a commit
to foxxyz/node
that referenced
this pull request
Oct 18, 2021
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#37327 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ofmoduleis not required, because the file name could also be passed in via a
private property added onto
exportsfrom theprocess.dlopenbinding.
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