diff --git a/CI/decision.py b/CI/decision.py index 1cd7634b..69211f2c 100644 --- a/CI/decision.py +++ b/CI/decision.py @@ -30,6 +30,7 @@ Build, Git, Hg, + install_rust, nproc, ) from variables import * # noqa: F403 @@ -143,7 +144,8 @@ def __init__(self, **kwargs): [ "shopt -s nullglob", "cd repo", - "zip $ARTIFACTS/coverage.zip" ' $(find . -name "*.gcda")', + "zip $ARTIFACTS/coverage.zip" + ' $(find . -name "*.gcda" -o -name "*.profraw")', "cd ..", "shopt -u nullglob", ] @@ -155,6 +157,7 @@ def __init__(self, **kwargs): artifacts.push(artifact) artifacts.append("coverage.zip") self.coverage.append(self) + kwargs.setdefault("env", {})["LLVM_PROFILE_FILE"] = "/repo/%m.profraw" elif variant == "asan" and task_env == "linux": kwargs["caps"] = ["SYS_PTRACE"] if not desc: @@ -417,6 +420,7 @@ def main(): {f"file:cov-{task.id}.zip": task} for task in TestTask.coverage ] task = Build.by_name("linux.coverage") + coverage_mounts.append(task.mount()) coverage_mounts.append( { "file:gcno-build.zip": { @@ -426,11 +430,11 @@ def main(): } ) - merge_coverage.extend( - [ - "grcov -s repo -t lcov -o repo/coverage.lcov gcno-build.zip " - + " ".join(f"cov-{task.id}.zip" for task in TestTask.coverage), - ] + merge_coverage.extend(install_rust()) + merge_coverage.append("rustup component add llvm-tools-preview") + merge_coverage.append( + "grcov -s repo -t lcov -o repo/coverage.lcov -b git-cinnabar gcno-build.zip " + + " ".join(f"cov-{task.id}.zip" for task in TestTask.coverage) ) if merge_coverage: diff --git a/CI/tasks.py b/CI/tasks.py index b6e1236d..438b118e 100644 --- a/CI/tasks.py +++ b/CI/tasks.py @@ -337,7 +337,7 @@ def file_format(url): dependencies.append(t.id) else: raise Exception("Don't know how to handle {}".format(k)) - task["dependencies"] = sorted(dependencies) + task["dependencies"] = sorted(set(dependencies)) index = kwargs.get("index") id = None if index and all(isinstance(d, Index.Existing) for d in dependencies[1:]): diff --git a/CI/tools.py b/CI/tools.py index c72caed1..d9db59ef 100644 --- a/CI/tools.py +++ b/CI/tools.py @@ -437,7 +437,7 @@ def prefix(p, s): ] environ["RUSTFLAGS"] = " ".join( [ - "-Zprofile", + "-Cinstrument-coverage", "-Ccodegen-units=1", "-Cinline-threshold=0", ]