Skip to content

Commit fad97e3

Browse files
Avoid spurious rebuilds of servo deps
Previously we'd rebuild selectors after copying as the build script depended on the absolute path of the crate rather than a workspace-relative path. This is a Cargo bug, which is being fixed, but we'd like to have the wins sooner rather than later.
1 parent 7e9a3cd commit fad97e3

File tree

2 files changed

+5
-4
lines changed
  • collector/benchmarks
    • script-servo-2/components/selectors
    • style-servo/components/selectors

2 files changed

+5
-4
lines changed

collector/benchmarks/script-servo-2/components/selectors/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ fn main() {
2424
set.build(),
2525
)
2626
.unwrap();
27+
println!("cargo:rerun-if-changed=build.rs");
2728
}
2829

2930
/// <https://html.spec.whatwg.org/multipage/#selectors>

collector/benchmarks/style-servo/components/selectors/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ use std::io::{BufWriter, Write};
1010
use std::path::Path;
1111

1212
fn main() {
13-
let path = Path::new(&env::var("OUT_DIR").unwrap())
14-
.join("ascii_case_insensitive_html_attributes.rs");
13+
let path =
14+
Path::new(&env::var("OUT_DIR").unwrap()).join("ascii_case_insensitive_html_attributes.rs");
1515
let mut file = BufWriter::new(File::create(&path).unwrap());
1616

17-
write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ",
18-
).unwrap();
17+
write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ",).unwrap();
1918
let mut set = phf_codegen::Set::new();
2019
for name in ASCII_CASE_INSENSITIVE_HTML_ATTRIBUTES.split_whitespace() {
2120
set.entry(name);
2221
}
2322
set.build(&mut file).unwrap();
2423
write!(&mut file, "; &SET }}").unwrap();
24+
println!("cargo:rerun-if-changed=build.rs");
2525
}
2626

2727
/// https://html.spec.whatwg.org/multipage/#selectors

0 commit comments

Comments
 (0)