Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Verify that src dir wasn't modified by build.rs when publishing #5584
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.
@alexcrichton, are we comfortable with enabling this behavior by default?
We can down tone this to a warning perhaps? I personally am fine with a hard error.
added a commit
this pull request
May 29, 2018
May 29, 2018
referenced this pull request
Jul 31, 2018
@lu-zero build scripts should place the files they create in the OUT_DIR: https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation
@lu-zero try using setup which is described in bindgen’s docs:
There’s also —no-verify flag which you can use to suppress this check. I would advise against using it, if possible: mutating sources during the build will make lives of consumers of your library harder.
What is suggested does not seem to work at least with the bindgen 0.37.4.
#![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] include!(concat!(env!("OUT_DIR"), "/aom.rs"));
The generated file still contains:
/* automatically generated by rust-bindgen */ #![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] ...
The result is :