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

windows-gen build script loops forever if OUT_DIR does not have a Cargo.toml in its tree #953

Closed
monax3 opened this issue Jul 7, 2021 · 2 comments

Comments

@monax3
Copy link

monax3 commented Jul 7, 2021

If you set the Cargo target-dir to somewhere other than a sub directory of the project this snippet will never complete:

let mut destination: ::std::path::PathBuf = ::std::env::var("OUT_DIR")
.expect("No `OUT_DIR` env var")
.into();
loop {
destination.pop();
destination.push("Cargo.toml");
if destination.exists() {
destination.pop();
destination.push("target");
destination.push(".windows");
destination.push("winmd");
break;
}
destination.pop();
}

Presumably other stuff would fail too since the expected directory structure isn't there.

@kennykerr
Copy link
Collaborator

I'm working on this. The trouble is that there's no reliable way to find the target directory.

rust-lang/docs.rs#1444 (comment)

rust-lang/cargo#9661

This didn't work: #951

@kennykerr
Copy link
Collaborator

This should be fixed as of 0.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants