From 7a905ca70dc4aac48fcca02bed591c76b043bdd9 Mon Sep 17 00:00:00 2001 From: bailey Date: Wed, 5 Feb 2025 07:42:28 -0700 Subject: [PATCH 1/5] see if segfaults go away --- .github/workflows/build.yml | 3 +++ .github/workflows/test.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efbbfe7..858a2d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,6 +96,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver-opts: image=moby/buildkit:v0.18.1 + version: v0.19.2 - name: Run Buildx run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89f9590..d6de8b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,6 +101,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver-opts: image=moby/buildkit:v0.18.1 + version: v0.19.2 - name: Run Buildx run: | From a5bc5cd952bb523cff32dfec0dcf76d216000fc6 Mon Sep 17 00:00:00 2001 From: bailey Date: Wed, 5 Feb 2025 07:54:04 -0700 Subject: [PATCH 2/5] saved --- .github/docker/Dockerfile.glibc | 10 +++++++++- etc/install-zstd.sh | 14 ++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/docker/Dockerfile.glibc b/.github/docker/Dockerfile.glibc index b20e124..72b5e80 100644 --- a/.github/docker/Dockerfile.glibc +++ b/.github/docker/Dockerfile.glibc @@ -12,10 +12,18 @@ WORKDIR /zstd COPY . . RUN apt-get -qq update -RUN apt-get -qq install -y python3 build-essential curl cmake +RUN apt-get -qq install -y python3 +RUN apt-get -qq install -y build-essential +RUN apt-get -qq install -y curl +RUN apt-get -qq install -y cmake + +RUN "PRINTING DEPENDENCY INFORMATION" RUN python3 --version +RUN node --version RUN npm run install-zstd + +RUN "ZSTD INSTALLED AND BUILT." RUN npm install RUN npm run prebuild diff --git a/etc/install-zstd.sh b/etc/install-zstd.sh index 1f3bae8..7a26eef 100644 --- a/etc/install-zstd.sh +++ b/etc/install-zstd.sh @@ -8,18 +8,20 @@ clean_deps() { download_zstd() { mkdir -p deps/zstd + + echo "NODE VERSION: $(node --version)" ZSTD_VERSION=$(node -p "require('./package.json')['mongodb:zstd_version']") # only unpack the source and build files needed to compile the project necessary_files="zstd-$ZSTD_VERSION/build zstd-$ZSTD_VERSION/lib zstd-$ZSTD_VERSION/programs" - + # flags # -L follow redirects # -C output directory # - tar from stdin # --strip-components ignore the top-level directory when unpacking - curl -L "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" \ - | tar -zxf - -C deps/zstd --strip-components 1 $necessary_files + curl -L "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" | + tar -zxf - -C deps/zstd --strip-components 1 $necessary_files } build_zstd() { @@ -37,11 +39,11 @@ build_zstd() { -DZSTD_BUILD_SHARED=OFF \ -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64' \ -DCMAKE_BUILD_TYPE=Release \ - ../build/cmake + ../build/cmake - cmake --build . --target libzstd_static --config Release + cmake --build . --target libzstd_static --config Release } clean_deps download_zstd -build_zstd \ No newline at end of file +build_zstd From 2f304f21f4d77d73f691b85c4d147018aa81242a Mon Sep 17 00:00:00 2001 From: bailey Date: Wed, 5 Feb 2025 07:57:22 -0700 Subject: [PATCH 3/5] fix dockerfile --- .github/docker/Dockerfile.glibc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/docker/Dockerfile.glibc b/.github/docker/Dockerfile.glibc index 72b5e80..e383ef0 100644 --- a/.github/docker/Dockerfile.glibc +++ b/.github/docker/Dockerfile.glibc @@ -17,13 +17,13 @@ RUN apt-get -qq install -y build-essential RUN apt-get -qq install -y curl RUN apt-get -qq install -y cmake -RUN "PRINTING DEPENDENCY INFORMATION" +RUN echo "PRINTING DEPENDENCY INFORMATION" RUN python3 --version RUN node --version RUN npm run install-zstd -RUN "ZSTD INSTALLED AND BUILT." +RUN echo "ZSTD INSTALLED AND BUILT." RUN npm install RUN npm run prebuild From 9100778391465e0a0db84d91f7779cd0920767ac Mon Sep 17 00:00:00 2001 From: bailey Date: Wed, 5 Feb 2025 07:58:08 -0700 Subject: [PATCH 4/5] winnow matrix --- .github/workflows/test.yml | 140 +++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 68 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6de8b6..9059c05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,39 +8,40 @@ on: name: Test jobs: - host_tests: - strategy: - matrix: - os: [macos-latest, windows-2019, macos-13] - node: [16.20.1, 18.x, 20.x, 22.x] - fail-fast: false - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "npm" - registry-url: "https://registry.npmjs.org" - - - name: Install zstd - run: npm run install-zstd - shell: bash - - - name: install dependencies and compile - run: npm install --ignore-scripts --loglevel verbose && npm run prebuild - shell: bash - - - name: Test ${{ matrix.os }} - shell: bash - run: npm test + # host_tests: + # strategy: + # matrix: + # os: [macos-latest, windows-2019, macos-13] + # node: [16.20.1, 18.x, 20.x, 22.x] + # fail-fast: false + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v4 + + # - uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node }} + # cache: "npm" + # registry-url: "https://registry.npmjs.org" + + # - name: Install zstd + # run: npm run install-zstd + # shell: bash + + # - name: install dependencies and compile + # run: npm install --ignore-scripts --loglevel verbose && npm run prebuild + # shell: bash + + # - name: Test ${{ matrix.os }} + # shell: bash + # run: npm test container_tests_glibc: runs-on: ubuntu-latest strategy: matrix: - linux_arch: [s390x, arm64, amd64] + # linux_arch: [s390x, arm64, amd64] + linux_arch: [s390x, arm64] node: [16.x, 18.x, 20.x, 22.x] fail-fast: false steps: @@ -62,6 +63,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver-opts: image=moby/buildkit:v0.18.1 + version: v0.19.2 - name: Run Buildx run: | @@ -76,43 +80,43 @@ jobs: -f ./.github/docker/Dockerfile.glibc \ . - container_tests_musl: - runs-on: ubuntu-latest - strategy: - matrix: - linux_arch: [amd64, arm64] - node: [16.20.1, 18.x, 20.x, 22.x] - fail-fast: false - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - - name: Get Full Node.js Version - id: get_nodejs_version - shell: bash - run: | - echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver-opts: image=moby/buildkit:v0.18.1 - version: v0.19.2 - - - name: Run Buildx - run: | - docker buildx create --name builder --bootstrap --use - docker --debug buildx build --progress=plain --no-cache \ - --platform linux/${{ matrix.linux_arch }} \ - --build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \ - --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \ - --build-arg="RUN_TEST=true" \ - --output type=local,dest=./prebuilds,platform-split=false \ - -f ./.github/docker/Dockerfile.musl \ - . + # container_tests_musl: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # linux_arch: [amd64, arm64] + # node: [16.20.1, 18.x, 20.x, 22.x] + # fail-fast: false + # steps: + # - uses: actions/checkout@v4 + + # - uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node }} + + # - name: Get Full Node.js Version + # id: get_nodejs_version + # shell: bash + # run: | + # echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT" + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + # with: + # driver-opts: image=moby/buildkit:v0.18.1 + # version: v0.19.2 + + # - name: Run Buildx + # run: | + # docker buildx create --name builder --bootstrap --use + # docker --debug buildx build --progress=plain --no-cache \ + # --platform linux/${{ matrix.linux_arch }} \ + # --build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \ + # --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \ + # --build-arg="RUN_TEST=true" \ + # --output type=local,dest=./prebuilds,platform-split=false \ + # -f ./.github/docker/Dockerfile.musl \ + # . From 4fdc55acd44f89bb50cd5600931bceae5ff2ecc1 Mon Sep 17 00:00:00 2001 From: bailey Date: Fri, 7 Feb 2025 13:58:53 -0700 Subject: [PATCH 5/5] pin docker / buildx --- .github/workflows/build.yml | 13 ++++-- .github/workflows/test.yml | 82 +++++++++++++++++++------------------ 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 858a2d0..dda0318 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,12 +50,17 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 - name: Run Buildx run: | @@ -93,12 +98,14 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: - driver-opts: image=moby/buildkit:v0.18.1 - version: v0.19.2 + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 - name: Run Buildx run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9059c05..01b501f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,15 +57,17 @@ jobs: run: | echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT" echo "ubuntu_version=$(node --print '(+process.version.slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`')" >> "$GITHUB_OUTPUT" - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: - driver-opts: image=moby/buildkit:v0.18.1 - version: v0.19.2 + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 - name: Run Buildx run: | @@ -80,43 +82,45 @@ jobs: -f ./.github/docker/Dockerfile.glibc \ . - # container_tests_musl: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # linux_arch: [amd64, arm64] - # node: [16.20.1, 18.x, 20.x, 22.x] - # fail-fast: false - # steps: - # - uses: actions/checkout@v4 + container_tests_musl: + runs-on: ubuntu-latest + strategy: + matrix: + linux_arch: [amd64, arm64] + node: [16.20.1, 18.x, 20.x, 22.x] + fail-fast: false + steps: + - uses: actions/checkout@v4 - # - uses: actions/setup-node@v4 - # with: - # node-version: ${{ matrix.node }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} - # - name: Get Full Node.js Version - # id: get_nodejs_version - # shell: bash - # run: | - # echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT" + - name: Get Full Node.js Version + id: get_nodejs_version + shell: bash + run: | + echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT" - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - # with: - # driver-opts: image=moby/buildkit:v0.18.1 - # version: v0.19.2 - - # - name: Run Buildx - # run: | - # docker buildx create --name builder --bootstrap --use - # docker --debug buildx build --progress=plain --no-cache \ - # --platform linux/${{ matrix.linux_arch }} \ - # --build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \ - # --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \ - # --build-arg="RUN_TEST=true" \ - # --output type=local,dest=./prebuilds,platform-split=false \ - # -f ./.github/docker/Dockerfile.musl \ - # . + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 + + - name: Run Buildx + run: | + docker buildx create --name builder --bootstrap --use + docker --debug buildx build --progress=plain --no-cache \ + --platform linux/${{ matrix.linux_arch }} \ + --build-arg="PLATFORM=${{ matrix.linux_arch == 'arm64' && 'arm64v8' || matrix.linux_arch }}" \ + --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \ + --build-arg="RUN_TEST=true" \ + --output type=local,dest=./prebuilds,platform-split=false \ + -f ./.github/docker/Dockerfile.musl \ + .