Implement interrupt handling for long-running commands and archive extraction

- Added an `interrupts` module to manage Ctrl-C signals and propagate them to child processes.
- Refactored archive extraction functions to check for interrupts and handle them gracefully.
- Introduced `copy_interruptibly` function to allow for interruptible copying of data.
- Updated various source files to utilize the new interrupt handling functions, ensuring that commands and archive extractions can be interrupted by the user.
- Added tests to verify the interrupt functionality during copying and tar extraction.
- Introduced a new Meson option for generating HTML CLI documentation.
- Enhanced the `PackageSpec` struct to support additional Rust LTO flags.
This commit is contained in:
2026-03-15 14:48:01 -05:00
parent 108c989695
commit a774c61e5a
23 changed files with 1117 additions and 145 deletions
+6 -9
View File
@@ -273,8 +273,7 @@ fn build_wheel_setup_py(
.arg(dist_dir);
crate::builder::prepare_tool_command(&mut cmd, &env_vars.to_vec());
let status = cmd
.status()
let status = crate::interrupts::command_status(&mut cmd)
.with_context(|| format!("Failed to run setup.py in {}", src_dir.display()))?;
if !status.success() {
bail!("setup.py bdist_wheel failed with status {}", status);
@@ -315,25 +314,23 @@ fn build_wheel_pep517(
);
crate::builder::prepare_command(&mut cmd, &build_env);
let output = cmd.output().with_context(|| {
let status = crate::interrupts::command_status(&mut cmd).with_context(|| {
format!(
"Failed to run python3 for PEP 517 build in {}",
src_dir.display()
)
})?;
if !output.status.success() {
let stderr = String::from_utf8_lossy(&output.stderr);
if !status.success() {
let requires = if cfg.requires.is_empty() {
"(none declared)".to_string()
} else {
cfg.requires.join(", ")
};
bail!(
"PEP 517 wheel build failed with status {}. Backend: {}. Declared build requirements: {}. stderr: {}",
output.status,
"PEP 517 wheel build failed with status {}. Backend: {}. Declared build requirements: {}",
status,
cfg.backend,
requires,
stderr.trim()
requires
);
}