Skip to content

Skipped targets should not cause cache miss #11766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Build/BackEnd/BuildManager/BuildParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ public BuildParameters Clone()

internal bool UsesInputCaches() => InputResultsCacheFiles != null;

internal bool SkippedResultsDoNotCauseCacheMiss() => ProjectIsolationMode == ProjectIsolationMode.True;
internal bool SkippedResultsDoNotCauseCacheMiss() => (ProjectIsolationMode == ProjectIsolationMode.True) || Traits.Instance.SkippedResultsDoNotCauseCacheMiss;

/// <summary>
/// Implementation of the serialization mechanism.
Expand Down
2 changes: 2 additions & 0 deletions src/Framework/Traits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public Traits()
public readonly bool TelemetryOptIn = IsEnvVarOneOrTrue("MSBUILD_TELEMETRY_OPTIN");
public readonly bool SlnParsingWithSolutionPersistenceOptIn = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILD_PARSE_SLN_WITH_SOLUTIONPERSISTENCE"));

public readonly bool SkippedResultsDoNotCauseCacheMiss = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDSKIPPEDRESULTSDONOTCAUSECACHEMISS"));

public static void UpdateFromEnvironment()
{
// Re-create Traits instance to update values in Traits according to current environment.
Expand Down