package_linux_bin.sh 2.1 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. 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. # 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. fi
  30. if [[ -d "../patches/linux/client/" ]]; then
  31. for file in "../patches/linux/client/"*.patch; do
  32. if [[ -f "${file}" ]]; then
  33. echo applying patch: "${file}";
  34. if ! git apply --ignore-whitespace "${file}"; then
  35. echo failed to apply patch "${file}" >&2
  36. exit 1
  37. fi
  38. fi
  39. done
  40. fi
  41. for i in {1..5}; do # try 5 times
  42. npm ci --prefix build && break
  43. if [[ $i == 3 ]]; then
  44. echo "Npm install failed too many times" >&2
  45. exit 1
  46. fi
  47. echo "Npm install failed $i, trying again..."
  48. done
  49. if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
  50. source ./build/azure-pipelines/linux/setup-env.sh
  51. else
  52. ./build/azure-pipelines/linux/setup-env.sh
  53. fi
  54. for i in {1..5}; do # try 5 times
  55. npm ci && break
  56. if [[ $i -eq 3 ]]; then
  57. echo "Npm install failed too many times" >&2
  58. exit 1
  59. fi
  60. echo "Npm install failed $i, trying again..."
  61. done
  62. node build/azure-pipelines/distro/mixin-npm
  63. yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
  64. find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
  65. cd ..