Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 81da5a2
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Wed Apr 26 10:17:54 2023 -0700

    [vs17.2] Temporary turn off static graph restore. (#8697)

    Turn off static graph restore.

    (Backport of #8498 to vs17.2)

commit 872ddd9
Merge: 94fcedf 6faa1d5
Author: Forgind <12969783+Forgind@users.noreply.github.com>
Date:   Mon Feb 13 07:30:47 2023 -0800

    Merge pull request #8419 from Forgind/fix-temp-file-filtering-17.2

    Fixes AB#1678521

    Context
    #8049 broke the temp filtering logic by using the MSBuild-specific temp path instead of the true base temp path. This manifests as an overbuild of some C++ projects.

    Changes Made
    Reverted the change. Enabled relevant unit tests.

    Testing
    Existing unit tests and a C++ end-to-end repro.

    Notes
    The rest of FileTracker tests cannot be enabled without significant work (related to #649).

commit 6faa1d5
Merge: 94fcedf 2fdde65
Author: Forgind <Forgind@users.noreply.github.com>
Date:   Tue Feb 7 14:56:15 2023 -0800

    Merge branch 'vs17.0' of https://github.com/dotnet/msbuild into vs17.2

commit 2fdde65
Author: Forgind <12969783+Forgind@users.noreply.github.com>
Date:   Tue Feb 7 09:06:10 2023 -0800

    Fix temp file filtering in FileTracker (#8352)

    (Copied from #8351)

    Fixes AB#1678521

    Context
    #8049 broke the temp filtering logic by using the MSBuild-specific temp path instead of the true base temp path. This manifests as an overbuild of some C++ projects.

    Changes Made
    Reverted the change. Enabled relevant unit tests.

    Testing
    Existing unit tests and a C++ end-to-end repro.

    Notes
    The rest of FileTracker tests cannot be enabled without significant work (related to #649).
  • Loading branch information
JanKrivanek committed Apr 26, 2023
1 parent 3bf9b80 commit 088081e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
4 changes: 4 additions & 0 deletions eng/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>

<!-- Commented out as a temporary fix for the msbuild CI.
Waiting for https://github.com/NuGet/NuGet.Client/pull/5010 fix to flow to CI machines. -->
<!--
<PropertyGroup>
<RestoreUseStaticGraphEvaluation Condition="'$(DotNetBuildFromSource)' != 'true'">true</RestoreUseStaticGraphEvaluation>
</PropertyGroup>
-->

<ItemGroup>
<!-- Remove all sln files globbed by arcade so far and add only MSBuild.sln to the build.
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<VersionPrefix>17.2.2</VersionPrefix>
<VersionPrefix>17.2.3</VersionPrefix>
<DotNetFinalVersionKind>release</DotNetFinalVersionKind>
<AssemblyVersion>15.1.0.0</AssemblyVersion>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
Expand Down
11 changes: 4 additions & 7 deletions src/Utilities.UnitTests/TrackedDependencies/FileTrackerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ public FileTrackerTests()
Environment.ExpandEnvironmentVariables("%windir%\\system32;%windir%"));
}

#if ENABLE_TRACKER_TESTS // https://github.com/dotnet/msbuild/issues/649
// Call StopTrackingAndCleanup here, just in case one of the unit tests failed before it called it
// In real code StopTrackingAndCleanup(); would always be in a finally {} block.
FileTracker.StopTrackingAndCleanup();
FileTrackerTestHelper.CleanTlogs();
FileTracker.SetThreadCount(1);
#endif
}

public void Dispose()
Expand All @@ -83,7 +85,6 @@ public void Dispose()
Environment.SetEnvironmentVariable("PATH", s_oldPath);
s_oldPath = null;
}

FileTrackerTestHelper.CleanTlogs();
}

Expand Down Expand Up @@ -837,11 +838,9 @@ public void FileTrackerFindStrInX86X64ChainRepeatCommand()
FileTrackerTestHelper.AssertFoundStringInTLog(Path.GetFullPath("test.in").ToUpperInvariant(), tlogFiles[0]);
}

[Fact(Skip = "FileTracker tests require VS2015 Update 3 or a packaged version of Tracker.exe https://github.com/dotnet/msbuild/issues/649")]
[Fact]
public void FileTrackerFileIsUnderPath()
{
Console.WriteLine("Test: FileTrackerFileIsUnderPath");

// YES: Both refer to something under baz, so yes this is on the path
Assert.True(FileTracker.FileIsUnderPath(@"c:\foo\bar\baz\", @"c:\foo\bar\baz\"));

Expand Down Expand Up @@ -883,11 +882,9 @@ public void FileTrackerFileIsUnderPath()
Assert.False(FileTracker.FileIsUnderPath(@"c:\foo\rumble.cpp", @"c:\foo\rumble\"));
}

[Fact(Skip = "FileTracker tests require VS2015 Update 3 or a packaged version of Tracker.exe https://github.com/dotnet/msbuild/issues/649")]
[Fact]
public void FileTrackerFileIsExcludedFromDependencies()
{
Console.WriteLine("Test: FileTrackerFileIsExcludedFromDependencies");

string applicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string localApplicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string localLowApplicationDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData\\LocalLow");
Expand Down
10 changes: 8 additions & 2 deletions src/Utilities/TrackedDependencies/FileTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ public static class FileTracker
{
#region Static Member Data

// The default path to temp, used to create explicitly short and long paths
private static readonly string s_tempPath = FileUtilities.TempFileDirectory;
/// <summary>
/// The default path to temp, used to create explicitly short and long paths.
/// </summary>
/// <remarks>
/// This must be the base system-wide temp path because we use it to filter out I/O of tools outside of our control.
/// Tools running under the tracker may put temp files in the temp base or in a sub-directory of their choosing.
/// </remarks>
private static readonly string s_tempPath = Path.GetTempPath();

// The short path to temp
private static readonly string s_tempShortPath = FileUtilities.EnsureTrailingSlash(NativeMethodsShared.GetShortFilePath(s_tempPath).ToUpperInvariant());
Expand Down

0 comments on commit 088081e

Please sign in to comment.