package_linux_bin.sh 2.3 KB

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