feat: add support for loong64 arch and openharmony platform#56
Conversation
🦋 Changeset detectedLatest commit: 3ba2f42 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds OpenHarmony platform and LoongArch (loong64) support across types, triple parsing, and native-target resolution; normalizes subsystem ABIs (android/ohos) during parseTriple; Windows x64 resolution can return multiple candidates (MINGW → GNU then MSVC); Linux loong64 splits musl/gnu. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Parser as parseTriple
participant Subsys as Subsystem Normalizer
participant Resolver as getNapiNativeTarget
participant Env as OS/Env
Client->>Parser: parseTriple(rawTriple)
Parser->>Subsys: check abi in {android, ohos}
alt abi is subsystem
Note over Subsys: promote abi -> platform\nset abi = null
else
Note over Subsys: keep abi/platform
end
Parser-->>Client: normalized {platform, arch, abi}
Client->>Resolver: resolve targets(platform, arch)
alt platform == win32 and arch == x64
Env-->>Resolver: detect shell (MINGW?)
alt MINGW
Resolver-->>Client: ["win32-x64-gnu", "win32-x64-msvc"]
else
Resolver-->>Client: ["win32-x64-msvc"]
end
else platform == linux and arch == loong64
Env-->>Resolver: isMusl()?
alt musl
Resolver-->>Client: ["linux-loong64-musl"]
else
Resolver-->>Client: ["linux-loong64-gnu"]
end
else platform == openharmony
Resolver-->>Client: ["openharmony-arm", "openharmony-arm64", "openharmony-x64"]
else
Resolver-->>Client: [existing targets]
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
1 similar comment
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
==========================================
- Coverage 39.74% 38.79% -0.96%
==========================================
Files 7 7
Lines 712 745 +33
Branches 69 70 +1
==========================================
+ Hits 283 289 +6
- Misses 429 456 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 7f9959f in 56 seconds. Click for details.
- Reviewed
176lines of code in3files - Skipped
0files when reviewing. - Skipped posting
10draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/helpers.ts:7
- Draft comment:
Added 'Platform' type to the import for type consistency. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. src/helpers.ts:175
- Draft comment:
Casting process.platform as Platform ensures support for extended platform values. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. src/helpers.ts:187
- Draft comment:
Win32 branch now returns an array including 'win32-x64-gnu' for MINGW systems. Consider checking if process.report.getReport() exists to avoid runtime errors in environments where it's unavailable. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. src/helpers.ts:236
- Draft comment:
Added loong64 architecture support; ensure that the isMusl detection works reliably on Loongarch systems. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. src/helpers.ts:270
- Draft comment:
Added openharmony platform branch; verify that the process.arch checks and returned target strings are correct for the environment. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. src/target.ts:11
- Draft comment:
Added mapping for 'loongarch64' to 'loong64' in CpuToNodeArch, ensuring consistency with the loong64 support in helpers. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. src/target.ts:21
- Draft comment:
Mapping 'ohos' to 'openharmony' in SysToNodePlatform normalizes legacy platform strings. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
8. src/target.ts:24
- Draft comment:
Including 'ohos' in the SUB_SYSTEMS set helps handle subsystem overrides in triple parsing. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
9. src/target.ts:26
- Draft comment:
Improved triple documentation formatting enhances clarity on how triples are structured. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
10. src/types.ts:3
- Draft comment:
Fixed typos in deprecation comments (e.g., 'USe' to 'Use') to improve documentation clarity. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_ElDA38yQUCT7AJkN
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
📊 Package size report 3%↑
Unchanged files
🤖 This report was automatically generated by pkg-size-action |
|
Deploy preview for napi-postinstall ready! ✅ Preview Built with commit 3ba2f42. |
size-limit report 📦
|
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Signed-off-by: JounQin <admin@1stg.me>
close #42
Important
Add support for
loong64architecture andopenharmonyplatform inhelpers.ts,target.ts, andtypes.ts.loong64architecture ingetNapiNativeTarget()inhelpers.ts.openharmonyplatform ingetNapiNativeTarget()inhelpers.ts.parseTriple()intarget.tsto handleloongarch64andohosasloong64andopenharmonyrespectively.openharmonytoPlatformtype intypes.ts.This description was created by
for 7f9959f. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
New Features
Chores