Skip to content

Commit 99aca45

Browse files
committed
servo: Merge #19003 - Make test-stylo compile an empty crate on Windows without Gecko (from servo:stylo_tests_windows); r=emilio
That is, in cases where it would fail to link. This will help make Rust CI be gated on compiling Stylo: rust-lang/rust#44603 Source-Repo: https://github.com/servo/servo Source-Revision: 38fe9533b93e985657f99a29772bf3d3c8694822 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 3a2413e03efb4754cf657f4637a3543fbc13074a
1 parent 1ead0a9 commit 99aca45

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

servo/etc/ci/buildbot_steps.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ windows-msvc-dev:
146146
- mach.bat test-unit
147147
- mach.bat package --dev
148148
- mach.bat build-geckolib
149+
- mach.bat test-stylo
149150

150151
windows-msvc-nightly:
151152
- mach.bat clean-nightlies --keep 3 --force

servo/tests/unit/stylo/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ fn main() {
6363
.write_all(format!("include!(concat!({:?}, \"/gecko/structs.rs\"));",
6464
style_out_dir).as_bytes())
6565
.unwrap();
66+
67+
if env::var_os("MOZ_SRC").is_some() {
68+
println!("cargo:rustc-cfg=linking_with_gecko")
69+
}
6670
}

servo/tests/unit/stylo/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
// Disable this entire crate on Windows when Gecko symbols are not available
6+
// as linking would fail:
7+
// https://github.com/rust-lang/rust/pull/44603#issuecomment-338807312
8+
//
9+
// On Linux and OS X linking succeeds anyway.
10+
// Presumably these symbol declarations don’t need to be resolved
11+
// as they’re not used in any code called from this crate.
12+
#![cfg(any(linking_with_gecko, not(windows)))]
13+
514
extern crate atomic_refcell;
615
extern crate cssparser;
716
extern crate env_logger;

0 commit comments

Comments
 (0)