Skip to content

Commit

Permalink
Merge pull request #66 from duckdb/jray/mac-x64
Browse files Browse the repository at this point in the history
support mac x64
  • Loading branch information
jraymakers authored Dec 16, 2024
2 parents df797f6 + 8188d8c commit b9ee5e1
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/DuckDBNodeBindingsAndAPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ on:
# type: boolean
# required: true
# default: false
macos_x64:
description: 'Run on Mac OS X x64'
type: boolean
required: true
default: false
windows_x64:
description: 'Run on Windows x64'
type: boolean
Expand Down Expand Up @@ -202,6 +207,47 @@ jobs:
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.DUCKDB_NPM_TOKEN }}

macos_x64:
name: Mac OS X x64
runs-on: macos-13
if: ${{ github.event_name != 'workflow_dispatch' || inputs.macos_x64 }}
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 9

- name: Workspace - Install
run: pnpm install --ignore-scripts

- name: Bindings - Build
working-directory: bindings
run: pnpm run build

- name: Bindings - Test
working-directory: bindings
run: pnpm test

- name: API - Build
working-directory: api
run: pnpm run build

- name: API - Test
working-directory: api
run: pnpm test

- name: Git Status
if: ${{ inputs.publish }}
run: git status

- name: Publish - Bindings - Darwin x64
if: ${{ inputs.publish }}
working-directory: bindings/pkgs/@duckdb/node-bindings-darwin-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }} --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.DUCKDB_NPM_TOKEN }}

windows_x64:
name: Windows x64
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Change version in:
- `api/pkgs/@duckdb/node-api/package.json`
- `bindings/pkgs/@duckdb/node-bindings/package.json`
- `bindings/pkgs/@duckdb/node-bindings-darwin-arm64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-darwin-x64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-linux-arm64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-linux-x64/package.json`
- `bindings/pkgs/@duckdb/node-bindings-win32-x64/package.json`
Expand Down
1 change: 1 addition & 0 deletions api/pkgs/@duckdb/node-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Some features are not yet complete:
- Linux arm64 (experimental)
- Linux x64
- Mac OS X (Darwin) arm64 (Apple Silicon)
- Mac OS X (Darwin) x64 (Intel)
- Windows (Win32) x64

## Examples
Expand Down
31 changes: 29 additions & 2 deletions bindings/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
],
}],
['OS=="mac"', {
['OS=="mac" and target_arch=="arm64"', {
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
Expand All @@ -93,6 +93,25 @@
},
],
}],
['OS=="mac" and target_arch=="x64"', {
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
},
'link_settings': {
'libraries': [
'-lduckdb',
'-L<(module_root_dir)/libduckdb',
'-Wl,-rpath,@loader_path',
],
},
'copies': [
{
'files': ['<(module_root_dir)/libduckdb/libduckdb.dylib'],
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-darwin-x64',
},
],
}],
['OS=="win" and target_arch=="x64"', {
'link_settings': {
'libraries': [
Expand Down Expand Up @@ -129,14 +148,22 @@
},
],
}],
['OS=="mac"', {
['OS=="mac" and target_arch=="arm64"', {
'copies': [
{
'files': ['<(module_root_dir)/build/Release/duckdb.node'],
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-darwin-arm64',
},
],
}],
['OS=="mac" and target_arch=="x64"', {
'copies': [
{
'files': ['<(module_root_dir)/build/Release/duckdb.node'],
'destination': '<(module_root_dir)/pkgs/@duckdb/node-bindings-darwin-x64',
},
],
}],
['OS=="win" and target_arch=="x64"', {
'copies': [
{
Expand Down
1 change: 1 addition & 0 deletions bindings/pkgs/@duckdb/node-bindings-darwin-x64/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
5 changes: 5 additions & 0 deletions bindings/pkgs/@duckdb/node-bindings-darwin-x64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DuckDB Node Bindings: Darwin x64

Binaries supporting [Node](https://nodejs.org/) bindings to the [DuckDB C API](https://duckdb.org/docs/api/c/overview) for Mac OS X (Darwin) x64.

See [@duckdb/node-bindings](https://www.npmjs.com/package/@duckdb/node-bindings) for a low-level API that uses these binaries, or [@duckdb/node-api](https://www.npmjs.com/package/@duckdb/node-api) for a high-level API built on those bindings.
14 changes: 14 additions & 0 deletions bindings/pkgs/@duckdb/node-bindings-darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@duckdb/node-bindings-darwin-x64",
"version": "1.1.3-alpha.6",
"os": [
"darwin"
],
"cpu": [
"x64"
],
"repository": {
"type": "git",
"url": "https://github.com/duckdb/duckdb-node-neo.git"
}
}
1 change: 1 addition & 0 deletions bindings/pkgs/@duckdb/node-bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ See [@duckdb/node-api](https://www.npmjs.com/package/@duckdb/node-api) for a hig
- Linux arm64 (experimental)
- Linux x64
- Mac OS X (Darwin) arm64 (Apple Silicon)
- Mac OS X (Darwin) x64 (Intel)
- Windows (Win32) x64
1 change: 1 addition & 0 deletions bindings/pkgs/@duckdb/node-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"types": "./duckdb.d.ts",
"optionalDependencies": {
"@duckdb/node-bindings-darwin-arm64": "workspace:*",
"@duckdb/node-bindings-darwin-x64": "workspace:*",
"@duckdb/node-bindings-linux-arm64": "workspace:*",
"@duckdb/node-bindings-linux-x64": "workspace:*",
"@duckdb/node-bindings-win32-x64": "workspace:*"
Expand Down
5 changes: 5 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b9ee5e1

Please sign in to comment.