Skip to content

Commit 837e240

Browse files
Add Freebsd build target (#16277)
Closes #15731 This PR adds a FreeBSD build target to our CI workflows. It was tested on CI: https://github.com/tailwindlabs/tailwindcss/actions/runs/13159185517/job/36723613079 However, due to the build not emitting final npm packages, we don't have a way to actually test the final package before we ship it to an insiders release. --------- Co-authored-by: Robin Malfait <[email protected]>
1 parent 0ecc22b commit 837e240

File tree

4 files changed

+133
-0
lines changed

4 files changed

+133
-0
lines changed

.github/workflows/prepare-release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,49 @@ jobs:
137137
name: bindings-${{ matrix.target }}
138138
path: ${{ env.OXIDE_LOCATION }}/*.node
139139

140+
build-freebsd:
141+
name: Build x86_64-unknown-freebsd (OXIDE)
142+
runs-on: ubuntu-latest
143+
timeout-minutes: 15
144+
steps:
145+
- uses: actions/checkout@v4
146+
- name: Build FreeBSD
147+
uses: cross-platform-actions/[email protected]
148+
env:
149+
DEBUG: napi:*
150+
RUSTUP_HOME: /usr/local/rustup
151+
CARGO_HOME: /usr/local/cargo
152+
RUSTUP_IO_THREADS: 1
153+
RUST_TARGET: x86_64-unknown-freebsd
154+
with:
155+
operating_system: freebsd
156+
version: '14.0'
157+
memory: 13G
158+
cpu_count: 3
159+
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
160+
shell: bash
161+
run: |
162+
sudo pkg install -y -f curl node libnghttp2 npm
163+
sudo npm install -g pnpm --unsafe-perm=true
164+
curl https://sh.rustup.rs -sSf --output rustup.sh
165+
sh rustup.sh -y --profile minimal --default-toolchain beta
166+
source "$HOME/.cargo/env"
167+
echo "~~~~ rustc --version ~~~~"
168+
rustc --version
169+
echo "~~~~ node -v ~~~~"
170+
node -v
171+
echo "~~~~ pnpm --version ~~~~"
172+
pnpm --version
173+
pnpm install --ignore-scripts --filter=!./playgrounds/* || true
174+
pnpm run --filter ${{ env.OXIDE_LOCATION }} build
175+
strip -x ${{ env.OXIDE_LOCATION }}/*.node
176+
ls -la ${{ env.OXIDE_LOCATION }}
177+
- name: Upload artifacts
178+
uses: actions/upload-artifact@v4
179+
with:
180+
name: bindings-x86_64-unknown-freebsd
181+
path: ${{ env.OXIDE_LOCATION }}/*.node
182+
140183
prepare:
141184
runs-on: macos-14
142185
timeout-minutes: 15
@@ -217,6 +260,7 @@ jobs:
217260
cp bindings-armv7-unknown-linux-gnueabihf/* ./npm/linux-arm-gnueabihf/
218261
cp bindings-x86_64-unknown-linux-gnu/* ./npm/linux-x64-gnu/
219262
cp bindings-x86_64-unknown-linux-musl/* ./npm/linux-x64-musl/
263+
cp bindings-x86_64-unknown-freebsd/* ./npm/freebsd-x64/
220264
221265
- name: Build Tailwind CSS
222266
run: pnpm run build

.github/workflows/release-insiders.yml

+44
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,49 @@ jobs:
136136
name: bindings-${{ matrix.target }}
137137
path: ${{ env.OXIDE_LOCATION }}/*.node
138138

139+
build-freebsd:
140+
name: Build x86_64-unknown-freebsd (OXIDE)
141+
runs-on: ubuntu-latest
142+
timeout-minutes: 15
143+
steps:
144+
- uses: actions/checkout@v4
145+
- name: Build FreeBSD
146+
uses: cross-platform-actions/[email protected]
147+
env:
148+
DEBUG: napi:*
149+
RUSTUP_HOME: /usr/local/rustup
150+
CARGO_HOME: /usr/local/cargo
151+
RUSTUP_IO_THREADS: 1
152+
RUST_TARGET: x86_64-unknown-freebsd
153+
with:
154+
operating_system: freebsd
155+
version: '14.0'
156+
memory: 13G
157+
cpu_count: 3
158+
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
159+
shell: bash
160+
run: |
161+
sudo pkg install -y -f curl node libnghttp2 npm
162+
sudo npm install -g pnpm --unsafe-perm=true
163+
curl https://sh.rustup.rs -sSf --output rustup.sh
164+
sh rustup.sh -y --profile minimal --default-toolchain beta
165+
source "$HOME/.cargo/env"
166+
echo "~~~~ rustc --version ~~~~"
167+
rustc --version
168+
echo "~~~~ node -v ~~~~"
169+
node -v
170+
echo "~~~~ pnpm --version ~~~~"
171+
pnpm --version
172+
pnpm install --ignore-scripts --filter=!./playgrounds/* || true
173+
pnpm run --filter ${{ env.OXIDE_LOCATION }} build
174+
strip -x ${{ env.OXIDE_LOCATION }}/*.node
175+
ls -la ${{ env.OXIDE_LOCATION }}
176+
- name: Upload artifacts
177+
uses: actions/upload-artifact@v4
178+
with:
179+
name: bindings-x86_64-unknown-freebsd
180+
path: ${{ env.OXIDE_LOCATION }}/*.node
181+
139182
release:
140183
runs-on: macos-14
141184
timeout-minutes: 15
@@ -214,6 +257,7 @@ jobs:
214257
cp bindings-armv7-unknown-linux-gnueabihf/* ./npm/linux-arm-gnueabihf/
215258
cp bindings-x86_64-unknown-linux-gnu/* ./npm/linux-x64-gnu/
216259
cp bindings-x86_64-unknown-linux-musl/* ./npm/linux-x64-musl/
260+
cp bindings-x86_64-unknown-freebsd/* ./npm/freebsd-x64/
217261
218262
- name: 'Version based on commit: 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }}'
219263
run: pnpm run version-packages 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }}

.github/workflows/release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,49 @@ jobs:
136136
name: bindings-${{ matrix.target }}
137137
path: ${{ env.OXIDE_LOCATION }}/*.node
138138

139+
build-freebsd:
140+
name: Build x86_64-unknown-freebsd (OXIDE)
141+
runs-on: ubuntu-latest
142+
timeout-minutes: 15
143+
steps:
144+
- uses: actions/checkout@v4
145+
- name: Build FreeBSD
146+
uses: cross-platform-actions/[email protected]
147+
env:
148+
DEBUG: napi:*
149+
RUSTUP_HOME: /usr/local/rustup
150+
CARGO_HOME: /usr/local/cargo
151+
RUSTUP_IO_THREADS: 1
152+
RUST_TARGET: x86_64-unknown-freebsd
153+
with:
154+
operating_system: freebsd
155+
version: '14.0'
156+
memory: 13G
157+
cpu_count: 3
158+
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
159+
shell: bash
160+
run: |
161+
sudo pkg install -y -f curl node libnghttp2 npm
162+
sudo npm install -g pnpm --unsafe-perm=true
163+
curl https://sh.rustup.rs -sSf --output rustup.sh
164+
sh rustup.sh -y --profile minimal --default-toolchain beta
165+
source "$HOME/.cargo/env"
166+
echo "~~~~ rustc --version ~~~~"
167+
rustc --version
168+
echo "~~~~ node -v ~~~~"
169+
node -v
170+
echo "~~~~ pnpm --version ~~~~"
171+
pnpm --version
172+
pnpm install --ignore-scripts --filter=!./playgrounds/* || true
173+
pnpm run --filter ${{ env.OXIDE_LOCATION }} build
174+
strip -x ${{ env.OXIDE_LOCATION }}/*.node
175+
ls -la ${{ env.OXIDE_LOCATION }}
176+
- name: Upload artifacts
177+
uses: actions/upload-artifact@v4
178+
with:
179+
name: bindings-x86_64-unknown-freebsd
180+
path: ${{ env.OXIDE_LOCATION }}/*.node
181+
139182
release:
140183
runs-on: macos-14
141184
timeout-minutes: 15
@@ -209,6 +252,7 @@ jobs:
209252
cp bindings-armv7-unknown-linux-gnueabihf/* ./npm/linux-arm-gnueabihf/
210253
cp bindings-x86_64-unknown-linux-gnu/* ./npm/linux-x64-gnu/
211254
cp bindings-x86_64-unknown-linux-musl/* ./npm/linux-x64-musl/
255+
cp bindings-x86_64-unknown-freebsd/* ./npm/freebsd-x64/
212256
213257
- name: Build Tailwind CSS
214258
run: pnpm run build

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Vite: Skip parsing stylesheets with the `?commonjs-proxy` flag ([#16238](https://github.com/tailwindlabs/tailwindcss/pull/16238))
1717
- Fix `order-first` and `order-last` for Firefox ([#16266](https://github.com/tailwindlabs/tailwindcss/pull/16266))
1818
- Ensure `NODE_PATH` is respected when resolving JavaScript and CSS files ([#16274](https://github.com/tailwindlabs/tailwindcss/pull/16274))
19+
- Ensure Node addons are packaged correctly with FreeBSD builds ([#16277](https://github.com/tailwindlabs/tailwindcss/pull/16277))
1920

2021
## [4.0.3] - 2025-02-01
2122

0 commit comments

Comments
 (0)