fix-npm-postinstall.patch 814 B

1234567891011121314
  1. diff --git a/build/npm/postinstall.ts b/build/npm/postinstall.ts
  2. index c4bbbf5..2a1c6c5 100644
  3. --- a/build/npm/postinstall.ts
  4. +++ b/build/npm/postinstall.ts
  5. @@ -52,5 +52,6 @@ function npmInstall(dir: string, opts?: child_process.SpawnSyncOptions) {
  6. opts.cwd = root;
  7. - if (process.env['npm_config_arch'] === 'arm64') {
  8. - run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts);
  9. - }
  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', [