Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo udeps doesn't work with opencv-rs with clang-runtime #102

Open
PPakalns opened this issue Oct 12, 2021 · 1 comment
Open

cargo udeps doesn't work with opencv-rs with clang-runtime #102

PPakalns opened this issue Oct 12, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@PPakalns
Copy link

Fails with the following error:

  error: Found argument 'build' which wasn't expected, or isn't valid in this context

  USAGE:
      cargo <SUBCOMMAND>

  For more information try --help

The command that cargo udeps can not process is run during build.rs in opencv-rs crate:
https://github.com/twistedfall/opencv-rust/blob/e9093f47b079f684de2c90be0f1adfbcd29447bc/build.rs#L266

let cargo_bin = PathBuf::from(env::var_os("CARGO").unwrap_or_else(|| "cargo".into()));
let mut cargo = Command::new(cargo_bin);
// generator script is quite slow in debug mode, so we force it to be built in release mode
cargo.args(&["build", "--release", "--package", "opencv-binding-generator", "--bin", "binding-generator"])
	.env("CARGO_TARGET_DIR", &*OUT_DIR);
if let Some(host_triple) = HOST_TRIPLE.as_ref() {
	cargo.args(&["--target", host_triple]);
}
println!("running: {:?}", &cargo);
Some(cargo.spawn()?)

Should this be fixed on opencv-rs side? What is the problem?

@PPakalns PPakalns changed the title cargo udeps doesn't work with opencv-rs cargo udeps doesn't work with opencv-rs with clang-runtime Oct 12, 2021
@est31
Copy link
Owner

est31 commented Oct 12, 2021

This is basically the same problem as #97 is. The build script attempts to invoke cargo-udeps like it would invoke cargo, with a build command. cargo-udeps is unfamiliar with it though.

@est31 est31 added the bug Something isn't working label Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants