package_linux_bin.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/usr/bin/env bash
  2. # shellcheck disable=SC1091
  3. set -ex
  4. if [[ "${CI_BUILD}" == "no" ]]; then
  5. exit 1
  6. fi
  7. tar -xzf ./vscode.tar.gz
  8. chown -R root:root vscode
  9. cd vscode || { echo "'vscode' dir not found"; exit 1; }
  10. export VSCODE_SKIP_NODE_VERSION_CHECK=1
  11. export VSCODE_SYSROOT_PREFIX='-glibc-2.17'
  12. if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
  13. export VSCODE_SYSROOT_REPO='VSCodium/vscode-linux-build-agent'
  14. export VSCODE_SYSROOT_VERSION='20240129-253798'
  15. export VSCODE_SYSROOT_PREFIX='-glibc-2.28'
  16. fi
  17. if [[ "${VSCODE_ARCH}" == "riscv64" ]]; then
  18. export VSCODE_ELECTRON_REPO='riscv-forks/electron-riscv-releases'
  19. export ELECTRON_SKIP_BINARY_DOWNLOAD=1
  20. export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
  21. source ../electron.riscv64.sh
  22. if [[ "${ELECTRON_VERSION}" != "$(yarn config get target)" ]]; then
  23. # Fail the pipeline if electron target doesn't match what is used.
  24. echo "Electron RISC-V binary version doesn't match target electron version!"
  25. echo "Releases available at: https://github.com/${VSCODE_ELECTRON_REPO}/releases"
  26. exit 1
  27. fi
  28. fi
  29. if [[ -d "../patches/linux/client/" ]]; then
  30. for file in "../patches/linux/client/"*.patch; do
  31. if [[ -f "${file}" ]]; then
  32. echo applying patch: "${file}";
  33. if ! git apply --ignore-whitespace "${file}"; then
  34. echo failed to apply patch "${file}" >&2
  35. exit 1
  36. fi
  37. fi
  38. done
  39. fi
  40. for i in {1..5}; do # try 5 times
  41. npm ci --prefix build && break
  42. if [[ $i == 3 ]]; then
  43. echo "Npm install failed too many times" >&2
  44. exit 1
  45. fi
  46. echo "Npm install failed $i, trying again..."
  47. done
  48. if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
  49. source ./build/azure-pipelines/linux/setup-env.sh
  50. else
  51. ./build/azure-pipelines/linux/setup-env.sh
  52. fi
  53. for i in {1..5}; do # try 5 times
  54. npm ci && break
  55. if [[ $i -eq 3 ]]; then
  56. echo "Npm install failed too many times" >&2
  57. exit 1
  58. fi
  59. echo "Npm install failed $i, trying again..."
  60. done
  61. node build/azure-pipelines/distro/mixin-npm
  62. yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
  63. find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
  64. cd ..