Skip to content

Commit

Permalink
Make experimental_cpp_compile_argv_ignore_param_file no-op
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 515359157
Change-Id: Idc792900ce841c8807257f399ba51614690a82b5
  • Loading branch information
mai93 authored and copybara-github committed Mar 9, 2023
1 parent c7f5c81 commit caf5253
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -885,14 +885,10 @@ public List<String> getArguments() throws CommandLineExpansionException {
@Override
public Sequence<String> getStarlarkArgv() throws EvalException, InterruptedException {
try {
if (cppConfiguration.ignoreParamFile()) {
return StarlarkList.immutableCopyOf(
compileCommandLine.getArguments(
/*parameterFilePath=*/ null, getOverwrittenVariables()));
return StarlarkList.immutableCopyOf(
compileCommandLine.getArguments(
/* parameterFilePath= */ null, getOverwrittenVariables()));

} else {
return StarlarkList.immutableCopyOf(getArguments());
}
} catch (CommandLineExpansionException ex) {
throw new EvalException(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,6 @@ public boolean isCSFdo() {
return cppOptions.isCSFdo();
}

public boolean ignoreParamFile() {
return cppOptions.ignoreParamFile;
}

public boolean useArgsParamsFile() {
return cppOptions.useArgsParamsFile;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,13 +1062,11 @@ public Label getPropellerOptimizeLabel() {
name = "experimental_cpp_compile_argv_ignore_param_file",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION},
effectTags = {OptionEffectTag.NO_OP},
metadataTags = {
OptionMetadataTag.EXPERIMENTAL,
},
help =
"If enabled, CppCompileAction action.argv returns the complete list of argv even if"
+ " compiler_param_file is enabled.")
help = "This flag is a noop and scheduled for removal.")
public boolean ignoreParamFile;

@Option(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1147,24 +1147,6 @@ public void testCompilationParameterFile() throws Exception {
.containsExactly("/usr/bin/mock-gcc", "@/k8-fastbuild/bin/a/_objs/foo/foo.o.params");
}

@Test
public void testCppCompileActionArgvReturnParamFile() throws Exception {
AnalysisMock.get()
.ccSupport()
.setupCcToolchainConfig(
mockToolsConfig,
CcToolchainConfig.builder().withFeatures(CppRuleClasses.COMPILER_PARAM_FILE));
useConfiguration("--noexperimental_cpp_compile_argv_ignore_param_file");
scratch.file("a/BUILD", "cc_library(name='foo', srcs=['foo.cc'])");
CppCompileAction cppCompileAction = getCppCompileAction("//a:foo");
ImmutableList<String> argv =
cppCompileAction.getStarlarkArgv().stream()
.map(x -> removeOutDirectory(x))
.collect(ImmutableList.toImmutableList());
assertThat(argv)
.containsExactly("/usr/bin/mock-gcc", "@/k8-fastbuild/bin/a/_objs/foo/foo.o.params");
}

@Test
public void testCppCompileActionArgvIgnoreParamFile() throws Exception {
AnalysisMock.get()
Expand Down

0 comments on commit caf5253

Please sign in to comment.