Skip to content

Commit 37d12a5

Browse files
committed
Auto merge of #4372 - frankmcsherry:patch-1, r=alexcrichton
Modernize explanation of `build.rs` After some recent head-banging, it was explained to me that `"build.rs"` is a special file name, and that Cargo will build such a file even if you do not expect it to, for example if `Cargo.toml` contains the commented out line ``` #build = "build.rs" ``` Some experimentation lead me to the described behavior, but if it misses any subtle details please feel free to correct. The old text is incorrect, though.
2 parents 7ed2a8b + b2c597a commit 37d12a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/build-script.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ build = "build.rs"
1818

1919
The Rust file designated by the `build` command (relative to the package root)
2020
will be compiled and invoked before anything else is compiled in the package,
21-
allowing your Rust code to depend on the built or generated artifacts. Note
22-
that there is no default value for `build`, it must be explicitly specified if
23-
required.
21+
allowing your Rust code to depend on the built or generated artifacts. Note that
22+
if you do not specify a value for `build` but your package root does contains a
23+
`"build.rs"` file, Cargo will compile and invoke this file for you.
2424

2525
Some example use cases of the build command are:
2626

0 commit comments

Comments
 (0)