Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,61 @@ jobs:
name: bindings-x86_64-unknown-freebsd
path: ${{ env.OXIDE_LOCATION }}/*.node

build-ohos:
name: Build aarch64-unknown-linux-ohos (oxide)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6
with:
version: ${{ env.PNPM_VERSION }}

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: ${{ env.NODE_VERSION }}
package-manager-cache: false

- name: Install Rust
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # stable

- name: Setup rust target
run: rustup target add aarch64-unknown-linux-ohos

- name: Setup OpenHarmony SDK
uses: Boshen/setup-ohos-sdk@edb865a89a712f1f15dbad932dfa9cfce849d95c # v1.0.0

- name: Configure OHOS linker
run: |
echo "${OHOS_SDK_NATIVE}/llvm/bin" >> $GITHUB_PATH
cat > /tmp/aarch64-linux-ohos-clang <<'WRAPPER'
#!/bin/sh
exec ${OHOS_SDK_NATIVE}/llvm/bin/clang --target=aarch64-linux-ohos "$@"
WRAPPER
chmod +x /tmp/aarch64-linux-ohos-clang

- name: Install dependencies
run: pnpm install --frozen-lockfile --filter=!./playgrounds/*
Comment on lines +238 to +239

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 All other build jobs (main matrix and FreeBSD) pass --ignore-scripts here. Without it, lifecycle scripts from dependencies can execute on the host runner before the cross-compiled native binary exists, which can break the install step or load a wrong-architecture binary.

Suggested change
- name: Install dependencies
run: pnpm install --frozen-lockfile --filter=!./playgrounds/*
- name: Install dependencies
run: pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/*

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


- name: Build release
run: pnpm run --filter ${{ env.OXIDE_LOCATION }} build:platform --target=aarch64-unknown-linux-ohos
env:
RUST_TARGET: aarch64-unknown-linux-ohos
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_LINKER: /tmp/aarch64-linux-ohos-clang
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_RUSTFLAGS: -C link-arg=-fuse-ld=lld -C link-arg=-lm

- name: Strip debug symbols
run: ${OHOS_SDK_NATIVE}/llvm/bin/llvm-strip ${{ env.OXIDE_LOCATION }}/*.node

- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: bindings-aarch64-unknown-linux-ohos
path: ${{ env.OXIDE_LOCATION }}/*.node

release:
runs-on: macos-14
timeout-minutes: 15
Expand All @@ -212,6 +267,7 @@ jobs:
needs:
- build
- build-freebsd
- build-ohos

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand Down Expand Up @@ -277,6 +333,7 @@ jobs:
cp bindings-x86_64-unknown-linux-gnu/* ./npm/linux-x64-gnu/
cp bindings-x86_64-unknown-linux-musl/* ./npm/linux-x64-musl/
cp bindings-x86_64-unknown-freebsd/* ./npm/freebsd-x64/
cp bindings-aarch64-unknown-linux-ohos/* ./npm/openharmony-arm64/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Rename OHOS artifact

This copy puts the OHOS build output into npm/openharmony-arm64/ without changing the filename. The package declares tailwindcss-oxide.openharmony-arm64.node as its entry point, while the napi build --platform --target=aarch64-unknown-linux-ohos output is target-derived. If that output keeps the OHOS target name, the published package can contain a .node file that does not match its main, so require('@tailwindcss/oxide-openharmony-arm64') fails with MODULE_NOT_FOUND even though the package installed successfully. Please rename the copied artifact to the filename declared by the platform package, or update the package metadata to match the actual build output.


- name: 'Version based on commit: ${{ env.INSIDERS_VERSION }}'
if: env.RELEASE_KIND == 'insiders'
Expand Down
27 changes: 27 additions & 0 deletions crates/node/npm/openharmony-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@tailwindcss/oxide-openharmony-arm64",
"version": "4.3.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Sync package version
This new native package is picked up by the recursive publish step, but it is not in the hardcoded oxide package list that the release workflow versions before publishing. On the next release or insiders publish, this package can stay at 4.3.1 while @tailwindcss/oxide points at the new release version. The publish can then fail because 4.3.1 already exists, or OpenHarmony users can get a platform package whose version no longer matches the parent optional dependency set. Please add crates/node/npm/openharmony-arm64 to the same version sync list as the other native packages.

"repository": {
"type": "git",
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
"directory": "crates/node/npm/openharmony-arm64"
},
"os": [
"openharmony"
],
"cpu": [
"arm64"
],
"main": "tailwindcss-oxide.openharmony-arm64.node",
"files": [
"tailwindcss-oxide.openharmony-arm64.node"
],
"publishConfig": {
"provenance": true,
"access": "public"
},
"license": "MIT",
"engines": {
"node": ">= 20"
}
}
2 changes: 2 additions & 0 deletions crates/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"targets": [
"armv7-linux-androideabi",
"aarch64-linux-android",
"aarch64-unknown-linux-ohos",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Generated Loader Can Miss OHOS

This relies on the generated loader mapping aarch64-unknown-linux-ohos to the openharmony-arm64 package at publish time, but no checked-in loader change or release-step verification pins that behavior here. If the generator does not emit an openharmony branch for the runtime platform, OpenHarmony installs can receive the new optional package but still try the wrong native package or report that no native binary is available.

"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
Expand Down Expand Up @@ -60,6 +61,7 @@
},
"optionalDependencies": {
"@tailwindcss/oxide-android-arm64": "workspace:*",
"@tailwindcss/oxide-openharmony-arm64": "workspace:*",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Frozen Lockfile Install Fails

This adds a new workspace optional dependency, but the PR does not include a matching pnpm-lock.yaml update. The new OHOS workflow runs pnpm install --ignore-scripts --frozen-lockfile, so release builds can stop at install time before the native package is built or published.

"@tailwindcss/oxide-darwin-arm64": "workspace:*",
"@tailwindcss/oxide-darwin-x64": "workspace:*",
"@tailwindcss/oxide-freebsd-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.

1 change: 1 addition & 0 deletions scripts/version-packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const syncedWorkspaces = new Map([
'crates/node/npm/linux-arm64-musl',
'crates/node/npm/linux-x64-gnu',
'crates/node/npm/linux-x64-musl',
'crates/node/npm/openharmony-arm64',
'crates/node/npm/wasm32-wasi',
'crates/node/npm/win32-arm64-msvc',
'crates/node/npm/win32-x64-msvc',
Expand Down