Skip to content

Commit 44e6787

Browse files
authored
Merge pull request #234 from CenTdemeern1/fix-ctru-sys-build-script
Don't use pacman to detect and track libctru
2 parents 999dd61 + 264947a commit 44e6787

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

ctru-sys/build.rs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fn main() {
3131
println!("cargo:rerun-if-changed=build.rs");
3232
println!("cargo:rerun-if-env-changed=DEVKITPRO");
3333
println!("cargo:rustc-link-search=native={devkitpro}/libctru/lib");
34+
println!("cargo:rerun-if-changed={devkitpro}/libctru");
3435

3536
// https://github.com/rust3ds/cargo-3ds/issues/14#issuecomment-1783991872
3637
// To link properly, this must be the same as the library linked by cargo-3ds when building
@@ -215,10 +216,6 @@ fn detect_and_track_libctru() {
215216
}
216217
Err(err) => println!("cargo:warning=unknown libctru version: {err}"),
217218
}
218-
219-
if let Err(err) = track_libctru_files(&pacman) {
220-
println!("cargo:warning=unable to track `libctru` files for changes: {err}");
221-
}
222219
}
223220

224221
fn get_libctru_version(pacman: &Path) -> Result<(String, String, String, String), Box<dyn Error>> {
@@ -246,33 +243,6 @@ fn parse_libctru_version(version: &str) -> Result<(String, String, String, Strin
246243
.ok_or_else(|| format!("unexpected number of version segments: {version:?}"))
247244
}
248245

249-
fn track_libctru_files(pacman: &Path) -> Result<(), String> {
250-
let stdout = match Command::new(pacman)
251-
.args(["--query", "--list", "libctru"])
252-
.stderr(Stdio::inherit())
253-
.output()
254-
{
255-
Ok(Output { stdout, status, .. }) if status.success() => stdout,
256-
Ok(Output { status, .. }) => {
257-
return Err(format!("pacman query failed with status {status}"));
258-
}
259-
Err(err) => {
260-
return Err(format!("pacman query failed: {err}"));
261-
}
262-
};
263-
264-
for line in String::from_utf8_lossy(&stdout).lines() {
265-
let Some((_pkg, file)) = line.split_once(char::is_whitespace) else {
266-
println!("cargo:warning=unexpected line from pacman query: {line:?}");
267-
continue;
268-
};
269-
270-
println!("cargo:rerun-if-changed={file}");
271-
}
272-
273-
Ok(())
274-
}
275-
276246
#[cfg(feature = "layout-tests")]
277247
fn generate_layout_tests(
278248
output_file: &Path,

0 commit comments

Comments
 (0)