Skip to content

Commit

Permalink
chore: streamline electron and ripgrep dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Nov 4, 2024
1 parent 1d2772b commit e2d0d38
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/insider-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ jobs:
- slug: RISCV64
vscode_arch: riscv64
npm_arch: riscv64
- vscode_arch: loong64
- slug: LOONG64
vscode_arch: loong64
npm_arch: loong64
env:
BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stable-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ jobs:
- slug: RISCV64
vscode_arch: riscv64
npm_arch: riscv64
- vscode_arch: loong64
- slug: LOONG64
vscode_arch: loong64
npm_arch: loong64
env:
BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }}
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions package_linux_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ elif [[ "${VSCODE_ARCH}" == "riscv64" ]]; then
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
export VSCODE_SKIP_SETUPENV=1
fi

source ../electron.riscv64.sh
if [[ -f "../electron_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh" ]]; then
# shellcheck disable=SC1090
source "../electron_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh"

if [[ "${ELECTRON_VERSION}" != "$(yarn config get target)" ]]; then
if [[ "${ELECTRON_VERSION}" != "$( yarn config get target )" ]]; then
# Fail the pipeline if electron target doesn't match what is used.
echo "Electron RISC-V binary version doesn't match target electron version!"
echo "Electron ${VSCODE_ARCH} binary version doesn't match target electron version!"
echo "Releases available at: https://github.com/${VSCODE_ELECTRON_REPOSITORY}/releases"
exit 1
fi
Expand Down
14 changes: 9 additions & 5 deletions package_linux_reh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,16 @@ if [[ "${SHOULD_BUILD_REH}" != "no" ]]; then
yarn gulp "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci"

EXPECTED_GLIBC_VERSION="${GLIBC_VERSION}" EXPECTED_GLIBCXX_VERSION="${GLIBCXX_VERSION}" SEARCH_PATH="../vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}" ./build/azure-pipelines/linux/verify-glibc-requirements.sh

pushd "../vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}"
if [ "${VSCODE_ARCH}" == "loong64" ]; then
../ripgrep.loong64.sh

if [[ -f "../ripgrep_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh" ]]; then
exec "../ripgrep_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh"
fi

echo "Archiving REH"
tar czf "../assets/${APP_NAME_LC}-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" .

popd
fi

Expand All @@ -169,12 +171,14 @@ if [[ "${SHOULD_BUILD_REH_WEB}" != "no" ]]; then
EXPECTED_GLIBC_VERSION="${GLIBC_VERSION}" EXPECTED_GLIBCXX_VERSION="${GLIBCXX_VERSION}" SEARCH_PATH="../vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}" ./build/azure-pipelines/linux/verify-glibc-requirements.sh

pushd "../vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}"
if [ "${VSCODE_ARCH}" == "loong64" ]; then
../ripgrep.loong64.sh

if [[ -f "../ripgrep_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh" ]]; then
exec "../ripgrep_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh"
fi

echo "Archiving REH-web"
tar czf "../assets/${APP_NAME_LC}-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" .

popd
fi

Expand Down
8 changes: 2 additions & 6 deletions patches/linux/yarn-dependencies.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js
index 88e3c9eb1bb..4cad4f1a577 100644
index 88e3c9e..4cad4f1 100644
--- a/build/npm/postinstall.js
+++ b/build/npm/postinstall.js
@@ -53,8 +53,10 @@ function npmInstall(dir, opts) {
log(dir, `Installing dependencies inside container ${process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME']}...`);

@@ -55,4 +55,6 @@ function npmInstall(dir, opts) {
opts.cwd = root;
- if (process.env['npm_config_arch'] === 'arm64') {
+ if (process.env['npm_config_arch'] === 'arm64' || process.env['npm_config_arch'] === 'arm' || process.env['npm_config_arch'] === 'ppc64' || process.env['npm_config_arch'] === 'riscv64') {
run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts);
+ } else if (process.env['npm_config_arch'] === 'loong64') {
+ run('sudo', ['docker', 'run', '--rm', '--privileged', 'loongcr.lcpu.dev/multiarch/archlinux', '--reset', '-p', 'yes'], opts);
}
run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, '-w', path.resolve('/root/vscode', dir), process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'sh', '-c', `\"chown -R root:root ${path.resolve('/root/vscode', dir)} && npm i -g node-gyp-build && npm ci\"`], opts);
run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${path.resolve(root, dir)}`], opts);
File renamed without changes.

0 comments on commit e2d0d38

Please sign in to comment.