ohos: add aarch64-unknown-linux-ohos support (fsext/hostid/date) - #14288
ohos: add aarch64-unknown-linux-ohos support (fsext/hostid/date)#14288YodonTan wants to merge 1 commit into
Conversation
|
These changes functionally conflict with #14252, so care should be taken when merging. |
so how can I deal with it. |
|
#14252 completely disables the |
I think it's ok to just disable utmpx on ohos, so I think I can just roll back changes about utmpx? |
|
GNU testsuite comparison: |
|
I just disabled |
|
may be I should not add Cargo.lock into the Project? |
|
The lock file already exists in the repository so you need to fix it. The most minimal way is |
Fixes required to build uutils/coreutils on HarmonyOS (aarch64-unknown-linux-ohos): - uucore/fsext: statfs.f_type is u64 on OHOS; route it through the musl branch. - hostid: implement gethostid locally (read /etc/hostid, else hash hostname) because the OHOS SDK libc dropped the symbol. - date: pass through the system time zone ID from OH_TimeService_GetTimeZone and resolve it with embedded IANA tzdata (jiff-tzdb) via TimeZone::tzif, instead of relying on /etc/localtime or a POSIX-injected TZ. The OHOS-only helper is cfg-gated; non-OHOS code paths are byte-identical to upstream. utmpx is intentionally left untouched: upstream uutils#14252 disables it on OHOS (no utmp data source there), and this PR defers to that approach. Also syncs fuzz/Cargo.lock after adding the jiff-tzdb dependency. Verified on-device: date matches system time (+0800 CST; 1987-06-01 -> +0900 CDT), hostid behaves, builds pass on the non-utmpx feature set.
|
The
I believe these are environment-related and not caused by this PR:
I can't re-run the job myself (needs repo admin rights). Could a maintainer re-run the failed |
Add aarch64-unknown-linux-ohos (HarmonyOS) support
Closes #14287
Minimal patch set to build uutils/coreutils natively on HarmonyOS (
aarch64-unknown-linux-ohos), verified on a HarmonyOS PC (kernel HongMeng 1.13.0, aarch64). All changes are#[cfg(target_env = "ohos")]-gated; non-OHOS code paths are untouched (muslallow(deprecated)attributes and glibc/musl branch behavior preserved).This revision:
cargo fetchinfuzz/) to fix the CI--lockedfailure (Dependencies / MinRustV jobs).Changes
src/uucore/src/lib/features/fsext.rsstatfs.f_typeisu64on OHOS (musl-like libc) → E0308try_into().unwrap()branchsrc/uu/hostid/src/hostid.rsgethostidnot exported by OHOS SDK libc/etc/hostid, else FNV-1a hostname hash (glibc semantics)src/uu/date/src/date.rstry_system()reads/etc/localtime/zoneinfo (absent on OHOS) → always UTCohos_system_zone(): pass through the system time zone ID fromOH_TimeService_GetTimeZone, resolve via embedded IANA tzdata (jiff-tzdb) withTimeZone::tzif, preserving DST rules/history. Call sitescfg-gated; non-OHOS paths byte-identical to upstream.src/uu/date/Cargo.toml[target.'cfg(target_env = "ohos")'.dependencies] jiff-tzdb = "0.1"(OHOS-only)Cargo.lock/fuzz/Cargo.lock+ jiff-tzdb; fuzz lock synced viacargo fetchBuild
Standard upstream flow (unix default
feat_os_unix; utmpx commands excluded on OHOS per #14252):Verification (on-device)
date "+%F %T %z %Z"matches system time:+0800 CSTdate -d 1987-06-01 "+%z %Z"→+0900 CDT(tzdata DST-era rule active; China DST 1986-1991)hostid/b2sum/arch/numfmtwork; builds pass on the non-utmpx feature setKnown limits (runtime degradation, documented in #14287)
cp --preserve: sandbox restricts xattr/timestamp writesFork:
YodonTan/coreutils, branchohos-pr. Happy to add anaarch64-unknown-linux-ohosCI workflow mirroringandroid.yml/freebsd.ymlif maintainers are interested.