Skip to content

Conversation

@weihanglo
Copy link
Contributor

This follows the same pattern already used for AIX and Hurd targets.

On this target with musl 1.2.3+,
musl switched to POSIX timespec structs for time64 support.
Loongarch in 0.2.180 was changed accordingly.

See libc 0.2.180, which added proper time64 support for loongarch64-unknown-linux-musl with musl 1.2.3+

Found through:

On `loongarch64-unknown-linux-musl` with musl 1.2.3+, the libc `stat`
struct uses POSIX timespec fields (`st_mtim`, `st_ctim`) instead of
separate seconds and nanoseconds fields (`st_mtime`, `st_mtime_nsec`).

This was exposed by libc 0.2.180 which added proper time64 support for
this target, causing compilation failures in rust-lang/rust CI.

Fixes the same pattern already used for AIX and Hurd targets.
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot, much appreciated!

@Byron Byron linked an issue Feb 10, 2026 that may be closed by this pull request
@Byron Byron merged commit 4fe8e38 into GitoxideLabs:main Feb 10, 2026
30 checks passed
@weihanglo weihanglo deleted the fix-loongarch64-musl-stat branch February 10, 2026 07:28
@weihanglo
Copy link
Contributor Author

@Byron do you plan to cut a new release? So that I don't need to do this rust-lang/cargo#16615

Up to you. No worries :)

@Byron
Copy link
Member

Byron commented Feb 10, 2026

I released it for you @weihanglo, and for Cargo :). Hoping it works for you.

weihanglo added a commit to weihanglo/cargo that referenced this pull request Feb 10, 2026
For addressing loongarch 64bit time API issue.
See GitoxideLabs/gitoxide#2428
github-merge-queue bot pushed a commit to rust-lang/cargo that referenced this pull request Feb 10, 2026
For addressing loongarch 64bit time API issue.
See GitoxideLabs/gitoxide#2428
weihanglo added a commit to weihanglo/cargo that referenced this pull request Feb 11, 2026
Right after git-index changed accordingly via GitoxideLabs/gitoxide#2428
for the loongarch timestamp API issue,
libc reverted it back rust-lang/libc#4958 and released 0.2.181

We pin to [email protected] for now. And when gitoxide reverts,
we can safely upgrade them

# Do not modify or remove the line above.
# Everything below it will be ignored.
#
# On branch libc
# Changes to be committed:
#	modified:   Cargo.lock
#
diff --git a/Cargo.lock b/Cargo.lock
index 668d2a2..204d94e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2769,9 +2769,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"

 [[package]]
 name = "libc"
-version = "0.2.181"
+version = "0.2.180"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5"
+checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"

 [[package]]
 name = "libgit2-sys"
weihanglo added a commit to weihanglo/cargo that referenced this pull request Feb 11, 2026
Right after git-index changed accordingly via GitoxideLabs/gitoxide#2428
for the loongarch timestamp API issue,
libc reverted it back rust-lang/libc#4958 and released 0.2.181

We pin to [email protected] for now. And when gitoxide reverts,
we can safely upgrade them
@weihanglo
Copy link
Contributor Author

It is a bit annoying that rust-lang/libc#4958 libc reverted the change and released a 0.2.181 😓. We probably also want to revert. See also rust-lang/cargo#16624

No need to rush into a new release. And sorry about this 😞.

@Byron
Copy link
Member

Byron commented Feb 11, 2026

No worries, this happens and at least you will have a release if you still need one later.

github-merge-queue bot pushed a commit to rust-lang/cargo that referenced this pull request Feb 11, 2026
Right after git-index changed accordingly via GitoxideLabs/gitoxide#2428
for the loongarch timestamp API issue,
libc reverted it back rust-lang/libc#4958 and released 0.2.181

We pin to [email protected] for now. And when gitoxide reverts, we can safely
upgrade them

Previous relevnat PRs:

* #16615
* #16613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure on loongarch64: no field st_mtime on type libc::stat

2 participants