Replies: 7 comments
-
Are your sure it is actually CMake that hangs? I've recently been experimenting on integrating a workaround for #413 into corrosion until it is fixed upstream, and have noticed hangs for the following dead simple program (only tested on mac): // use std::ffi::OsString;
use std::process::Command;
fn main() {
// let args = std::env::args_os()
// .chain([OsString::from("--target=abcdefg")]);
let mut handle = Command::new("echo")
// .args(args)
.spawn()
.expect("Failed to spawn");
handle.wait().expect("Command wasn't running");
} I get the following output:
The hang happens between "Running" which is printed immediately and the output of "echo" which can take seconds to appear, even though compilation has already finished!. |
Beta Was this translation helpful? Give feedback.
-
Note that I used to have hangs as well when using vscode + CMake, but since disabling sccache i haven't observed them again. So I think it is somehow related to having sccache enabled. |
Beta Was this translation helpful? Give feedback.
-
I think you are right that this only shows up with sccache. When the build hangs, neither rustc nor cargo processes are running. I don't know if Corrosion, CMake, or sccache are the problem; my guess is the bug is in sccache. |
Beta Was this translation helpful? Give feedback.
-
Potentially related: I have never encountered this using sccache with Cargo alone (not using CMake + Corrosion). |
Beta Was this translation helpful? Give feedback.
-
I'm a bit skeptical that this is related to corrosion. Corrosion / CMake does all its work at configure time. At build time the Generator (in your case ninja) invokes the build rules (e.g.
|
Beta Was this translation helpful? Give feedback.
-
I migrated the issue to a discussion, since I believe this to not be a Corrosion issue. However, if you find out more information, please do post here, since any findings will likely also be valuable for other users. |
Beta Was this translation helpful? Give feedback.
-
I ran into this issue here, and debugged it a bit: mozilla/sccache#2145 |
Beta Was this translation helpful? Give feedback.
-
Current Behavior
CMake sometimes hangs indefinitely after Cargo finishes building a crate.
Expected Behavior
CMake proceeds after Cargo finishes building a crate.
Steps To Reproduce
cmake -S . -B build -G Ninja
cmake --build build
This is not reproducible every time; it only happens occasionally. Terminating CMake with Ctrl + C then rerunning CMake works around the problem. This has been happening for a while across multiple versions of Rust, CMake, and Corrosion.
Environment
CMake configure log with Debug log-level
No response
CMake Build step log
Beta Was this translation helpful? Give feedback.
All reactions