Skip to content
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

feat(core): compile native code for freebsd #17313

Merged
merged 12 commits into from
May 30, 2023
99 changes: 49 additions & 50 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,63 +151,62 @@ jobs:
name: bindings-${{ matrix.settings.target }}
path: packages/**/*.node
if-no-files-found: error
# build-freebsd:
# runs-on: macos-12
# name: Build FreeBSD
# steps:
# - uses: actions/checkout@v3
# - name: Build
# id: build
# uses: vmactions/freebsd-vm@v0
# env:
# DEBUG: napi:*
# RUSTUP_HOME: /usr/local/rustup
# CARGO_HOME: /usr/local/cargo
# RUSTUP_IO_THREADS: 1
# with:
# envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS
# usesh: true
# mem: 3000
# prepare: |
# pkg install -y -f curl node libnghttp2
# curl -qL https://www.npmjs.com/install.sh | sh
# npm install --location=global --ignore-scripts yarn
# curl https://sh.rustup.rs -sSf --output rustup.sh
# sh rustup.sh -y --profile minimal --default-toolchain stable
# export PATH="/usr/local/cargo/bin:$PATH"
# echo "~~~~ rustc --version ~~~~"
# rustc --version
# echo "~~~~ node -v ~~~~"
# node -v
# echo "~~~~ yarn --version ~~~~"
# yarn --version
# run: |
# export PATH="/usr/local/cargo/bin:$PATH"
# pwd
# ls -lah
# whoami
# env
# freebsd-version
# yarn install
# yarn nx -- run-many --target=build-native -- --target=x86_64-unknown-freebsd
# strip -x packages/*/*.node
# rm -rf node_modules
# rm -rf target
# rm -rf .yarn/cache
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: bindings-freebsd
# path: packages/*/*.node
# if-no-files-found: error
build-freebsd:
runs-on: macos-12
name: Build FreeBSD
steps:
- uses: actions/checkout@v3
- name: Build
id: build
uses: vmactions/freebsd-vm@v0
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_IO_THREADS: 1
with:
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS
usesh: true
mem: 3000
prepare: |
pkg install -y -f curl node libnghttp2
curl -qL https://www.npmjs.com/install.sh | sh
npm install --location=global --ignore-scripts pnpm
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
export PATH="/usr/local/cargo/bin:$PATH"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
echo "~~~~ pnpm --version ~~~~"
pnpm --version
run: |
export PATH="/usr/local/cargo/bin:$PATH"
pwd
ls -lah
whoami
env
freebsd-version
mkdir -p /Users/runner/work/_temp/_github_workflow
echo "{}" > /Users/runner/work/_temp/_github_workflow/event.json
pnpm install --frozen-lockfile --dev --ignore-scripts --no-optional
pnpm nx run-many --target=build-native -- --target=x86_64-unknown-freebsd
rm -rf node_modules
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: bindings-freebsd
path: packages/**/*.node
if-no-files-found: error
publish:
if: ${{ github.repository_owner == 'nrwl' }}
name: Publish
runs-on: ubuntu-latest
permissions:
id-token: write
needs:
# - build-freebsd
- build-freebsd
- build
steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions packages/nx/native-packages/freebsd-x64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `nx-freebsd-x64`

This is the **x86_64-unknown-freebsd** binary for `@nx/nx`
25 changes: 25 additions & 0 deletions packages/nx/native-packages/freebsd-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@nx/nx-freebsd-x64",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "https://github.com/nrwl/nx.git",
"directory": "packages/nx/native-packages/freebsd-x64"
},
"os": [
"freebsd"
],
"cpu": [
"x64"
],
"main": "nx.freebsd-x64.node",
"files": [
"nx.freebsd-x64.node"
],
"engines": {
"node": ">= 10"
},
"publishConfig": {
"access": "public"
}
}
12 changes: 7 additions & 5 deletions packages/nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@
}
},
"optionalDependencies": {
"@nx/nx-win32-x64-msvc": "*",
"@nx/nx-darwin-x64": "*",
"@nx/nx-linux-x64-gnu": "*",
"@nx/nx-darwin-arm64": "*",
"@nx/nx-linux-x64-gnu": "*",
"@nx/nx-linux-x64-musl": "*",
"@nx/nx-win32-x64-msvc": "*",
"@nx/nx-linux-arm64-gnu": "*",
"@nx/nx-linux-arm64-musl": "*",
"@nx/nx-win32-arm64-msvc": "*",
"@nx/nx-linux-arm-gnueabihf": "*",
"@nx/nx-linux-x64-musl": "*"
"@nx/nx-win32-arm64-msvc": "*",
"@nx/nx-freebsd-x64": "*"
},
"nx-migrations": {
"migrations": "./migrations.json",
Expand Down Expand Up @@ -166,7 +167,8 @@
"aarch64-unknown-linux-musl",
"aarch64-pc-windows-msvc",
"armv7-unknown-linux-gnueabihf",
"x86_64-unknown-linux-musl"
"x86_64-unknown-linux-musl",
"x86_64-unknown-freebsd"
]
}
}
Expand Down