Skip to content
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

GNU Hurd compilation failure: expected SystemTime, found timespec #123032

Closed
newpavlov opened this issue Mar 25, 2024 · 10 comments · Fixed by #123057
Closed

GNU Hurd compilation failure: expected SystemTime, found timespec #123032

newpavlov opened this issue Mar 25, 2024 · 10 comments · Fixed by #123057
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@newpavlov
Copy link
Contributor

Compiling project with cargo build -Z build-std=std --target=i686-unknown-hurd-gnu --features="std" causes the following compilation error:

error[E0308]: mismatched types
   --> /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:520:29
    |
520 |         Ok(SystemTime::from(self.stat.st_mtim))
    |            ---------------- ^^^^^^^^^^^^^^^^^ expected `SystemTime`, found `timespec`
    |            |
    |            arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:585:8
    |
585 |     fn from(value: T) -> Self;
    |        ^^^^

error[E0308]: mismatched types
   --> /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:548:29
    |
548 |         Ok(SystemTime::from(self.stat.st_atim))
    |            ---------------- ^^^^^^^^^^^^^^^^^ expected `SystemTime`, found `timespec`
    |            |
    |            arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:585:8
    |
585 |     fn from(value: T) -> Self;
    |        ^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `std` (lib) due to 2 previous errors
Error: Process completed with exit code 101.

See this CI job.

@newpavlov newpavlov added the C-bug Category: This is a bug. label Mar 25, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 25, 2024
@bjorn3
Copy link
Member

bjorn3 commented Mar 25, 2024

cc target maintainer @sthibaul

@sthibaul
Copy link
Contributor

I guess horizon has the same issue?

This got broken by 408c0ea ("unix time module now return result") which dropped impl From<libc::timespec> for SystemTime

I guess the way forward is to make hurd use SystemTime::new(self.stat.st_atim.tv_sec as i64, self.stat.st_atim.tv_nsec as i64) instead.

I'm wondering if there is a way to make sure that this kind of breakage doesn't happen before a rustc release?

sthibaul added a commit to sthibaul/rust that referenced this issue Mar 25, 2024
408c0ea ("unix time module now return result") dropped the From
impl for SystemTime, breaking the hurd build (and probably the horizon
build)

Fixes rust-lang#123032
@jieyouxu jieyouxu added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 25, 2024
@workingjubilee
Copy link
Member

workingjubilee commented Mar 25, 2024

I guess horizon has the same issue?

...

I'm wondering if there is a way to make sure that this kind of breakage doesn't happen before a rustc release?

Our platform support policy is to avoid blocking PRs on whether tier 3 platforms build, because tier 3 platforms are not required to build.

@sthibaul
Copy link
Contributor

I guess horizon has the same issue?
...
I'm wondering if there is a way to make sure that this kind of breakage doesn't happen before a rustc release?

Our platform support policy is to avoid blocking PRs on whether tier 3 platforms build, because tier 3 platforms are not required to build.

Sure, I'm not saying to block PRs, but I'm wondering about somehow getting notified quickly enough to be able to react before a rustc release.

@sthibaul
Copy link
Contributor

I guess horizon has the same issue?
...
I'm wondering if there is a way to make sure that this kind of breakage doesn't happen before a rustc release?

Our platform support policy is to avoid blocking PRs on whether tier 3 platforms build, because tier 3 platforms are not required to build.

Sure, I'm not saying to block PRs, but I'm wondering about somehow getting notified quickly enough to be able to react before a rustc release.

(as in: getting the break notice from a getrandom CI build a dozen days after the merge does not look that robust)

@workingjubilee
Copy link
Member

@sthibaul Hm. Does the Rust compiler for hurd get built from a stable or beta branch of rustc? My understanding was that tier 3 targets generally used the nightly compiler in any case.

@sthibaul
Copy link
Contributor

@sthibaul Hm. Does the Rust compiler for hurd get built from a stable or beta branch of rustc? My understanding was that tier 3 targets generally used the nightly compiler in any case.

In Debian we will use the stable releases to compile all rust-needing Debian packages, as the Debian policy requires.

@workingjubilee
Copy link
Member

$ git branch --contains 408c0ea2162b9892540a5b3916ddcac7713de8c3 | rg '(stable|master|beta)'
  beta
  master

The breaking commit is not in the current 1.77 release but is in the 1.78 beta. It will not be in a stable release for another 5 weeks-ish. Would you like your PR that fixes it to be beta-nominated, so that it gets backported and is in the stable release of 1.78?

@sthibaul
Copy link
Contributor

The breaking commit is not in the current 1.77 release but is in the 1.78 beta. It will not be in a stable release for another 5 weeks-ish. Would you like your PR that fixes it to be beta-nominated, so that it gets backported and is in the stable release of 1.78?

Yes, please.

@Noratrieb
Copy link
Member

Noratrieb commented Mar 26, 2024

Sure, I'm not saying to block PRs, but I'm wondering about somehow getting notified quickly enough to be able to react before a rustc release.

I recommend you set up a daily/weekly job on your side building master to check for regressions. (#109099 may fix this)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 26, 2024
unix fs: Make hurd using explicit new rather than From

408c0ea ("unix time module now return result") dropped the From impl for SystemTime, breaking the hurd build (and probably the horizon build)

Fixes rust-lang#123032
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 26, 2024
unix fs: Make hurd using explicit new rather than From

408c0ea ("unix time module now return result") dropped the From impl for SystemTime, breaking the hurd build (and probably the horizon build)

Fixes rust-lang#123032
@bors bors closed this as completed in 7b4e507 Mar 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 27, 2024
Rollup merge of rust-lang#123057 - sthibaul:systemtime, r=jhpratt

unix fs: Make hurd using explicit new rather than From

408c0ea ("unix time module now return result") dropped the From impl for SystemTime, breaking the hurd build (and probably the horizon build)

Fixes rust-lang#123032
yunji-yunji pushed a commit to yunji-yunji/rust that referenced this issue Mar 27, 2024
408c0ea ("unix time module now return result") dropped the From
impl for SystemTime, breaking the hurd and horizon builds.

Fixes rust-lang#123032
cuviper pushed a commit to cuviper/rust that referenced this issue Apr 4, 2024
408c0ea ("unix time module now return result") dropped the From
impl for SystemTime, breaking the hurd and horizon builds.

Fixes rust-lang#123032

(cherry picked from commit 7b4e507)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants