Skip to content

Commit a920ed4

Browse files
committedApr 18, 2024
CI: add script for installing NodeJS and update it to v20
1 parent b1248bc commit a920ed4

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed
 

‎src/ci/docker/host-x86_64/mingw-check/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2121
mingw-w64 \
2222
&& rm -rf /var/lib/apt/lists/*
2323

24-
RUN curl -sL https://nodejs.org/dist/v16.9.0/node-v16.9.0-linux-x64.tar.xz | tar -xJ
25-
ENV PATH="/node-v16.9.0-linux-x64/bin:${PATH}"
2624
ENV RUST_CONFIGURE_ARGS="--set rust.validate-mir-opts=3"
2725

26+
COPY scripts/nodejs.sh /scripts/
27+
RUN sh /scripts/nodejs.sh /node
28+
ENV PATH="/node/bin:${PATH}"
29+
2830
# Install es-check
2931
# Pin its version to prevent unrelated CI failures due to future es-check versions.
3032
RUN npm install es-check@6.1.1 eslint@8.6.0 -g

‎src/ci/docker/host-x86_64/test-various/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2828
qemu-system-x86 \
2929
&& rm -rf /var/lib/apt/lists/*
3030

31-
RUN curl -sL https://nodejs.org/dist/v18.12.0/node-v18.12.0-linux-x64.tar.xz | \
32-
tar -xJ
31+
COPY scripts/nodejs.sh /scripts/
32+
RUN sh /scripts/nodejs.sh /node
33+
ENV PATH="/node/bin:${PATH}"
3334

3435
WORKDIR /build/
3536
COPY scripts/musl-toolchain.sh /build/
@@ -45,7 +46,6 @@ ENV WASI_SDK_PATH=/wasi-sdk-22.0
4546

4647
ENV RUST_CONFIGURE_ARGS \
4748
--musl-root-x86_64=/usr/local/x86_64-linux-musl \
48-
--set build.nodejs=/node-v18.12.0-linux-x64/bin/node \
4949
--set rust.lld
5050

5151
# Some run-make tests have assertions about code size, and enabling debug

‎src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ ENV GCC_EXEC_PREFIX="/usr/lib/gcc/"
7272

7373
COPY host-x86_64/x86_64-gnu-tools/checktools.sh /tmp/
7474

75-
RUN curl -sL https://nodejs.org/dist/v14.20.0/node-v14.20.0-linux-x64.tar.xz | tar -xJ
76-
ENV NODE_FOLDER=/node-v14.20.0-linux-x64/bin
77-
ENV PATH="$NODE_FOLDER:${PATH}"
75+
COPY scripts/nodejs.sh /scripts/
76+
RUN sh /scripts/nodejs.sh /node
77+
ENV PATH="/node/bin:${PATH}"
7878

7979
COPY host-x86_64/x86_64-gnu-tools/browser-ui-test.version /tmp/
8080

‎src/ci/docker/scripts/nodejs.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
NODEJS_VERSION=v20.12.2
6+
INSTALL_PATH=${1:-/node}
7+
8+
url="https://nodejs.org/dist/${NODEJS_VERSION}/node-${NODEJS_VERSION}-linux-x64.tar.xz"
9+
curl -sL "$url" | tar -xJ
10+
mv node-${NODEJS_VERSION}-linux-x64 "${INSTALL_PATH}"

0 commit comments

Comments
 (0)