From 1c9b74a2fe2d4974e0d09ab25f2e5740111bbe07 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Tue, 25 Jun 2024 17:14:54 -0400 Subject: [PATCH] fix(NODE-6237): build against glibc 2.27 (#28) --- .github/docker/Dockerfile.glibc | 14 ++++++++++---- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 10 ++++++---- test/release.test.ts | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/docker/Dockerfile.glibc b/.github/docker/Dockerfile.glibc index d15188a..c7f3833 100644 --- a/.github/docker/Dockerfile.glibc +++ b/.github/docker/Dockerfile.glibc @@ -1,11 +1,17 @@ -ARG NODE_BUILD_IMAGE=node:16.20.1-bullseye -FROM $NODE_BUILD_IMAGE AS build +FROM ubuntu:bionic AS build + +# Possible values: s390x, arm64, x64 +ARG NODE_ARCH +ADD https://nodejs.org/dist/v16.20.1/node-v16.20.1-linux-${NODE_ARCH}.tar.gz / +RUN mkdir -p /nodejs && tar -xzf /node-v16.20.1-linux-${NODE_ARCH}.tar.gz --strip-components=1 -C /nodejs +ENV PATH=$PATH:/nodejs/bin WORKDIR /mongodb-client-encryption COPY . . -RUN npm run install:libmongocrypt -RUN npm run test +RUN apt-get -qq update && apt-get -qq install -y python3 build-essential && ldd --version + +RUN npm run install:libmongocrypt && npm run test FROM scratch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4c3421..908121f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,7 +58,7 @@ jobs: - name: Run Buildx run: | docker buildx create --name builder --bootstrap --use - docker buildx build --platform linux/${{ matrix.linux_arch }} --output type=local,dest=./prebuilds,platform-split=false -f ./.github/docker/Dockerfile.glibc . + docker buildx build --platform linux/${{ matrix.linux_arch }} --build-arg NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }} --output type=local,dest=./prebuilds,platform-split=false -f ./.github/docker/Dockerfile.glibc . - id: upload name: Upload prebuild diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5b71978..1d6922f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,16 +17,18 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + + - name: Use Node.js LTS + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: 'lts/*' cache: 'npm' + - name: "Build libmongocrypt" shell: bash run: | npm run install:libmongocrypt - + - if: matrix.lint-target == 'c++' shell: bash run: | diff --git a/test/release.test.ts b/test/release.test.ts index c503c22..5b71e83 100644 --- a/test/release.test.ts +++ b/test/release.test.ts @@ -22,7 +22,7 @@ const REQUIRED_FILES = [ ]; describe(`Release ${packFile}`, function () { - this.timeout(10000); + this.timeout(60000); beforeEach(function () { if (process.arch !== 'x64') {