diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-10-12 16:08:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-12 16:08:48 -0400 |
commit | eee2c895f41081750e34c2ecc6e95e7e1cbac784 (patch) | |
tree | 85e80c6d4ca1fe84d54f67b34ef5208cf54dc30c /python/servo | |
parent | 228b34aed8ad9a368fd537cf3811d53277ee1ce5 (diff) | |
parent | 98123059420301308714b476eb84cbf72bc21980 (diff) | |
download | servo-eee2c895f41081750e34c2ecc6e95e7e1cbac784.tar.gz servo-eee2c895f41081750e34c2ecc6e95e7e1cbac784.zip |
Auto merge of #24198 - jdm:xargo-uwp3, r=SimonSapin
Build UWP with native UWP rustc target
<!-- 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/24198)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/build_commands.py | 21 | ||||
-rw-r--r-- | python/servo/command_base.py | 11 | ||||
-rw-r--r-- | python/servo/packages.py | 1 |
3 files changed, 16 insertions, 17 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index b4343392479..73698c3f3b5 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -164,17 +164,18 @@ class MachCommands(CommandBase): @CommandArgument('--very-verbose', '-vv', action='store_true', help='Print very verbose output') - @CommandArgument('--win-arm64', action='store_true', help="Use arm64 Windows target") @CommandArgument('params', nargs='...', help="Command-line arguments to be passed through to Cargo") @CommandBase.build_like_command_arguments def build(self, release=False, dev=False, jobs=None, params=None, no_package=False, verbose=False, very_verbose=False, - target=None, android=False, magicleap=False, libsimpleservo=False, uwp=False, - features=None, win_arm64=False, **kwargs): + target=None, android=False, magicleap=False, libsimpleservo=False, + features=None, **kwargs): opts = params or [] features = features or [] + target, android = self.pick_target_triple(target, android, magicleap) + uwp = target and 'uwp' in target target_path = base_path = self.get_target_dir() if android: @@ -220,14 +221,8 @@ class MachCommands(CommandBase): if very_verbose: opts += ["-vv"] - if win_arm64: - if target: - print("Can't specify explicit --target value with --win-arm64.") - sys.exit(1) - target = "aarch64-pc-windows-msvc" - if target: - if self.config["tools"]["use-rustup"]: + if self.config["tools"]["use-rustup"] and not uwp: # 'rustup target add' fails if the toolchain is not installed at all. self.call_rustup_run(["rustc", "--version"]) @@ -265,6 +260,10 @@ class MachCommands(CommandBase): env['PKG_CONFIG_ALLOW_CROSS'] = "1" if uwp: + # Ensure libstd is ready for the new UWP target. + check_call(["rustup", "component", "add", "rust-src"]) + env['RUST_SYSROOT'] = path.expanduser('~\\.xargo') + # Don't try and build a desktop port. libsimpleservo = True @@ -943,7 +942,7 @@ def package_msvc_dlls(servo_exe_dir, target, vcinstalldir, vs_version): "msvcp140.dll", "vcruntime140.dll", ] - if target_arch != "aarch64" and vs_version in ("14.0", "15.0", "16.0"): + if target_arch != "aarch64" and "uwp" not in target and vs_version in ("14.0", "15.0", "16.0"): msvc_deps += ["api-ms-win-crt-runtime-l1-1-0.dll"] # Check if it's Visual C++ Build Tools or Visual Studio 2015 diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 90623613489..7f4e941a4c7 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -634,6 +634,7 @@ install them, let us know by filing a bug!") extra_path += [path.join(self.msvc_package_dir("llvm"), "bin")] extra_path += [path.join(self.msvc_package_dir("ninja"), "bin")] extra_path += [self.msvc_package_dir("nuget")] + extra_path += [path.join(self.msvc_package_dir("xargo"))] arch = (target or host_triple()).split('-')[0] vcpkg_arch = { @@ -821,11 +822,6 @@ install them, let us know by filing a bug!") action='store_true', help='Build with frame pointer enabled, used by the background hang monitor.', ), - CommandArgument( - '--uwp', - default=None, - action='store_true', - help='Build for HoloLens (x64)'), CommandArgument('--with-raqote', default=None, action='store_true'), CommandArgument('--with-layout-2020', default=None, action='store_true'), CommandArgument('--without-wgl', default=None, action='store_true'), @@ -912,7 +908,10 @@ install them, let us know by filing a bug!") assert "--features" not in cargo_args args += ["--features", " ".join(features)] - return self.call_rustup_run(["cargo", command] + args + cargo_args, env=env, verbose=verbose) + if target and 'uwp' in target: + return call(["xargo", command] + args + cargo_args, env=env, verbose=verbose) + else: + return self.call_rustup_run(["cargo", command] + args + cargo_args, env=env, verbose=verbose) def android_support_dir(self): return path.join(self.context.topdir, "support", "android") diff --git a/python/servo/packages.py b/python/servo/packages.py index 0af54b4aad5..bd36d2137f5 100644 --- a/python/servo/packages.py +++ b/python/servo/packages.py @@ -11,4 +11,5 @@ WINDOWS_MSVC = { "openssl": "111.3.0+1.1.1c-vs2017-2019-09-18", "gstreamer-uwp": "1.16.0.5", "openxr-loader-uwp": "1.0", + "xargo": "v0.3.16", } |