Skip to content

Commit 4972129

Browse files
fix(NODE-6590): add build for x64 macos (#45)
1 parent 5097e88 commit 4972129

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

.github/workflows/build.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
on:
2-
pull_request:
3-
branches: [main]
42
workflow_dispatch: {}
53
workflow_call: {}
64

@@ -10,7 +8,7 @@ jobs:
108
host_tests:
119
strategy:
1210
matrix:
13-
os: [macos-latest, windows-2019]
11+
os: [macos-latest, windows-2019, macos-13]
1412
fail-fast: false
1513
runs-on: ${{ matrix.os }}
1614
steps:

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
host_tests:
1212
strategy:
1313
matrix:
14-
os: [macos-latest, windows-2019]
14+
os: [macos-latest, windows-2019, macos-13]
1515
node: [16.20.1, 18.x, 20.x, 22.x]
1616
fail-fast: false
1717
runs-on: ${{ matrix.os }}

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
".": "2.0.0-alpha.1"
3-
}
3+
}

binding.gyp

+13
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@
3434
]
3535
},
3636
}
37+
],
38+
['OS=="mac"', {
39+
'xcode_settings': {
40+
"OTHER_CFLAGS": [
41+
"-arch x86_64",
42+
"-arch arm64"
43+
],
44+
"OTHER_LDFLAGS": [
45+
"-arch x86_64",
46+
"-arch arm64"
47+
]
48+
}
49+
}
3750
]
3851
],
3952
'cflags!': [ '-fno-exceptions' ],

etc/install-zstd.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ clean_deps() {
66
}
77

88
download_zstd() {
9-
rm -rf deps
109
mkdir -p deps/zstd
1110
ZSTD_VERSION=$(node -p "require('./package.json')['mongodb:zstd_version']")
1211

@@ -20,7 +19,7 @@ build_zstd() {
2019

2120
# CMAKE_RC_FLAGS is a workaround for a bug in 1.5.6 that breaks compilation on windows.
2221
# The fix is merged but not yet released. see https://github.com/facebook/zstd/issues/3999
23-
cmake -DCMAKE_RC_FLAGS="$(pwd)/lib" -DZSTD_MULTITHREAD_SUPPORT=OFF -DZSTD_BUILD_SHARED=OFF .
22+
cmake -DCMAKE_RC_FLAGS="$(pwd)/lib" -DZSTD_MULTITHREAD_SUPPORT=OFF -DZSTD_BUILD_SHARED=OFF -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64' .
2423
cmake --build .
2524
}
2625

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"node": ">= 16.20.1"
3333
},
3434
"scripts": {
35-
"install": "prebuild-install --runtime napi || node-gyp rebuild",
35+
"install": "prebuild-install --runtime napi || npm run clean-install",
36+
"clean-install": "npm run install-zstd && npm run compile",
3637
"compile": "node-gyp rebuild",
3738
"test": "mocha test/index.test.js",
3839
"install-zstd": "bash etc/install-zstd.sh",

0 commit comments

Comments
 (0)