arch-0-support.patch 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. diff --git a/build/azure-pipelines/linux/setup-env.sh b/build/azure-pipelines/linux/setup-env.sh
  2. index 6805633..9d4b59f 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. @@ -50,3 +50,3 @@ if [ "$npm_config_arch" == "x64" ]; then
  14. export VSCODE_REMOTE_CXX=$VSCODE_REMOTE_SYSROOT_DIR/x86_64-linux-gnu/bin/x86_64-linux-gnu-g++
  15. - export VSCODE_REMOTE_CXXFLAGS="--sysroot=$VSCODE_REMOTE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot"
  16. + export VSCODE_REMOTE_CXXFLAGS="--sysroot=$VSCODE_REMOTE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot -D_GLIBCXX_USE_CXX11_ABI=0"
  17. export VSCODE_REMOTE_LDFLAGS="--sysroot=$VSCODE_REMOTE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot -L$VSCODE_REMOTE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/usr/lib/x86_64-linux-gnu -L$VSCODE_REMOTE_SYSROOT_DIR/x86_64-linux-gnu/x86_64-linux-gnu/sysroot/lib/x86_64-linux-gnu"
  18. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  19. index 10b7b44..0ad7550 100644
  20. --- a/build/gulpfile.reh.js
  21. +++ b/build/gulpfile.reh.js
  22. @@ -233,9 +233,23 @@ function nodejs(platform, arch) {
  23. case 'linux':
  24. - return (product.nodejsRepository !== 'https://nodejs.org' ?
  25. - fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName, checksumSha256 }) :
  26. - fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
  27. - ).pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  28. - .pipe(filter('**/node'))
  29. - .pipe(util.setExecutableBit('**'))
  30. - .pipe(rename('node'));
  31. + if (process.env.VSCODE_NODEJS_SITE && process.env.VSCODE_NODEJS_URLROOT) {
  32. + 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 })
  33. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  34. + .pipe(filter('**/node'))
  35. + .pipe(util.setExecutableBit('**'))
  36. + .pipe(rename('node'));
  37. + }
  38. + if (product.nodejsRepository !== 'https://nodejs.org') {
  39. + return fetchGithub(product.nodejsRepository, { version: `${nodeVersion}-${internalNodeVersion}`, name: expectedName, checksumSha256 })
  40. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  41. + .pipe(filter('**/node'))
  42. + .pipe(util.setExecutableBit('**'))
  43. + .pipe(rename('node'));
  44. + }
  45. + else {
  46. + return fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
  47. + .pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
  48. + .pipe(filter('**/node'))
  49. + .pipe(util.setExecutableBit('**'))
  50. + .pipe(rename('node'));
  51. + }
  52. case 'alpine':
  53. diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
  54. index 25d8916..250ba7c 100644
  55. --- a/build/gulpfile.vscode.js
  56. +++ b/build/gulpfile.vscode.js
  57. @@ -366,2 +366,12 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  58. + const electronOverride = {};
  59. + if (process.env.VSCODE_ELECTRON_REPOSITORY) {
  60. + // official electron doesn't support all arch, override the repo with `VSCODE_ELECTRON_REPOSITORY`.
  61. + electronOverride.repo = process.env.VSCODE_ELECTRON_REPOSITORY;
  62. + }
  63. +
  64. + if (process.env.VSCODE_ELECTRON_TAG) {
  65. + electronOverride.tag = process.env.VSCODE_ELECTRON_TAG;
  66. + }
  67. +
  68. let result = all
  69. @@ -370,3 +380,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  70. .pipe(filter(['**', '!**/.github/**'], { dot: true })) // https://github.com/microsoft/vscode/issues/116523
  71. - .pipe(electron({ ...config, platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false }))
  72. + .pipe(electron({ ...config, ...electronOverride, platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: false }))
  73. .pipe(filter(['**', '!LICENSE', '!version'], { dot: true }));
  74. diff --git a/build/linux/debian/dep-lists.js b/build/linux/debian/dep-lists.js
  75. index f58d0f8..4edb371 100644
  76. --- a/build/linux/debian/dep-lists.js
  77. +++ b/build/linux/debian/dep-lists.js
  78. @@ -140,3 +140,3 @@ exports.referenceGeneratedDepsByArch = {
  79. 'xdg-utils (>= 1.0.2)'
  80. - ]
  81. + ],
  82. };
  83. diff --git a/build/linux/debian/dep-lists.ts b/build/linux/debian/dep-lists.ts
  84. index 5b7ccd5..707129f 100644
  85. --- a/build/linux/debian/dep-lists.ts
  86. +++ b/build/linux/debian/dep-lists.ts
  87. @@ -140,3 +140,3 @@ export const referenceGeneratedDepsByArch = {
  88. 'xdg-utils (>= 1.0.2)'
  89. - ]
  90. + ],
  91. };
  92. diff --git a/build/linux/debian/install-sysroot.js b/build/linux/debian/install-sysroot.js
  93. index d16e13b..18e409a 100644
  94. --- a/build/linux/debian/install-sysroot.js
  95. +++ b/build/linux/debian/install-sysroot.js
  96. @@ -73,3 +73,5 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
  97. try {
  98. - const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
  99. + const repository = process.env['VSCODE_SYSROOT_REPOSITORY'] ?? 'Microsoft/vscode-linux-build-agent';
  100. + const actualVersion = process.env['VSCODE_SYSROOT_VERSION'] ?? version;
  101. + const response = await fetch(`https://api.github.com/repos/${repository}/releases/tags/v${actualVersion}`, {
  102. headers: ghApiHeaders,
  103. @@ -82,3 +84,3 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
  104. if (!asset) {
  105. - throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
  106. + throw new Error(`Could not find asset in release of ${repository} @ ${actualVersion}`);
  107. }
  108. diff --git a/build/linux/debian/install-sysroot.ts b/build/linux/debian/install-sysroot.ts
  109. index 670fb68..092fc68 100644
  110. --- a/build/linux/debian/install-sysroot.ts
  111. +++ b/build/linux/debian/install-sysroot.ts
  112. @@ -82,3 +82,5 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  113. try {
  114. - const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
  115. + const repository = process.env['VSCODE_SYSROOT_REPOSITORY'] ?? 'Microsoft/vscode-linux-build-agent';
  116. + const actualVersion = process.env['VSCODE_SYSROOT_VERSION'] ?? version;
  117. + const response = await fetch(`https://api.github.com/repos/${repository}/releases/tags/v${actualVersion}`, {
  118. headers: ghApiHeaders,
  119. @@ -91,3 +93,3 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
  120. if (!asset) {
  121. - throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
  122. + throw new Error(`Could not find asset in release of ${repository} @ ${actualVersion}`);
  123. }