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

Panic if RC.exe fails #6

Closed
gabdube opened this issue Aug 10, 2017 · 2 comments
Closed

Panic if RC.exe fails #6

gabdube opened this issue Aug 10, 2017 · 2 comments

Comments

@gabdube
Copy link

gabdube commented Aug 10, 2017

If the linked .rc file is not valid, RC.exe will choke on it but cargo will continue the build. The result is an error like this one:

LINK : fatal error LNK1181: cannot open input file 'versioninfo.lib'

In my case, the true error is this:

image

Panicking if the exitcode not 0 perhaps? Here's what the code could look like:

let result = Command::new(find_windows_sdk_rc_exe().as_ref().map_or(Path::new("rc.exe"), Path::new))
        .args(&["/fo", &format!("{}/{}.lib", out_dir, prefix), resource])
        .status()
        .expect("Are you sure you have RC.EXE in your $PATH?");
if !result.success() {
 panic!("RC.exe did not exit successfully")
}
@nabijaczleweli
Copy link
Owner

That's a nice improvement and a great codewise suggestion, thanks!

@nabijaczleweli
Copy link
Owner

Released in v1.1.4.

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

No branches or pull requests

2 participants