diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2018-01-09 22:53:26 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2018-01-10 18:05:28 +0100 |
commit | 6dff251e35736fa74eaab6ddbc8b6ecec08ecf48 (patch) | |
tree | 4877c16e9f4ec1580495ff431a15c7ee6bf5e0fc | |
parent | e2c89df8eeb5f2dbac1436335aea52099a622d0d (diff) | |
download | servo-6dff251e35736fa74eaab6ddbc8b6ecec08ecf48.tar.gz servo-6dff251e35736fa74eaab6ddbc8b6ecec08ecf48.zip |
Revert "Use rustdoc --document-private-item instead of deprecated flags"
This reverts commit d96f0ff6a77e309682898cc7e1905a7bd0feb3cf.
-rwxr-xr-x | etc/rustdoc-with-private | 4 | ||||
-rw-r--r-- | python/servo/command_base.py | 7 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 5 |
3 files changed, 10 insertions, 6 deletions
diff --git a/etc/rustdoc-with-private b/etc/rustdoc-with-private new file mode 100755 index 00000000000..097c237c562 --- /dev/null +++ b/etc/rustdoc-with-private @@ -0,0 +1,4 @@ +#!/bin/sh +# Skip the strip-private and strip-hidden rustdoc passes +# https://github.com/rust-lang/rust/issues/15347 +rustdoc --no-defaults --passes collapse-docs --passes unindent-comments --passes strip-priv-imports "$@" diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 4b29b25daf6..3ff2a6eea3b 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -388,7 +388,7 @@ class CommandBase(object): " --release" if release else "")) sys.exit() - def build_env(self, hosts_file_path=None, target=None, is_build=False, geckolib=False): + def build_env(self, hosts_file_path=None, target=None, is_build=False, geckolib=False, test_unit=False): """Return an extended environment dictionary.""" env = os.environ.copy() if sys.platform == "win32" and type(env['PATH']) == unicode: @@ -486,7 +486,10 @@ class CommandBase(object): if hosts_file_path: env['HOST_FILE'] = hosts_file_path - env['RUSTDOCFLAGS'] = "--document-private-items" + if not test_unit: + # This wrapper script is in bash and doesn't work on Windows + # where we want to run doctests as part of `./mach test-unit` + env['RUSTDOC'] = path.join(self.context.topdir, 'etc', 'rustdoc-with-private') if self.config["build"]["rustflags"]: env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " " + self.config["build"]["rustflags"] diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index de77c85c285..8a8c41597b9 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -255,12 +255,9 @@ class MachCommands(CommandBase): packages.discard('stylo') - env = self.build_env() + env = self.build_env(test_unit=True) env["RUST_BACKTRACE"] = "1" - # Work around https://github.com/rust-lang/cargo/issues/4790 - del env["RUSTDOCFLAGS"] - if "msvc" in 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. |