Skip to content

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

Closed
@monax3

Description

@monax3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions