Skip to content

Commit a1ce271

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 a1ce271

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ jobs:
179179
cache-dependency-path: |
180180
package-lock.json
181181
test/package-lock.json
182-
- run: SKIP_SUBMODULE_DEPS=1 npm ci
183-
- run: npm run build
182+
184183
# Get Code's git hash. When this changes it means the content is
185184
# different and we need to rebuild.
186185
- name: Get latest lib/vscode rev
187186
id: vscode-rev
188187
run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
188+
189189
# We need to rebuild when we have a new version of Code, when any of the
190190
# patches changed, or when the code-server version changes (since it gets
191191
# embedded into the code). Use VSCODE_CACHE_VERSION to force a rebuild.
@@ -198,10 +198,20 @@ jobs:
198198
- name: Build vscode
199199
if: steps.cache-vscode.outputs.cache-hit != 'true'
200200
run: |
201-
pushd lib/vscode
201+
cd lib/vscode/build
202202
npm ci
203-
popd
203+
cd ..
204+
source ./build/azure-pipelines/linux/setup-env.sh
205+
# Run preinstall script before root dependencies are installed
206+
# so that v8 headers are patched correctly for native modules.
207+
node build/npm/preinstall.ts
208+
cd ../..
204209
npm run build:vscode
210+
211+
# Build the code-server wrapper.
212+
- run: SKIP_SUBMODULE_DEPS=1 npm ci
213+
- run: npm run build
214+
205215
# Push up an artifact containing the linux-x64 release.
206216
- run: KEEP_MODULES=1 npm run release
207217
- run: tar -czf package.tar.gz release

0 commit comments

Comments
 (0)