Skip to content

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

Closed
@kpcyrd

Description

@kpcyrd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions