`third-party-licenses` fails on Windows when the parent process is PowerShell
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- powershell, rust
- Área
- build-system, tooling
Línea de trabajo
Empieza en tools/third-party-licenses/src/cargo.rs, especialmente en run(), y sigue cómo invoca a cargo about y analiza la salida. Ejecuta el comando de reproducción desde PowerShell; se considera terminado cuando el JSON de licencias se lee correctamente y la herramienta funciona correctamente cuando PowerShell es un proceso antecesor.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
tools/third-party-licenses runs cargo about generate --format json --locked and parses stdout. On Windows, if PowerShell appears anywhere in the parent process chain, cargo-about refuses to write JSON to stdout and exits with an error telling you to use -o / --output-file.
That breaks cargo run desktop (and any CI/agent that launches the build from PowerShell), even though cargo-about itself is installed and works when given an output file.
Environment
- OS: Windows 10/11
- Shell: PowerShell 5.1 / PowerShell 7 (also fails when an ancestor is PowerShell, e.g. Cursor/VS Code terminal,
cargo-runspawned from pwsh) cargo-about0.9.x (behavior from EmbarkStudios/cargo-about#198 / PR that addedis_powershell_parent())
Steps to reproduce
- On Windows, open PowerShell in a Graphite checkout.
- Ensure
cargo-aboutis onPATH. - Run:
cargo run -p third-party-licenses --features desktop
(or the same step via cargo run desktop)
Expected
License JSON is generated and the tool succeeds.
Actual
cargo about generate fails roughly with:
cargo-about should not redirect its output in powershell
(or similar wording pointing at -o, --output-file). Redirecting/piping from the Graphite side does not help: the check walks ancestor processes, so Command::output() capturing stdout is enough to trigger it whenever PowerShell is an ancestor.
Root cause
Current code in tools/third-party-licenses/src/cargo.rs (run()):
Command::new("cargo")
.args(["about", "generate", "--format", "json", "--locked"])
// … reads output.stdout
cargo-about intentionally blocks stdout under PowerShell (UTF-16 / encoding footgun). The supported API is writing to a file with -o.
Suggested fix
Write to a temp file with -o, then read and parse that file (delete afterward). Minimal patch:
fn run() -> Result<Output, Error> {
let out_path = std::env::temp_dir().join(format!("graphite-about-{}.json", std::process::id()));
let output = Command::new("cargo")
.args([
"about",
"generate",
"--format",
"json",
"--locked",
"-o",
out_path.to_str().ok_or_else(|| Error::Command("about output path is not UTF-8".into()))?,
])
.current_dir(env!("CARGO_WORKSPACE_DIR"))
.output()
.map_err(|e| Error::Io(e, "Failed to run cargo about generate".into()))?;
if !output.status.success() {
let _ = std::fs::remove_file(&out_path);
return Err(Error::Command(format!(
"cargo about generate failed:\n{}",
String::from_utf8_lossy(&output.stderr)
)));
}
let json = std::fs::read_to_string(&out_path).map_err(|e| Error::Io(e, format!("reading {}", out_path.display())))?;
let _ = std::fs::remove_file(&out_path);
serde_json::from_str(&json).map_err(|e| Error::Json(e, "Failed to parse cargo about generate JSON".into()))
}
This is also slightly more robust on non-Windows hosts (no reliance on capturing a large JSON blob from a pipe).
Workaround (today)
# Skip the failing step and continue the desktop bundle, or invoke about with -o manually:
cargo about generate --format json --locked -o $env:TEMP\about.json
References
- EmbarkStudios/cargo-about#198 (PowerShell / stdout encoding; led to rejecting stdout under PowerShell)
- Graphite call site:
tools/third-party-licenses/src/cargo.rs→run() - Invoked from desktop flow:
cargo run desktop→third-party-licenseswith--features desktop
- Lenguaje dominante
- Rust
- Estrellas
- 27.6k
- Forks
- 1.3k
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 145
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de GraphiteEditor/Graphite
-
Resizing a text box by one edge handle incorrectly locks both Max Width and Max Height, silently clipping textPosiblemente ocupada @GuTS805 la tomó hace 69 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
GraphiteEditor/Graphite#4396 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Type hint is selected in node graph viewQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
GraphiteEditor/Graphite#4311 ·
Los mantenedores suelen responder en 1 día
-
`cargo run` fails on WebAssembly target due to `CARGO_BUILD_TARGET` leaking into `rustc_codegen_spirv` buildQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
GraphiteEditor/Graphite#3939 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Self-hosting?Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
GraphiteEditor/Graphite#4755 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
GraphiteEditor/Graphite#4752 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de GraphiteEditor/Graphite
Issues similares
-
documentation P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
bug good first issue priority:high
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Konfirm-xyz/konfirm-contracts#163 ·
Los mantenedores suelen responder en 1 día
-
area:gc-repack-output bug factory:dogfood factory:triaged priority:p3 type:bug type:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
gitbutlerapp/grit#1161 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
feature performance
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
lance-format/lance#10137 ·
Los mantenedores suelen responder en 2 días