Skip to content

see if segfaults go away #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/docker/Dockerfile.glibc
Original file line number Diff line number Diff line change
Expand Up @@ -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 echo "PRINTING DEPENDENCY INFORMATION"
RUN python3 --version
RUN node --version

RUN npm run install-zstd

RUN echo "ZSTD INSTALLED AND BUILT."
RUN npm install
RUN npm run prebuild

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -93,9 +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:
version: v0.18.0
driver-opts: image=moby/buildkit:v0.17.2

- name: Run Buildx
run: |
Expand Down
69 changes: 40 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -56,12 +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:
version: v0.18.0
driver-opts: image=moby/buildkit:v0.17.2

- name: Run Buildx
run: |
Expand Down Expand Up @@ -98,9 +104,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:
version: v0.18.0
driver-opts: image=moby/buildkit:v0.17.2

- name: Run Buildx
run: |
Expand Down
14 changes: 8 additions & 6 deletions etc/install-zstd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
build_zstd
Loading