Skip to content

Commit 236b7b2

Browse files
asdf
1 parent f2b0d1c commit 236b7b2

File tree

11 files changed

+1980
-129
lines changed

11 files changed

+1980
-129
lines changed

.github/docker/Dockerfile.glibc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,3 @@ RUN npm run install-zstd && npm install
1717

1818
ARG RUN_TEST
1919
RUN [ -n "$RUN_TEST" ] && npm test || echo 'skipping testing!'
20-
21-
FROM scratch
22-
23-
COPY --from=build /zstd/prebuilds/ /

.github/docker/Dockerfile.musl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@ RUN npm run install-zstd && npm i
1212

1313
ARG RUN_TEST
1414
RUN [ -n "$RUN_TEST" ] && npm test || echo 'skipping testing!'
15-
16-
FROM scratch
17-
18-
COPY --from=build /zstd/prebuilds/ /

.github/workflows/test.yml

Lines changed: 85 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ jobs:
1111
host_tests:
1212
strategy:
1313
matrix:
14-
os: [macos-latest, windows-2019]
14+
# os: [macos-latest, windows-2019]
15+
os: [windows-2019]
1516
node: [16.20.1, 18.x, 20.x, 22.x]
17+
fail-fast: false
18+
1619
runs-on: ${{ matrix.os }}
1720
steps:
1821
- uses: actions/checkout@v4
@@ -27,85 +30,91 @@ jobs:
2730
run: npm run install-zstd
2831
shell: bash
2932

30-
- name: install dependencies and compmile
33+
- name: install dependencies and compile
3134
run: npm install --loglevel verbose
3235
shell: bash
3336

3437
- name: Test ${{ matrix.os }}
3538
shell: bash
3639
run: npm test
3740

38-
container_tests_glibc:
39-
runs-on: ubuntu-latest
40-
strategy:
41-
matrix:
42-
linux_arch: [s390x, arm64, amd64]
43-
node: [16.x, 18.x, 20.x, 22.x]
44-
steps:
45-
- uses: actions/checkout@v4
46-
47-
- uses: actions/setup-node@v4
48-
with:
49-
node-version: ${{ matrix.node }}
50-
51-
- name: Get Full Node.js Version
52-
id: get_nodejs_version
53-
shell: bash
54-
run: |
55-
echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT"
56-
echo "ubuntu_version=$(node --print '(+process.version.slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`')" >> "$GITHUB_OUTPUT"
57-
58-
- name: Set up QEMU
59-
uses: docker/setup-qemu-action@v3
60-
61-
- name: Set up Docker Buildx
62-
uses: docker/setup-buildx-action@v3
63-
64-
- name: Run Buildx
65-
run: |
66-
docker buildx create --name builder --bootstrap --use
67-
docker buildx build \
68-
--platform linux/${{ matrix.linux_arch }} \
69-
--build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
70-
--build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
71-
--build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \
72-
--build-arg="RUN_TEST=true" \
73-
--output type=local,dest=./prebuilds,platform-split=false \
74-
-f ./.github/docker/Dockerfile.glibc \
75-
.
76-
77-
container_tests_musl:
78-
runs-on: ubuntu-latest
79-
strategy:
80-
matrix:
81-
linux_arch: [arm64, amd64]
82-
node: [16.20.1, 18.x, 20.x, 22.x]
83-
steps:
84-
- uses: actions/checkout@v4
85-
86-
- uses: actions/setup-node@v4
87-
with:
88-
node-version: ${{ matrix.node }}
89-
90-
- name: Get Full Node.js Version
91-
id: get_nodejs_version
92-
shell: bash
93-
run: |
94-
echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT"
95-
96-
- name: Set up QEMU
97-
uses: docker/setup-qemu-action@v3
98-
99-
- name: Set up Docker Buildx
100-
uses: docker/setup-buildx-action@v3
101-
102-
- name: Run Buildx
103-
run: |
104-
docker buildx create --name builder --bootstrap --use
105-
docker --debug buildx build --progress=plain --no-cache \
106-
--platform linux/${{ matrix.linux_arch }} \
107-
--build-arg="PLATFORM=/${{ matrix.linux_arch }}" \
108-
--build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
109-
--build-arg="RUN_TEST=true" \
110-
-f ./.github/docker/Dockerfile.musl -t musl-zstd-base \
111-
.
41+
# container_tests_glibc:
42+
# runs-on: ubuntu-latest
43+
# strategy:
44+
# matrix:
45+
# linux_arch: [s390x, arm64, amd64]
46+
# # node: [16.x, 18.x, 20.x, 22.x]
47+
# node: [16.x]
48+
# fail-fast: false
49+
# steps:
50+
# - uses: actions/checkout@v4
51+
52+
# - uses: actions/setup-node@v4
53+
# with:
54+
# node-version: ${{ matrix.node }}
55+
56+
# - name: Get Full Node.js Version
57+
# id: get_nodejs_version
58+
# shell: bash
59+
# run: |
60+
# echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT"
61+
# echo "ubuntu_version=$(node --print '(+process.version.slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`')" >> "$GITHUB_OUTPUT"
62+
63+
# - name: Set up QEMU
64+
# uses: docker/setup-qemu-action@v3
65+
66+
# - name: Set up Docker Buildx
67+
# uses: docker/setup-buildx-action@v3
68+
69+
# - name: Run Buildx
70+
# run: |
71+
# docker buildx create --name builder --bootstrap --use
72+
# docker buildx build \
73+
# --platform linux/${{ matrix.linux_arch }} \
74+
# --build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \
75+
# --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
76+
# --build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \
77+
# --build-arg="RUN_TEST=true" \
78+
# --output type=local,dest=./prebuilds,platform-split=false \
79+
# -f ./.github/docker/Dockerfile.glibc \
80+
# .
81+
82+
# container_tests_musl:
83+
# runs-on: ubuntu-latest
84+
# strategy:
85+
# matrix:
86+
# linux_arch: [arm64, amd64]
87+
# # node: [16.20.1, 18.x, 20.x, 22.x]
88+
# node: [16.20.1]
89+
# fail-fast: false
90+
91+
# steps:
92+
# - uses: actions/checkout@v4
93+
94+
# - uses: actions/setup-node@v4
95+
# with:
96+
# node-version: ${{ matrix.node }}
97+
98+
# - name: Get Full Node.js Version
99+
# id: get_nodejs_version
100+
# shell: bash
101+
# run: |
102+
# echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT"
103+
104+
# - name: Set up QEMU
105+
# uses: docker/setup-qemu-action@v3
106+
107+
# - name: Set up Docker Buildx
108+
# uses: docker/setup-buildx-action@v3
109+
110+
# - name: Run Buildx
111+
# run: |
112+
# docker buildx create --name builder --bootstrap --use
113+
# docker --debug buildx build --progress=plain --no-cache \
114+
# --platform linux/${{ matrix.linux_arch }} \
115+
# --build-arg="PLATFORM=${{ matrix.linux_arch }}" \
116+
# --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \
117+
# --build-arg="RUN_TEST=true" \
118+
# --output type=local,dest=./prebuilds,platform-split=false \
119+
# -f ./.github/docker/Dockerfile.musl \
120+
# .

addon/compression.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef MONGODB_ZSTD_COMPRESSION
22
#define MONGODB_ZSTD_COMPRESSION
33

4-
#include <exception>
4+
#include <stdexcept>
55
#include <vector>
66

77
#include "compression_worker.h"

binding.gyp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,34 @@
2222
'CLANG_CXX_LIBRARY': 'libc++',
2323
'MACOSX_DEPLOYMENT_TARGET': '11',
2424
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
25+
'OTHER_CFLAGS': [
26+
'-std=c++17',
27+
'-stdlib=libc++'
28+
],
2529
},
30+
'conditions': [
31+
[
32+
'OS=="win"',
33+
{
34+
'msvs_settings': {
35+
'VCCLCompilerTool': {
36+
'ExceptionHandling': 1,
37+
'AdditionalOptions': [
38+
'-std:c++17'
39+
]
40+
}
41+
},
42+
'include_dirs': [
43+
'<(module_root_dir)/deps/include'
44+
],
45+
'link_settings': {
46+
'libraries': [
47+
'<(module_root_dir)/deps/zstd/build/cmake/lib/libzstd.lib'
48+
]
49+
}
50+
}
51+
]
52+
],
2653
'cflags!': [ '-fno-exceptions' ],
2754
'cflags_cc!': [ '-fno-exceptions' ],
2855
'cflags_cc': ['-std=c++17'],

docker.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# # docker buildx create --name builder --bootstrap --use
2+
# docker --debug buildx build --progress=plain --no-cache \
3+
# --platform linux/amd64 --output type=local,dest=./prebuilds,platform-split=false \
4+
# --build-arg="P=amd64" \
5+
# -f ./Dockerfile.musl \
6+
# .
7+
8+
musl() {
9+
docker --debug buildx build --load --progress=plain --no-cache \
10+
--platform linux/amd64 --output=type=docker \
11+
--build-arg="PLATFORM=amd64" \
12+
--build-arg="NODE_VERSION=16.20.1" \
13+
--build-arg="RUN_TEST=true" \
14+
-f ./.github/docker/Dockerfile.musl -t musl-zstd-base \
15+
.
16+
}
17+
18+
19+
glibc() {
20+
docker buildx build --load --progress=plain \
21+
--platform linux/amd64 \
22+
--build-arg="NODE_ARCH=x64" \
23+
--build-arg="RUN_TEST=true" \
24+
-f ./.github/docker/Dockerfile.glibc \
25+
.
26+
}
27+
28+
musl

etc/install-zstd.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ download_zstd() {
1111

1212
curl -L "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz" \
1313
| tar -zxf - -C deps/zstd --strip-components 1
14+
15+
ls deps/zstd
1416
}
1517

1618
build_zstd() {
1719
export MACOSX_DEPLOYMENT_TARGET=10.12
1820
cd deps/zstd/build/cmake
1921

20-
cmake .
22+
cmake -G "Unix Makefiles" .
23+
24+
echo "current dir: $(pwd)"
2125
make
2226
}
2327

0 commit comments

Comments
 (0)