From 362dc09db82ac4704b99bd8a6497e28df0e6e380 Mon Sep 17 00:00:00 2001 From: Torgil Svensson Date: Mon, 23 Jan 2023 15:48:59 +0100 Subject: [PATCH] Make gcno-files available in CcCompilationOutputs This is needed to do custom code coverage rules. --- .../build/lib/rules/cpp/CcCompilationHelper.java | 12 ++++-------- .../build/lib/rules/cpp/CcCompilationOutputs.java | 2 -- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java index 588b6763234c42..c2061c20b2b80e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java @@ -1960,10 +1960,8 @@ private ImmutableList createSourceAction( CppHelper.getArtifactNameForCategory( ccToolchain, ArtifactCategory.COVERAGE_DATA_FILE, picOutputBase); Artifact gcnoFile = - enableCoverage - ? CppHelper.getCompileOutputArtifact( - actionConstructionContext, label, gcnoFileName, configuration) - : null; + CppHelper.getCompileOutputArtifact( + actionConstructionContext, label, gcnoFileName, configuration); Artifact dwoFile = generateDwo && !bitcodeOutput ? getDwoFile(picBuilder.getOutputFile()) : null; Artifact ltoIndexingFile = @@ -2032,10 +2030,8 @@ private ImmutableList createSourceAction( // Create no-PIC compile actions Artifact gcnoFile = - enableCoverage - ? CppHelper.getCompileOutputArtifact( - actionConstructionContext, label, gcnoFileName, configuration) - : null; + CppHelper.getCompileOutputArtifact( + actionConstructionContext, label, gcnoFileName, configuration); Artifact noPicDwoFile = generateDwo && !bitcodeOutput ? getDwoFile(noPicOutputFile) : null; Artifact ltoIndexingFile = bitcodeOutput ? getLtoIndexingFile(builder.getOutputFile()) : null; diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java index ddfcfae385b6b4..278abb4b0ffe69 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationOutputs.java @@ -182,13 +182,11 @@ public ImmutableList getPicDwoFiles() { @Override public Sequence getStarlarkGcnoFiles(StarlarkThread thread) throws EvalException { - CcModule.checkPrivateStarlarkificationAllowlist(thread); return StarlarkList.immutableCopyOf(getGcnoFiles()); } @Override public Sequence getStarlarkPicGcnoFiles(StarlarkThread thread) throws EvalException { - CcModule.checkPrivateStarlarkificationAllowlist(thread); return StarlarkList.immutableCopyOf(getPicGcnoFiles()); }