Skip to content

Commit

Permalink
fix: install scripts for windows arm64 target (microsoft#225629)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 authored Aug 15, 2024
1 parent 3ef94c3 commit 9b29e85
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build/.cachesalt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-08T03:47:49.879Z
2024-08-14T18:12:43.548Z
5 changes: 0 additions & 5 deletions build/npm/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ for (let dir of dirs) {
}
}

if (/^(.build\/distro\/npm\/)?remote/.test(dir) && process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64')) {
// windows arm: do not execute `yarn` on remote folder
continue;
}

let opts;

if (dir === 'build') {
Expand Down
14 changes: 1 addition & 13 deletions build/npm/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,7 @@ function installHeaders() {
cp.execFileSync(node_gyp, ['install', '--dist-url', local.disturl, local.target], { shell: true });
}

// Avoid downloading headers for Windows arm64 till we move to Nodejs v19 in remote
// which is the first official release with support for the architecture. Downloading
// the headers for older versions now redirect to https://origin.nodejs.org/404.html
// which causes checksum validation error in node-gyp.
//
// gyp http 200 https://origin.nodejs.org/404.html
// gyp WARN install got an error, rolling back install
// gyp ERR! install error
// gyp ERR! stack Error: win-arm64/node.lib local checksum 4c62bed7a032f7b36984321b7ffdd60b596fac870672037ff879ae9ac9548fb7 not match remote undefined
//
if (remote !== undefined && !versions.has(remote.target) &&
process.env['npm_config_arch'] !== "arm64" &&
process.arch !== "arm64") {
if (remote !== undefined && !versions.has(remote.target)) {
// Both disturl and target come from a file checked into our repository
cp.execFileSync(node_gyp, ['install', '--dist-url', remote.disturl, remote.target], { shell: true });
}
Expand Down

0 comments on commit 9b29e85

Please sign in to comment.