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

Compile stuck forever with --release and 1.72: yash-syntax #115297

Closed
kpcyrd opened this issue Aug 27, 2023 · 5 comments
Closed

Compile stuck forever with --release and 1.72: yash-syntax #115297

kpcyrd opened this issue Aug 27, 2023 · 5 comments
Labels
C-bug Category: This is a bug. I-compiletime Issue: Problems and improvements with respect to compile times. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@kpcyrd
Copy link

kpcyrd commented Aug 27, 2023

I found a possible regression in rustc with a crate that builds with Rust 1.71.1, but does not build anymore with the latest 1.72.0 (the compiler seems stuck indefinitely).

This broke the build of my project (which has yash-syntax as a dependency). The problem does not seem to be present anymore with the latest 1.73.0 beta.

This only seems to happen with cargo build --release, the crate still builds with cargo build.

This could be related to "Const evaluation time is now unlimited" from the Rust 1.72.0 release announcement.

The git checkout f7db5e61d24c9f79cf0fac532a47a7c12272cab1 line is currently optional (since that's the latest commit on the master branch), it's only there for posterity.

This works (1.71.1)

podman run -it --rm rust:1.71.1 sh -c '
git clone https://github.com/magicant/yash-rs
cd yash-rs
git checkout f7db5e61d24c9f79cf0fac532a47a7c12272cab1
cargo build --release --verbose -p yash-syntax
'

This gets stuck (1.72.0)

podman run -it --rm rust:1.72.0 sh -c '
git clone https://github.com/magicant/yash-rs
cd yash-rs
git checkout f7db5e61d24c9f79cf0fac532a47a7c12272cab1
cargo build --release --verbose -p yash-syntax
'

This works again (1.73.0-beta.2)

podman run -it --rm rust:1.72.0 sh -c '
rustup install beta
git clone https://github.com/magicant/yash-rs
cd yash-rs
git checkout f7db5e61d24c9f79cf0fac532a47a7c12272cab1
cargo +beta build --release --verbose -p yash-syntax
'

Workaround

Adding this to my Cargo.toml fixed the --release build of my project (with yash-syntax as a dependency).

[profile.release.package.yash-syntax]
opt-level = 0

Meta

rustc --version --verbose:

rustc 1.72.0 (5680fa18f 2023-08-23)
binary: rustc
commit-hash: 5680fa18feaa87f3ff04063800aec256c3d4b4be
commit-date: 2023-08-23
host: x86_64-unknown-linux-gnu
release: 1.72.0
LLVM version: 16.0.5
@kpcyrd kpcyrd added the C-bug Category: This is a bug. label Aug 27, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 27, 2023
@compiler-errors
Copy link
Member

Does your project use async? If so, then it may have been fixed by #114948.

@kpcyrd
Copy link
Author

kpcyrd commented Aug 28, 2023

Thanks for your reply, yes yash-syntax is using async.

@ZhongRuoyu
Copy link

ZhongRuoyu commented Aug 28, 2023

Thanks @kpcyrd for the report and @compiler-errors for the hint! I tried with a local Rust 1.72.0 build with cherry-picked #114948, and I can confirm that with the patched Rust build, yash-syntax can now be built normally.

@Noratrieb Noratrieb added regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. labels Aug 29, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 29, 2023
@Noratrieb Noratrieb added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 29, 2023
@pnkfelix pnkfelix added the I-compiletime Issue: Problems and improvements with respect to compile times. label Aug 31, 2023
@kadiwa4
Copy link
Contributor

kadiwa4 commented Sep 1, 2023

@rustbot label: -regression-from-stable-to-beta +regression-from-stable-to-stable
(1.72.0 is not beta)

@rustbot rustbot added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. I-prioritize Issue: Indicates that prioritization has been requested for this issue. and removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Sep 1, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 4, 2023
@kpcyrd
Copy link
Author

kpcyrd commented Sep 20, 2023

I think this was related to #113372 and is now fixed with Rust 1.72.1

@kpcyrd kpcyrd closed this as completed Sep 20, 2023
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. I-compiletime Issue: Problems and improvements with respect to compile times. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants