forked from VSCodium/vscodium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package_linux_reh.sh
executable file
·109 lines (83 loc) · 3 KB
/
package_linux_reh.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env bash
# shellcheck disable=SC1091
set -ex
if [[ "${CI_BUILD}" == "no" ]]; then
exit 1
fi
tar -xzf ./vscode.tar.gz
cd vscode || { echo "'vscode' dir not found"; exit 1; }
GLIBC_VERSION="2.17"
if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
GLIBC_VERSION="2.28"
fi
export VSCODE_PLATFORM='linux'
export VSCODE_SKIP_NODE_VERSION_CHECK=1
export VSCODE_SYSROOT_PREFIX="-glibc-${GLIBC_VERSION}"
VSCODE_HOST_MOUNT="$( pwd )"
export VSCODE_HOST_MOUNT
if [[ "${VSCODE_ARCH}" == "x64" || "${VSCODE_ARCH}" == "arm64" ]]; then
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:centos7-devtoolset8-${VSCODE_ARCH}"
elif [[ "${VSCODE_ARCH}" == "armhf" ]]; then
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:bionic-devtoolset-arm32v7"
elif [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:bionic-devtoolset-ppc64le"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
export VSCODE_SYSROOT_REPO='VSCodium/vscode-linux-build-agent'
export VSCODE_SYSROOT_VERSION='20240129-253798'
elif [[ "${VSCODE_ARCH}" == "riscv64" ]]; then
VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:focal-devtoolset-riscv64"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
# Unofficial RISC-V nodejs builds doesn't provide v16.x
sed -i '/target/s/"16.*"/"18.18.1"/' remote/.yarnrc
fi
export VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME
for i in {1..5}; do # try 5 times
yarn --cwd build --frozen-lockfile --check-files && break
if [[ $i == 3 ]]; then
echo "Yarn failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
done
if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
source ./build/azure-pipelines/linux/setup-env.sh
else
./build/azure-pipelines/linux/setup-env.sh --only-remote
fi
for i in {1..5}; do # try 5 times
yarn --frozen-lockfile --check-files && break
if [ $i -eq 3 ]; then
echo "Yarn failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
done
EXPECTED_GLIBC_VERSION="${GLIBC_VERSION}" EXPECTED_GLIBCXX_VERSION="3.4.22" ./build/azure-pipelines/linux/verify-glibc-requirements.sh
node build/azure-pipelines/distro/mixin-npm
export VSCODE_NODE_GLIBC="-glibc-${GLIBC_VERSION}"
yarn gulp minify-vscode-reh
yarn gulp "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci"
cd ..
APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )"
mkdir -p assets
echo "Building and moving REH"
cd "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}"
tar czf "../assets/${APP_NAME_LC}-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" .
cd ..
npm install -g checksum
sum_file() {
if [[ -f "${1}" ]]; then
echo "Calculating checksum for ${1}"
checksum -a sha256 "${1}" > "${1}".sha256
checksum "${1}" > "${1}".sha1
fi
}
cd assets
for FILE in *; do
if [[ -f "${FILE}" ]]; then
sum_file "${FILE}"
fi
done
cd ..