mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-17 23:58:24 +00:00
M6: i18n catalog test reads cargo metadata for the host only (#2413)
craft_fig_src() ran `cargo metadata --offline` with no platform filter. Cargo then needs every target's packages in its cache, and a cache that holds only what a host build fetched lacks iOS-only crates such as accesskit_ios, so the nightly FreeBSD job failed. Ask the same cargo for its host triple (`cargo -vV`) and pass it as `--filter-platform`.
This commit is contained in:
1 parent
4548d6c009
commit
f0a34a1221
1 file changed
+7
-2
@@ -217,8 +217,13 @@ fn importer_notes() -> BTreeSet<String> {
|
||||
/// The `src` directory of the craft-fig sources this build uses, as Cargo resolved them.
|
||||
fn craft_fig_src() -> std::path::PathBuf {
|
||||
let cargo = std::env::var("CARGO").unwrap_or_else(|_| "cargo".into());
|
||||
let out = std::process::Command::new(cargo)
|
||||
.args(["metadata", "--format-version", "1", "--offline"])
|
||||
// Unfiltered, `cargo metadata` needs every target's packages (accesskit_ios, ...) in Cargo's
|
||||
// cache, and `--offline` cannot fetch them; a build fetches only the host's. Filter to the host.
|
||||
let version = std::process::Command::new(&cargo).arg("-vV").output().unwrap();
|
||||
let version = String::from_utf8(version.stdout).unwrap();
|
||||
let host = version.lines().find_map(|l| l.strip_prefix("host: ")).expect("cargo -vV names its host");
|
||||
let out = std::process::Command::new(&cargo)
|
||||
.args(["metadata", "--format-version", "1", "--offline", "--filter-platform", host])
|
||||
.current_dir(env!("CARGO_MANIFEST_DIR"))
|
||||
.output()
|
||||
.unwrap();
|
||||
|
||||
Reference in new issue
Block a user