2
0

arch-0-support.patch 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. diff --git a/build/azure-pipelines/linux/setup-env.sh b/build/azure-pipelines/linux/setup-env.sh
  2. index a148d51..fb2f8ff 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 '(async () => { const { getVSCodeSysroot } = require("./build/linux/debian/install-sysroot.js"); await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()'
  11. + SYSROOT_ARCH="$SYSROOT_ARCH" VSCODE_SYSROOT_DIR="$VSCODE_REMOTE_SYSROOT_DIR" node -e '(async () => { const { getVSCodeSysroot } = require("./build/linux/debian/install-sysroot.js"); await getVSCodeSysroot(process.env["SYSROOT_ARCH"]); })()'
  12. fi
  13. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  14. index c1d64c0..5ac9f95 100644
  15. --- a/build/gulpfile.reh.js
  16. +++ b/build/gulpfile.reh.js
  17. @@ -232,9 +232,23 @@ function nodejs(platform, arch) {
  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.js b/build/gulpfile.vscode.js
  49. index 26a6287..004417f 100644
  50. --- a/build/gulpfile.vscode.js
  51. +++ b/build/gulpfile.vscode.js
  52. @@ -366,2 +366,12 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  53. + const electronOverride = {};
  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 = all
  64. @@ -370,3 +380,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  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 }))
  67. + .pipe(electron({ ...config, ...electronOverride, platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false }))
  68. .pipe(filter(['**', '!LICENSE', '!version'], { dot: true }));
  69. diff --git a/build/linux/debian/dep-lists.js b/build/linux/debian/dep-lists.js
  70. index 4ef448d..057961c 100644
  71. --- a/build/linux/debian/dep-lists.js
  72. +++ b/build/linux/debian/dep-lists.js
  73. @@ -140,3 +140,3 @@ exports.referenceGeneratedDepsByArch = {
  74. 'xdg-utils (>= 1.0.2)'
  75. - ]
  76. + ],
  77. };
  78. diff --git a/build/linux/debian/dep-lists.ts b/build/linux/debian/dep-lists.ts
  79. index 5b7ccd5..707129f 100644
  80. --- a/build/linux/debian/dep-lists.ts
  81. +++ b/build/linux/debian/dep-lists.ts
  82. @@ -140,3 +140,3 @@ export const referenceGeneratedDepsByArch = {
  83. 'xdg-utils (>= 1.0.2)'
  84. - ]
  85. + ],
  86. };
  87. diff --git a/build/linux/debian/install-sysroot.js b/build/linux/debian/install-sysroot.js
  88. index 612d0a3..8fbdf3d 100644
  89. --- a/build/linux/debian/install-sysroot.js
  90. +++ b/build/linux/debian/install-sysroot.js
  91. @@ -74,3 +74,5 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
  92. try {
  93. - const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
  94. + const repository = process.env['VSCODE_SYSROOT_REPOSITORY'] ?? 'Microsoft/vscode-linux-build-agent';
  95. + const actualVersion = process.env['VSCODE_SYSROOT_VERSION'] ?? version;
  96. + const response = await fetch(`https://api.github.com/repos/${repository}/releases/tags/v${actualVersion}`, {
  97. headers: ghApiHeaders,
  98. @@ -83,3 +85,3 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
  99. if (!asset) {
  100. - throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
  101. + throw new Error(`Could not find asset in release of ${repository} @ ${actualVersion}`);
  102. }
  103. diff --git a/build/linux/debian/install-sysroot.ts b/build/linux/debian/install-sysroot.ts
  104. index 8a61159..9f3fd15 100644
  105. --- a/build/linux/debian/install-sysroot.ts
  106. +++ b/build/linux/debian/install-sysroot.ts
  107. @@ -83,3 +83,5 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  108. try {
  109. - const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
  110. + const repository = process.env['VSCODE_SYSROOT_REPOSITORY'] ?? 'Microsoft/vscode-linux-build-agent';
  111. + const actualVersion = process.env['VSCODE_SYSROOT_VERSION'] ?? version;
  112. + const response = await fetch(`https://api.github.com/repos/${repository}/releases/tags/v${actualVersion}`, {
  113. headers: ghApiHeaders,
  114. @@ -92,3 +94,3 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  115. if (!asset) {
  116. - throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
  117. + throw new Error(`Could not find asset in release of ${repository} @ ${actualVersion}`);
  118. }