Skip to content

Commit

Permalink
Increase memory limit for 'dbg' CppLink actions to 24g (alternate ver…
Browse files Browse the repository at this point in the history
…sion).

Update the current Blaze build default for 'dbg' compilation mode, to increase
CppLink memory limits to 24g, to significantly reduce debug build failures.

PiperOrigin-RevId: 698832543
Change-Id: I1ed0c727d369f7a1092f1dd496a681205425fbd4
  • Loading branch information
Googler authored and copybara-github committed Nov 21, 2024
1 parent 6906ba6 commit d52aa7b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.google.devtools.build.lib.rules.cpp.CppCompileActionBuilder;
import com.google.devtools.build.lib.rules.cpp.CppConfiguration;
import com.google.devtools.build.lib.rules.cpp.CppFileTypes;
import com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.SerializationConstant;
import net.starlark.java.eval.EvalException;
import net.starlark.java.eval.Sequence;
Expand Down Expand Up @@ -119,6 +120,10 @@ public void finalizeCompileActionBuilder(
}
}

@Override
public void finalizeLinkActionBuilder(
CppConfiguration configuration, CppLinkActionBuilder actionBuilder) throws EvalException {}

@Override
public boolean allowIncludeScanning() {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,8 @@ public CppLinkAction build() throws EvalException, InterruptedException {
.addAll(cppConfiguration.getLinkopts())
.build();

cppSemantics.finalizeLinkActionBuilder(cppConfiguration, this);

return buildLinkAction(
linkType.getActionName(),
/* mnemonic= */ mnemonic == null ? "CppLink" : mnemonic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ void finalizeCompileActionBuilder(
CppCompileActionBuilder actionBuilder)
throws EvalException;

/**
* Called before a C++ link action is built.
*
* <p>Gives the semantics implementation the opportunity to change link actions at the last
* minute.
*/
void finalizeLinkActionBuilder(CppConfiguration configuration, CppLinkActionBuilder actionBuilder)
throws EvalException;

/**
* Returns if include scanning is allowed.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public void finalizeCompileActionBuilder(
FeatureConfiguration featureConfiguration,
CppCompileActionBuilder actionBuilder) {}

@Override
public void finalizeLinkActionBuilder(
CppConfiguration configuration, CppLinkActionBuilder actionBuilder) {}

@Override
public boolean allowIncludeScanning() {
return false;
Expand Down

0 comments on commit d52aa7b

Please sign in to comment.