Skip to content

Commit afdc5bd

Browse files
authored
chore: pass nodedir to node-gyp via npm_package_config env in node integration (#9932)
Backport of #9822 to `release/v11`. Copilot-Session: 744c3e7c-c466-43a7-b610-d67335f8dce3
1 parent 83f95ff commit afdc5bd

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎.github/workflows/node-integration.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ jobs:
407407
working-directory: ${{ steps.download.outputs.target }}
408408
run: |
409409
set +e
410-
npm install --nodedir="${{steps.install.outputs.nodedir }}" ${{ matrix.install_flags }}
410+
export npm_package_config_node_gyp_nodedir="${{ steps.install.outputs.nodedir }}"
411+
npm install ${{ matrix.install_flags }}
411412
exitcode=$?
412413
if [[ $exitcode -ne 0 && "${{ matrix.knownFailure }}" == "true" ]]; then
413414
echo "::warning ::npm install failed, exit $exitcode"
@@ -445,7 +446,7 @@ jobs:
445446
FINALEXIT=0
446447
STEPEXIT=0
447448
448-
export npm_config_nodedir="${{ steps.install.outputs.nodedir }}"
449+
export npm_package_config_node_gyp_nodedir="${{ steps.install.outputs.nodedir }}"
449450
450451
# inlining some patches to make tests run
451452
if [[ "${{ matrix.package }}" == "undici" ]]; then

‎scripts/template-oss/node-integration-yml.hbs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ jobs:
405405
working-directory: $\{{ steps.download.outputs.target }}
406406
run: |
407407
set +e
408-
npm install --nodedir="$\{{steps.install.outputs.nodedir }}" $\{{ matrix.install_flags }}
408+
export npm_package_config_node_gyp_nodedir="$\{{ steps.install.outputs.nodedir }}"
409+
npm install $\{{ matrix.install_flags }}
409410
exitcode=$?
410411
if [[ $exitcode -ne 0 && "$\{{ matrix.knownFailure }}" == "true" ]]; then
411412
echo "::warning ::npm install failed, exit $exitcode"
@@ -443,7 +444,7 @@ jobs:
443444
FINALEXIT=0
444445
STEPEXIT=0
445446

446-
export npm_config_nodedir="$\{{ steps.install.outputs.nodedir }}"
447+
export npm_package_config_node_gyp_nodedir="$\{{ steps.install.outputs.nodedir }}"
447448

448449
# inlining some patches to make tests run
449450
if [[ "$\{{ matrix.package }}" == "undici" ]]; then

0 commit comments

Comments
 (0)