package_linux_bin.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. ELECTRON_VERSION="v29.4.0"
  22. # Look for releases here if electron version used by vscode changed
  23. # https://github.com/riscv-forks/electron-riscv-releases/releases
  24. export VSCODE_ELECTRON_TAG="${ELECTRON_VERSION}.riscv2"
  25. echo "7244465fe0c1a6ac6e34fe765a9d90fe0017b1a6d3406fd6b8dd9f5d2c8c9df5 *electron-v29.4.0-linux-riscv64.zip" >> build/checksums/electron.txt
  26. fi
  27. if [[ -d "../patches/linux/client/" ]]; then
  28. for file in "../patches/linux/client/"*.patch; do
  29. if [[ -f "${file}" ]]; then
  30. echo applying patch: "${file}";
  31. if ! git apply --ignore-whitespace "${file}"; then
  32. echo failed to apply patch "${file}" >&2
  33. exit 1
  34. fi
  35. fi
  36. done
  37. fi
  38. for i in {1..5}; do # try 5 times
  39. yarn --cwd build --frozen-lockfile --check-files && break
  40. if [[ $i == 3 ]]; then
  41. echo "Yarn failed too many times" >&2
  42. exit 1
  43. fi
  44. echo "Yarn failed $i, trying again..."
  45. done
  46. if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
  47. source ./build/azure-pipelines/linux/setup-env.sh
  48. else
  49. ./build/azure-pipelines/linux/setup-env.sh
  50. fi
  51. for i in {1..5}; do # try 5 times
  52. yarn --check-files && break
  53. if [ $i -eq 3 ]; then
  54. echo "Yarn failed too many times" >&2
  55. exit 1
  56. fi
  57. echo "Yarn failed $i, trying again..."
  58. done
  59. node build/azure-pipelines/distro/mixin-npm
  60. yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
  61. find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
  62. cd ..