File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ There’s a couple of points of note here:
8686 such crate as a dependency, because there's an * implicit* invariant that
8787 sources in ` .cargo/registry ` should be immutable. ` cargo ` won't allow such
8888 scripts when packaging.
89+ * Sometimes, projects want to check in a generated file, and treat it as
90+ source code. However, in this case, the file shouldn't be generated from
91+ ` build.rs ` . Instead, have a test or similar which checks that the file
92+ precisely matches the generated version * and fails if the result doesn't
93+ match* , and run that test as part of your CI. (The test can generate a
94+ temporary file to compare to, and if you want to update the generated file,
95+ you can replace the checked-in file with that temporary file.)
8996* This script is relatively simple as it just writes out a small generated file.
9097 One could imagine that other more complex operations could take place such as
9198 generating a Rust module from a C header file or another language definition,
You can’t perform that action at this time.
0 commit comments