Skip to content
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

Switch to json serialization without adding support for precomputed caches #5983

Closed
wants to merge 43 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a79f308
First stab at caching more RAR info
Forgind Jul 14, 2020
1d73559
PR comments pt. 1
Forgind Jul 21, 2020
036c5a3
Resolve first three bullet points
Forgind Jul 21, 2020
8b3b613
Next steps
Forgind Aug 3, 2020
6160d48
revert to BinaryFormatter
Forgind Aug 3, 2020
9b95494
Serialize mvid
Forgind Aug 4, 2020
43195f4
Design change
Forgind Aug 10, 2020
9045d3d
Serialize AssemblyNameExtension
Forgind Sep 1, 2020
ecf24de
Serialize SystemState
Forgind Sep 1, 2020
b25d160
Opt into new serialization behavior for all serialization rather than…
Forgind Sep 2, 2020
9fa92fb
Merge branch 'master' into json-serialization
Forgind Sep 3, 2020
5608066
PR comments
Forgind Sep 4, 2020
ccb508d
Make DeserializeCache take a generic StateFileBase
Forgind Sep 8, 2020
354de87
Use FileSystems.Default.FileExists
Forgind Sep 8, 2020
fd76e0b
Convert instanceLocalFileStateCache to a dictionary
Forgind Sep 8, 2020
b1a7695
Fix generic
Forgind Sep 22, 2020
d71f2a6
Merge branch 'master' of https://github.com/dotnet/msbuild into rar-c…
Forgind Sep 22, 2020
fbe1028
Build
Forgind Sep 22, 2020
d790150
Fix bad changes
Forgind Sep 23, 2020
a759006
Added tests 1
Forgind Oct 2, 2020
767f1cc
Finish tests
Forgind Oct 6, 2020
412c21b
Create delegates to mock system calls
Forgind Oct 8, 2020
0450dd2
Merge branch 'rar-cache' of https://github.com/forgind/msbuild into j…
Forgind Oct 9, 2020
9f930f4
Small fixups
Forgind Oct 9, 2020
58217f6
Make constructor internal
Forgind Oct 9, 2020
2043c3f
PR feedback
Forgind Nov 12, 2020
853fd38
Avoid using overly new feature
Forgind Nov 12, 2020
bda6b37
Real ANE
Forgind Nov 12, 2020
a2c0f42
Merge https://github.com/dotnet/msbuild into rar-cache
Forgind Nov 12, 2020
d92e5da
Merge branch 'rar-cache' of https://github.com/forgind/msbuild into j…
Forgind Nov 12, 2020
37a7583
fixed test
Forgind Nov 12, 2020
a557722
Update versions
Forgind Nov 23, 2020
5a6851f
Merge branch 'update-versions' of https://github.com/forgind/msbuild …
Forgind Nov 23, 2020
59aaab1
Remove MVID check
Forgind Dec 4, 2020
df2d5c9
Merge branch 'rar-cache' of https://github.com/forgind/msbuild into j…
Forgind Dec 4, 2020
b2f7507
Merge branch 'json-serialization' of https://github.com/forgind/msbui…
Forgind Dec 21, 2020
11978bb
Remove precomputed cache
Forgind Dec 21, 2020
fcbeb81
Add fallback cache creation
Forgind Dec 21, 2020
2f3ed8d
PR comments
Forgind Dec 22, 2020
08aede6
Switch to async
Forgind Dec 22, 2020
01a3b56
Make tests pass
Forgind Dec 24, 2020
63f4b00
Use frameworkName
Forgind Jan 8, 2021
d50dbb4
Add comment
Forgind Jan 8, 2021
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
Prev Previous commit
Next Next commit
Make tests pass
  • Loading branch information
Forgind committed Dec 24, 2020
commit 01a3b56058ea6781ad3f9e2d65ae62a1419cf954
Original file line number Diff line number Diff line change
@@ -3089,8 +3089,6 @@ protected static bool Execute(ResolveAssemblyReference t, bool buildConsistencyC
Assert.Equal(cache, t.FilesWritten[0].ItemSpec);
}

File.Delete(t.StateFile);

// Check attributes on resolve files.
for (int i = 0; i < t.ResolvedFiles.Length; i++)
{
@@ -3113,6 +3111,11 @@ protected static bool Execute(ResolveAssemblyReference t, bool buildConsistencyC
{
FileUtilities.DeleteNoThrow(rarCacheFile);
}

if (File.Exists(t.StateFile))
{
FileUtilities.DeleteNoThrow(t.StateFile);
}
}
return succeeded;
}
8 changes: 4 additions & 4 deletions src/Tasks/AssemblyDependency/ResolveAssemblyReference.cs
Original file line number Diff line number Diff line change
@@ -1859,7 +1859,7 @@ private void LogConflict(Reference reference, string fusionName, StringBuilder l
/// <summary>
/// Reads the state file (if present) into the cache. If not present, attempts to read from CacheInputPaths, then creates a new cache if necessary.
/// </summary>
internal async void ReadStateFile(GetLastWriteTime getLastWriteTime, AssemblyTableInfo[] installedAssemblyTableInfo)
internal async void ReadStateFile()
{
var deserializeOptions = new JsonSerializerOptions() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
deserializeOptions.Converters.Add(new SystemState.Converter());
@@ -1877,8 +1877,6 @@ internal async void ReadStateFile(GetLastWriteTime getLastWriteTime, AssemblyTab
}

_cache ??= new SystemState();
_cache.SetGetLastWriteTime(getLastWriteTime);
_cache.SetInstalledAssemblyInformation(installedAssemblyTableInfo);
}

/// <summary>
@@ -2123,7 +2121,9 @@ ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader
}

// Load any prior saved state.
ReadStateFile(getLastWriteTime, installedAssemblyTableInfo);
ReadStateFile();
_cache.SetGetLastWriteTime(getLastWriteTime);
_cache.SetInstalledAssemblyInformation(installedAssemblyTableInfo);

// Cache delegates.
getAssemblyName = _cache.CacheDelegate(getAssemblyName);