fix-npm-postinstall.patch 910 B

12345678910111213141516
  1. diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js
  2. index fa8da7d..5e2f51b 100644
  3. --- a/build/npm/postinstall.js
  4. +++ b/build/npm/postinstall.js
  5. @@ -53,8 +53,9 @@ function npmInstall(dir, opts) {
  6. log(dir, `Installing dependencies inside container ${process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME']}...`);
  7. opts.cwd = root;
  8. - if (process.env['npm_config_arch'] === 'arm64') {
  9. - run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts);
  10. + const emulateArchList = ['arm64', 'arm', 'ppc64', 'riscv64', 's390x', 'loong64'];
  11. + if (process.env['DISABLE_QEMU'] !== 'true' && !!process.env['npm_config_arch'] && emulateArchList.includes(process.env['npm_config_arch'])) {
  12. + run('sudo', ['docker', 'run', '--rm', '--privileged', 'tonistiigi/binfmt:latest', '--install', 'all'], opts);
  13. }
  14. run('sudo', [
  15. 'docker', 'run',