arch-0-support.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. diff --git a/build/azure-pipelines/linux/setup-env.sh b/build/azure-pipelines/linux/setup-env.sh
  2. index 2f25764..742aaef 100755
  3. --- a/build/azure-pipelines/linux/setup-env.sh
  4. +++ b/build/azure-pipelines/linux/setup-env.sh
  5. @@ -2,3 +2,3 @@
  6. -set -e
  7. +set -ex
  8. @@ -22,3 +22,3 @@ else
  9. echo "Downloading remote sysroot"
  10. - SYSROOT_ARCH="$SYSROOT_ARCH" VSCODE_SYSROOT_DIR="$VSCODE_REMOTE_SYSROOT_DIR" VSCODE_SYSROOT_PREFIX="-glibc-2.28-gcc-8.5.0" node -e 'import { getVSCodeSysroot } from "./build/linux/debian/install-sysroot.ts"; (async () => { await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()'
  11. + SYSROOT_ARCH="$SYSROOT_ARCH" VSCODE_SYSROOT_DIR="$VSCODE_REMOTE_SYSROOT_DIR" node -e 'import { getVSCodeSysroot } from "./build/linux/debian/install-sysroot.ts"; (async () => { await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()'
  12. fi
  13. diff --git a/build/gulpfile.reh.ts b/build/gulpfile.reh.ts
  14. index cb1a0a5..6c21dd2 100644
  15. --- a/build/gulpfile.reh.ts
  16. +++ b/build/gulpfile.reh.ts
  17. @@ -235,9 +235,23 @@ function nodejs(platform: string, arch: string): NodeJS.ReadWriteStream | undefi
  18. case 'linux':
  19. - return (product.nodejsRepository !== 'https://nodejs.org' ?
  20. - fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName!, checksumSha256 }) :
  21. - fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
  22. - ).pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  23. - .pipe(filter('**/node'))
  24. - .pipe(util.setExecutableBit('**'))
  25. - .pipe(rename('node'));
  26. + if (process.env.VSCODE_NODEJS_SITE && process.env.VSCODE_NODEJS_URLROOT) {
  27. + return fetchUrls(`${process.env.VSCODE_NODEJS_URLROOT}/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}${process.env.VSCODE_NODEJS_URLSUFFIX}.tar.gz`, { base: process.env.VSCODE_NODEJS_SITE, checksumSha256 })
  28. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  29. + .pipe(filter('**/node'))
  30. + .pipe(util.setExecutableBit('**'))
  31. + .pipe(rename('node'));
  32. + }
  33. + if (product.nodejsRepository !== 'https://nodejs.org') {
  34. + return fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName!, checksumSha256 })
  35. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  36. + .pipe(filter('**/node'))
  37. + .pipe(util.setExecutableBit('**'))
  38. + .pipe(rename('node'));
  39. + }
  40. + else {
  41. + return fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
  42. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  43. + .pipe(filter('**/node'))
  44. + .pipe(util.setExecutableBit('**'))
  45. + .pipe(rename('node'));
  46. + }
  47. case 'alpine':
  48. diff --git a/build/gulpfile.vscode.ts b/build/gulpfile.vscode.ts
  49. index d3ab651..9dbe6f3 100644
  50. --- a/build/gulpfile.vscode.ts
  51. +++ b/build/gulpfile.vscode.ts
  52. @@ -375,2 +375,12 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
  53. + const electronOverride: { repo?: string; tag?: string } = {};
  54. + if (process.env.VSCODE_ELECTRON_REPOSITORY) {
  55. + // official electron doesn't support all arch, override the repo with `VSCODE_ELECTRON_REPOSITORY`.
  56. + electronOverride.repo = process.env.VSCODE_ELECTRON_REPOSITORY;
  57. + }
  58. +
  59. + if (process.env.VSCODE_ELECTRON_TAG) {
  60. + electronOverride.tag = process.env.VSCODE_ELECTRON_TAG;
  61. + }
  62. +
  63. let result: NodeJS.ReadWriteStream = all
  64. @@ -379,3 +389,3 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
  65. .pipe(filter(['**', '!**/.github/**'], { dot: true })) // https://github.com/microsoft/vscode/issues/116523
  66. - .pipe(electron({ ...config, platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false, ...customElectronConfig }))
  67. + .pipe(electron({ ...config, ...electronOverride, platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false, ...customElectronConfig }))
  68. .pipe(filter(['**', '!LICENSE', '!version'], { dot: true }));
  69. diff --git a/build/linux/debian/dep-lists.ts b/build/linux/debian/dep-lists.ts
  70. index d00eb59..34ecdf1 100644
  71. --- a/build/linux/debian/dep-lists.ts
  72. +++ b/build/linux/debian/dep-lists.ts
  73. @@ -141,3 +141,3 @@ export const referenceGeneratedDepsByArch = {
  74. 'xdg-utils (>= 1.0.2)'
  75. - ]
  76. + ],
  77. };
  78. diff --git a/build/linux/debian/install-sysroot.ts b/build/linux/debian/install-sysroot.ts
  79. index 2cab657..0d9dc55 100644
  80. --- a/build/linux/debian/install-sysroot.ts
  81. +++ b/build/linux/debian/install-sysroot.ts
  82. @@ -82,3 +82,5 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  83. try {
  84. - const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
  85. + const repository = process.env['VSCODE_SYSROOT_REPOSITORY'] ?? 'Microsoft/vscode-linux-build-agent';
  86. + const actualVersion = process.env['VSCODE_SYSROOT_VERSION'] ?? version;
  87. + const response = await fetch(`https://api.github.com/repos/${repository}/releases/tags/v${actualVersion}`, {
  88. headers: ghApiHeaders,
  89. @@ -91,3 +93,3 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  90. if (!asset) {
  91. - throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
  92. + throw new Error(`Could not find asset in release of ${repository} @ ${actualVersion}`);
  93. }