Skip to content

Commit 2eac915

Browse files
authored
Merge pull request #8445 from Forgind/update-17.4-from-17.2
Update 17.4 from 17.2
2 parents fedecea + 88e6887 commit 2eac915

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/Utilities.UnitTests/TrackedDependencies/FileTrackerTests.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ public FileTrackerTests()
6868
Environment.ExpandEnvironmentVariables("%windir%\\system32;%windir%"));
6969
}
7070

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

7880
public void Dispose()
@@ -83,7 +85,6 @@ public void Dispose()
8385
Environment.SetEnvironmentVariable("PATH", s_oldPath);
8486
s_oldPath = null;
8587
}
86-
8788
FileTrackerTestHelper.CleanTlogs();
8889
}
8990

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

840-
[Fact(Skip = "FileTracker tests require VS2015 Update 3 or a packaged version of Tracker.exe https://github.com/dotnet/msbuild/issues/649")]
841+
[Fact]
841842
public void FileTrackerFileIsUnderPath()
842843
{
843-
Console.WriteLine("Test: FileTrackerFileIsUnderPath");
844-
845844
// YES: Both refer to something under baz, so yes this is on the path
846845
Assert.True(FileTracker.FileIsUnderPath(@"c:\foo\bar\baz\", @"c:\foo\bar\baz\"));
847846

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

886-
[Fact(Skip = "FileTracker tests require VS2015 Update 3 or a packaged version of Tracker.exe https://github.com/dotnet/msbuild/issues/649")]
885+
[Fact]
887886
public void FileTrackerFileIsExcludedFromDependencies()
888887
{
889-
Console.WriteLine("Test: FileTrackerFileIsExcludedFromDependencies");
890-
891888
string applicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
892889
string localApplicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
893890
string localLowApplicationDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData\\LocalLow");

src/Utilities/TrackedDependencies/FileTracker.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,14 @@ public static class FileTracker
7272
{
7373
#region Static Member Data
7474

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

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

0 commit comments

Comments
 (0)