-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feat(oxide): add OpenHarmony (aarch64-unknown-linux-ohos) prebuilt binary support #20276
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
52c23df
351004e
a2f8f44
7384552
ac52bfe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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@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 --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| - 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 | ||
|
|
@@ -212,6 +267,7 @@ jobs: | |
| needs: | ||
| - build | ||
| - build-freebsd | ||
| - build-ohos | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
|
|
@@ -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/ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This copy puts the OHOS build output into |
||
|
|
||
| - name: 'Version based on commit: ${{ env.INSIDERS_VERSION }}' | ||
| if: env.RELEASE_KIND == 'insiders' | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||
| name: Test OHOS build | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [feat/ohos-support] | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
| env: | ||||||
| NODE_VERSION: 24 | ||||||
| PNPM_VERSION: '9.6.0' | ||||||
| OXIDE_LOCATION: ./crates/node | ||||||
|
|
||||||
| jobs: | ||||||
| build-ohos: | ||||||
| name: Build aarch64-unknown-linux-ohos (oxide) | ||||||
| runs-on: ubuntu-latest | ||||||
| timeout-minutes: 15 | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
|
||||||
| - uses: pnpm/action-setup@v4 | ||||||
| with: | ||||||
| version: ${{ env.PNPM_VERSION }} | ||||||
|
|
||||||
| - name: Use Node.js ${{ env.NODE_VERSION }} | ||||||
| uses: actions/setup-node@v4 | ||||||
| with: | ||||||
| node-version: ${{ env.NODE_VERSION }} | ||||||
|
|
||||||
| - name: Install Rust | ||||||
| uses: dtolnay/rust-toolchain@stable | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win Pin actions to commit SHAs and disable credential persistence.
🔒 Proposed fix- - uses: actions/checkout@v4
+ - uses: actions/checkout@<commit-sha> # v4
+ with:
+ persist-credentials: falseApply the same SHA pinning to lines 21, 26, and 31. 🧰 Tools🪛 zizmor (1.26.1)[warning] 19-19: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 19-19: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 21-21: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 26-26: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 31-31: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||
|
|
||||||
| - 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 --ignore-scripts --frozen-lockfile --filter=!./playgrounds/* | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Remove In this repo's setup, Bun relies on lifecycle scripts during installation, so 🔧 Proposed fix- run: pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/*
+ run: pnpm install --frozen-lockfile --filter=!./playgrounds/*Based on learnings: do not run 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Learnings |
||||||
|
|
||||||
| - 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: List artifacts | ||||||
| run: ls -lh ${{ env.OXIDE_LOCATION }}/*.node | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "name": "@tailwindcss/oxide-openharmony-arm64", | ||
| "version": "4.3.1", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "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" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| "targets": [ | ||
| "armv7-linux-androideabi", | ||
| "aarch64-linux-android", | ||
| "aarch64-unknown-linux-ohos", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This relies on the generated loader mapping |
||
| "aarch64-apple-darwin", | ||
| "aarch64-unknown-linux-gnu", | ||
| "aarch64-unknown-linux-musl", | ||
|
|
@@ -60,6 +61,7 @@ | |
| }, | ||
| "optionalDependencies": { | ||
| "@tailwindcss/oxide-android-arm64": "workspace:*", | ||
| "@tailwindcss/oxide-openharmony-arm64": "workspace:*", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This adds a new workspace optional dependency, but the PR does not include a matching |
||
| "@tailwindcss/oxide-darwin-arm64": "workspace:*", | ||
| "@tailwindcss/oxide-darwin-x64": "workspace:*", | ||
| "@tailwindcss/oxide-freebsd-x64": "workspace:*", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.