Skip to content
Snippets Groups Projects
Commit 61d17b63e5d5 authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

rust-policy: skip if current revision is an ancestor of the rust module policy

We can't make sure that no Rust code will be run before the rust module policy
was introduced in 94167e701e125dce1788e19b1e1489958235e40c, in fact, we can be
pretty sure of it.
parent bc2e9db301a8
No related branches found
No related tags found
No related merge requests found
......@@ -324,6 +324,29 @@
# define the cache dir for simplicity
self._cache_dir = os.getcwd()
# Don't run if using Rust on a revision before the Rust modulepolicy
# was introduced
if os.environ.get("HGMODULEPOLICY").startswith("rust"):
# Don't use `subprocess.PIPE` as it can deadlock (see docs).
# We capture `stderr` because the error message from `hg log` would
# make it seem like there was a bug.
with open(os.devnull, "w") as FNULL:
try:
self.hg(
"log",
"-r",
"94167e701e125dce1788e19b1e1489958235e40c",
stderr=FNULL,
)
except subprocess.CalledProcessError as e:
if e.returncode == 255:
raise NotImplementedError(
"Rust modulepolicy was not implemented before "
"revision 94167e701e125dce1788e19b1e1489958235e40c"
", skipping."
)
raise
def should_skip_benchmark(self, incompatibility_revset, current_version, filter_fn, test_kwargs):
"""Determines whether the benchmark should be run given an exclusion
revset, the current mercurial version and an optional filter function.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment