Skip to content

Commit ace9e96

Browse files
committed
Add preinstall setup to build
Already had this in the release build step, not sure why it is not in the main build step. But we started getting errors building native modules in ci, and this might be why.
1 parent 03f52fd commit ace9e96

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
157157
DISABLE_V8_COMPILE_CACHE: 1
158158
VERSION: 0.0.0
159+
VSCODE_ARCH: x64
159160
VSCODE_TARGET: linux-x64
160161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161162
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
@@ -179,13 +180,13 @@ jobs:
179180
cache-dependency-path: |
180181
package-lock.json
181182
test/package-lock.json
182-
- run: SKIP_SUBMODULE_DEPS=1 npm ci
183-
- run: npm run build
183+
184184
# Get Code's git hash. When this changes it means the content is
185185
# different and we need to rebuild.
186186
- name: Get latest lib/vscode rev
187187
id: vscode-rev
188188
run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
189+
189190
# We need to rebuild when we have a new version of Code, when any of the
190191
# patches changed, or when the code-server version changes (since it gets
191192
# embedded into the code). Use VSCODE_CACHE_VERSION to force a rebuild.
@@ -198,10 +199,21 @@ jobs:
198199
- name: Build vscode
199200
if: steps.cache-vscode.outputs.cache-hit != 'true'
200201
run: |
201-
pushd lib/vscode
202+
cd lib/vscode/build
202203
npm ci
203-
popd
204+
cd ..
205+
source ./build/azure-pipelines/linux/setup-env.sh
206+
# Run preinstall script before root dependencies are installed
207+
# so that v8 headers are patched correctly for native modules.
208+
node build/npm/preinstall.ts
209+
npm run ci
210+
cd ../..
204211
npm run build:vscode
212+
213+
# Build the code-server wrapper.
214+
- run: SKIP_SUBMODULE_DEPS=1 npm ci
215+
- run: npm run build
216+
205217
# Push up an artifact containing the linux-x64 release.
206218
- run: KEEP_MODULES=1 npm run release
207219
- run: tar -czf package.tar.gz release

0 commit comments

Comments
 (0)