Skip to content

Commit

Permalink
Auto merge of #24185 - jdm:uwp-native-build, r=<try>
Browse files Browse the repository at this point in the history
Fix many WACK errors

These changes ensure that all native dependencies are built with the compiler flags that will prevent forbidden API uses. They also incorporate a fork of rand_os that backports UWP support from more recent rand releases. This is necessary in the short term to avoid having to wait for the entire ecosystem to migrate to the most recent rand release.

Depends on servo/mozjs#200.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because no windows WACK tests

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24185)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Sep 11, 2019
2 parents 93426a0 + afb1be9 commit f47cf0b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Expand Up @@ -28,3 +28,10 @@ opt-level = 3
# Those are here to dedupe winapi since mio is still using winapi 0.2.
mio = { git = "https://github.com/servo/mio.git", branch = "servo" }
iovec = { git = "https://github.com/servo/iovec.git", branch = "servo" }
rand_os = { git = "https://github.com/servo/rand", branch = "servo-rand_os-0.1.3-uwp" }
rand_core = { git = "https://github.com/servo/rand", branch = "servo-rand_os-0.1.3-uwp" }

[patch."https://github.com/servo/mozjs"]
mozjs_sys = { git = "https://github.com/jdm/mozjs", branch = "uwp-rustc-with-cpp-changes" }
[patch."https://github.com/servo/rust-mozjs"]
mozjs = { git = "https://github.com/jdm/rust-mozjs", branch = "uwp" }
3 changes: 2 additions & 1 deletion components/script/Cargo.toml
Expand Up @@ -20,14 +20,15 @@ webidl_lint = ["script_plugins/webidl_lint"]
default = ["unrooted_must_root_lint", "webidl_lint"]
webgl_backtrace = ["backtrace", "canvas_traits/webgl_backtrace"]
js_backtrace = ["backtrace"]
uwp = ["js/uwp"]

[build-dependencies]
cmake = "0.1"
phf_codegen = "0.7"
phf_shared = "0.7"
serde_json = "1.0"

[target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies]
[target.'cfg(target_os = "linux")'.dependencies]
tinyfiledialogs = "3.0"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion components/servo/Cargo.toml
Expand Up @@ -25,7 +25,7 @@ layout-2020 = ["layout_thread_2020"]
max_log_level = ["log/release_max_level_info"]
native-bluetooth = ["bluetooth/native-bluetooth"]
no_wgl = ["canvas/no_wgl"]
uwp = ["servo_config/uwp"]
uwp = ["servo_config/uwp", "script/uwp"]
webrender_debugger = ["webrender/debugger"]
no_static_freetype = ["webrender/no_static_freetype"]
oculusvr = ["webvr/oculusvr"]
Expand Down
5 changes: 5 additions & 0 deletions python/servo/build_commands.py
Expand Up @@ -626,6 +626,11 @@ def build(self, release=False, dev=False, jobs=None, params=None,
if sys.platform == "win32":
env.setdefault("CC", "clang-cl.exe")
env.setdefault("CXX", "clang-cl.exe")
if uwp:
env.setdefault("CFLAGS", "")
env.setdefault("CXXFLAGS", "")
env["CFLAGS"] += " -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
env["CXXFLAGS"] += " -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
else:
env.setdefault("CC", "clang")
env.setdefault("CXX", "clang++")
Expand Down

0 comments on commit f47cf0b

Please sign in to comment.