diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-06-29 12:45:45 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-06-30 09:46:45 +0200 |
commit | ddc79946733cdfed32f5366ba7138f1d91dc2ea2 (patch) | |
tree | cd4c8c7c10f69fb1bceb59dc37fcd9bb7e020079 | |
parent | a725380db0b9fba31993409f7d0f4b2d11ca8f7d (diff) | |
download | servo-ddc79946733cdfed32f5366ba7138f1d91dc2ea2.tar.gz servo-ddc79946733cdfed32f5366ba7138f1d91dc2ea2.zip |
Update mozangle, cc, and cmake
This also moves some environment variable configuration to the shared
`build_env()` method, because previously clang was only being chosen for
running `./mach build` and not `./mach test-unit` which was leading to
rebuilds and thus build failures when running `test-unit`. I guess the
cmake crate does not expect the compiler to change between subsequent
runs.
-rw-r--r-- | Cargo.lock | 12 | ||||
-rw-r--r-- | python/servo/build_commands.py | 5 | ||||
-rw-r--r-- | python/servo/command_base.py | 12 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 14 |
4 files changed, 25 insertions, 18 deletions
diff --git a/Cargo.lock b/Cargo.lock index 3e45fd17d83..75aaedbe258 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -682,9 +682,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.73" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" dependencies = [ "jobserver", ] @@ -792,9 +792,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.49" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ "cc", ] @@ -3722,9 +3722,9 @@ checksum = "eeb5a94c61e12e2cfc16ee3e2b6eca8f126a43c888586626337544a7e824a1af" [[package]] name = "mozangle" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef98797da14500fb5eaabc90dc91cf7c42710c11330351521d72f4aa268d689c" +checksum = "abe944fd6e85e054436f598b5fb12f492da8cf9554981bd4a23a91982f72657c" dependencies = [ "cc", "gl_generator 0.13.1", diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 1cf23237807..d56246f9c1d 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -118,7 +118,6 @@ class MachCommands(CommandBase): self.ensure_clobbered() build_start = time() - env["CARGO_TARGET_DIR"] = target_path host = servo.platform.host_triple() target_triple = self.cross_compile_target or servo.platform.host_triple() @@ -401,10 +400,6 @@ class MachCommands(CommandBase): for key in env: print((key, env[key])) - if sys.platform != "win32": - env.setdefault("CC", "clang") - env.setdefault("CXX", "clang++") - status = self.run_cargo_build_like_command( "build", opts, env=env, verbose=verbose, libsimpleservo=libsimpleservo, **kwargs diff --git a/python/servo/command_base.py b/python/servo/command_base.py index ae702e67142..2f7ac3400bb 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -496,7 +496,7 @@ class CommandBase(object): 'vcdir': vcinstalldir, } - def build_env(self, is_build=False, test_unit=False): + def build_env(self, is_build=False): """Return an extended environment dictionary.""" env = os.environ.copy() @@ -557,6 +557,10 @@ class CommandBase(object): # Always build harfbuzz from source env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true" + if sys.platform != "win32": + env.setdefault("CC", "clang") + env.setdefault("CXX", "clang++") + if extra_path: util.append_paths_to_env(env, "PATH", extra_path) @@ -597,11 +601,6 @@ class CommandBase(object): if "ANDROID_TOOLCHAIN" in env: env["NDK_STANDALONE"] = env["ANDROID_TOOLCHAIN"] - if test_unit and "msvc" in servo.platform.host_triple(): - # on MSVC, we need some DLLs in the path. They were copied - # in to the servo.exe build dir, so just point PATH to that. - util.prepend_paths_to_env(env, "PATH", path.dirname(self.get_binary_path(False, False))) - if self.config["build"]["rustflags"]: env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " " + self.config["build"]["rustflags"] @@ -619,6 +618,7 @@ class CommandBase(object): env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C target-feature=+neon" env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -W unused-extern-crates" + env["CARGO_TARGET_DIR"] = servo.util.get_target_dir() git_info = [] if os.path.isdir('.git') and is_build: diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index e91e642605e..f164ab40223 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -31,6 +31,8 @@ from mach.decorators import ( CommandProvider, Command, ) + +import servo.util import tidy from servo.command_base import ( @@ -260,10 +262,20 @@ class MachCommands(CommandBase): if nocapture: args += ["--", "--nocapture"] + # We are setting is_build here to true, because running `cargo test` can trigger builds. + env = self.build_env(is_build=True) + + # on MSVC, we need some DLLs in the path. They were copied + # in to the servo.exe build dir, so just point PATH to that. + # TODO(mrobinson): This should be removed entirely. + if "msvc" in servo.platform.host_triple(): + servo.util.prepend_paths_to_env( + env, "PATH", path.dirname(self.get_binary_path(False, False))) + return self.run_cargo_build_like_command( "bench" if bench else "test", args, - env=self.build_env(test_unit=True), + env=env, with_layout_2020=with_layout_2020, **kwargs) |