arch-0-support.patch 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. diff --git a/build/azure-pipelines/linux/setup-env.sh b/build/azure-pipelines/linux/setup-env.sh
  2. index 9410564..c1736f0 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. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  9. index c1d64c0..5ac9f95 100644
  10. --- a/build/gulpfile.reh.js
  11. +++ b/build/gulpfile.reh.js
  12. @@ -232,9 +232,23 @@ function nodejs(platform, arch) {
  13. case 'linux':
  14. - return (product.nodejsRepository !== 'https://nodejs.org' ?
  15. - fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName, checksumSha256 }) :
  16. - fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
  17. - ).pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  18. - .pipe(filter('**/node'))
  19. - .pipe(util.setExecutableBit('**'))
  20. - .pipe(rename('node'));
  21. + if (process.env.VSCODE_NODEJS_SITE && process.env.VSCODE_NODEJS_URLROOT) {
  22. + 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 })
  23. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  24. + .pipe(filter('**/node'))
  25. + .pipe(util.setExecutableBit('**'))
  26. + .pipe(rename('node'));
  27. + }
  28. + if (product.nodejsRepository !== 'https://nodejs.org') {
  29. + return fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName, checksumSha256 })
  30. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  31. + .pipe(filter('**/node'))
  32. + .pipe(util.setExecutableBit('**'))
  33. + .pipe(rename('node'));
  34. + }
  35. + else {
  36. + return fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
  37. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  38. + .pipe(filter('**/node'))
  39. + .pipe(util.setExecutableBit('**'))
  40. + .pipe(rename('node'));
  41. + }
  42. case 'alpine':
  43. diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
  44. index 7046ee0..67cb99a 100644
  45. --- a/build/gulpfile.vscode.js
  46. +++ b/build/gulpfile.vscode.js
  47. @@ -382,2 +382,12 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  48. + const electronOverride = {};
  49. + if (process.env.VSCODE_ELECTRON_REPOSITORY) {
  50. + // official electron doesn't support all arch, override the repo with `VSCODE_ELECTRON_REPOSITORY`.
  51. + electronOverride.repo = process.env.VSCODE_ELECTRON_REPOSITORY;
  52. + }
  53. +
  54. + if (process.env.VSCODE_ELECTRON_TAG) {
  55. + electronOverride.tag = process.env.VSCODE_ELECTRON_TAG;
  56. + }
  57. +
  58. let result = all
  59. @@ -386,3 +396,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  60. .pipe(filter(['**', '!**/.github/**'], { dot: true })) // https://github.com/microsoft/vscode/issues/116523
  61. - .pipe(electron({ ...config, platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false }))
  62. + .pipe(electron({ ...config, ...electronOverride, platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false }))
  63. .pipe(filter(['**', '!LICENSE', '!version'], { dot: true }));
  64. diff --git a/build/linux/debian/dep-lists.js b/build/linux/debian/dep-lists.js
  65. index 8ac57b9..8580d79 100644
  66. --- a/build/linux/debian/dep-lists.js
  67. +++ b/build/linux/debian/dep-lists.js
  68. @@ -138,3 +138,3 @@ exports.referenceGeneratedDepsByArch = {
  69. 'xdg-utils (>= 1.0.2)'
  70. - ]
  71. + ],
  72. };
  73. diff --git a/build/linux/debian/dep-lists.ts b/build/linux/debian/dep-lists.ts
  74. index df119e8..91b0ebc 100644
  75. --- a/build/linux/debian/dep-lists.ts
  76. +++ b/build/linux/debian/dep-lists.ts
  77. @@ -138,3 +138,3 @@ export const referenceGeneratedDepsByArch = {
  78. 'xdg-utils (>= 1.0.2)'
  79. - ]
  80. + ],
  81. };
  82. diff --git a/build/linux/debian/install-sysroot.js b/build/linux/debian/install-sysroot.js
  83. index 16d8d01..532e3d5 100644
  84. --- a/build/linux/debian/install-sysroot.js
  85. +++ b/build/linux/debian/install-sysroot.js
  86. @@ -74,3 +74,5 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
  87. try {
  88. - const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
  89. + const repository = process.env['VSCODE_SYSROOT_REPOSITORY'] ?? 'Microsoft/vscode-linux-build-agent';
  90. + const actualVersion = process.env['VSCODE_SYSROOT_VERSION'] ?? version;
  91. + const response = await fetch(`https://api.github.com/repos/${repository}/releases/tags/v${actualVersion}`, {
  92. headers: ghApiHeaders,
  93. @@ -83,3 +85,3 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
  94. if (!asset) {
  95. - throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
  96. + throw new Error(`Could not find asset in release of ${repository} @ ${actualVersion}`);
  97. }
  98. diff --git a/build/linux/debian/install-sysroot.ts b/build/linux/debian/install-sysroot.ts
  99. index aa10e39..6543b49 100644
  100. --- a/build/linux/debian/install-sysroot.ts
  101. +++ b/build/linux/debian/install-sysroot.ts
  102. @@ -83,3 +83,5 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  103. try {
  104. - const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
  105. + const repository = process.env['VSCODE_SYSROOT_REPOSITORY'] ?? 'Microsoft/vscode-linux-build-agent';
  106. + const actualVersion = process.env['VSCODE_SYSROOT_VERSION'] ?? version;
  107. + const response = await fetch(`https://api.github.com/repos/${repository}/releases/tags/v${actualVersion}`, {
  108. headers: ghApiHeaders,
  109. @@ -92,3 +94,3 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  110. if (!asset) {
  111. - throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
  112. + throw new Error(`Could not find asset in release of ${repository} @ ${actualVersion}`);
  113. }