Skip to content

Commit

Permalink
servo: Merge #7936 - Fix spurious rebuilds of the script crate (from …
Browse files Browse the repository at this point in the history
…alexcrichton:script-rebuild); r=jdm

The script crate currently has a build script, and Cargo will consider all files
in the script crate as inputs to the build script as it otherwise doesn't know
[what the input files are][cargo-1162]. This means that if any file in the
source tree of the script crate changes (or is created) then Cargo will think it
needs to re-run the build script and rebuild the crate.

[cargo-1162]: rust-lang/cargo#1162

The build script of the script crate is invoking python, and consequently Python
is generating some bytecode files in the source tree. On the second build of
Servo, Cargo will see these new files, think that something has changed, and
will re-run the build script of the script crate.

This change passes the `-B` flag to python to avoid generating these bytecode
files, which should avoid tampering with the source tree and appease Cargo by
ensuring that it doesn't get rebuilt.

---

As a helpful tip to if this comes up again, this was discovered by using the
changes in rust-lang/cargoc447e9d plus the change in rust-lang/cargo#2044. Once
`RUST_LOG` was set to `cargo::ops::cargo_rustc::fingerprint=info`, the second
run of `./mach build` printed out:

```
precalculated components have changed:
  1444364448.000000000s (/build/servo/components/script/dom/bindings/codegen/parser/WebIDL.pyc) !=
  1444364235.000000000s (/build/servo/components/script/document_loader.rs)
```

Which should help easily diagnose these kinds of problems in the future!

Source-Repo: https://github.com/servo/servo
Source-Revision: bc5444067f7614ab7e3c83d8e131800d0db817b2

UltraBlame original commit: 2ce25f1cba4b757bbbd0a09e9b0dc22a187eefa7
  • Loading branch information
marco-c committed Oct 1, 2019
1 parent 623cfa6 commit 4f2e5aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions servo/components/script/makefile.cargo
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ null
echo
python
)
-
B
BINDINGS_SRC
=
(
Expand Down

0 comments on commit 4f2e5aa

Please sign in to comment.