Skip to content

Commit

Permalink
[main] Update dependencies from dotnet/arcade (#8308)
Browse files Browse the repository at this point in the history
* Update dependencies from https://github.com/dotnet/arcade build 20240820.6

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24416.2 -> To Version 9.0.0-beta.24420.6

* Update dependencies from https://github.com/dotnet/arcade build 20240821.2

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24420.6 -> To Version 9.0.0-beta.24421.2

* Use ReaderWriterLockSlim

* Update dependencies from https://github.com/dotnet/arcade build 20240821.7

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24421.2 -> To Version 9.0.0-beta.24421.7

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jason Zhai <v-wuzhai@microsoft.com>
  • Loading branch information
3 people committed Aug 23, 2024
1 parent 6d4ae0b commit 806e55c
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 15 deletions.
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24416.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24421.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8fe02bab989df1265eee225df2c28af6dbdccc83</Sha>
<Sha>c28c6307d0600513219bcd9ab028c0fedbe591ec</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24416.2">
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24421.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8fe02bab989df1265eee225df2c28af6dbdccc83</Sha>
<Sha>c28c6307d0600513219bcd9ab028c0fedbe591ec</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="System.Formats.Asn1" Version="8.0.1">
Expand Down
2 changes: 1 addition & 1 deletion eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ if ($dotnet31Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
}

$dotnetVersions = @('5','6','7','8')
$dotnetVersions = @('5','6','7','8','9')

foreach ($dotnetVersion in $dotnetVersions) {
$feedPrefix = "dotnet" + $dotnetVersion;
Expand Down
2 changes: 1 addition & 1 deletion eng/common/SetupNugetSources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if [ "$?" == "0" ]; then
PackageSources+=('dotnet3.1-internal-transport')
fi

DotNetVersions=('5' '6' '7' '8')
DotNetVersions=('5' '6' '7' '8' '9')

for DotNetVersion in ${DotNetVersions[@]} ; do
FeedPrefix="dotnet${DotNetVersion}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ steps:
is1ESPipeline: true

${{ each parameter in parameters }}:
${{ parameter.key }}: ${{ parameter.value }}
${{ parameter.key }}: ${{ parameter.value }}
2 changes: 1 addition & 1 deletion eng/common/templates/steps/get-federated-access-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ steps:
is1ESPipeline: false

${{ each parameter in parameters }}:
${{ parameter.key }}: ${{ parameter.value }}
${{ parameter.key }}: ${{ parameter.value }}
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"tools": {
"dotnet": "9.0.100-preview.5.24307.3"
"dotnet": "9.0.100-preview.7.24407.12"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24416.2"
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24421.7"
}
}
36 changes: 31 additions & 5 deletions src/Microsoft.TemplateEngine.Utils/InMemoryFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ public FileSystemDirectory(string name, string fullPath)

private class FileSystemFile
{
private readonly object _sync = new();
private readonly ReaderWriterLockSlim _lock = new();
private byte[] _data;
private int _currentReaders;
private int _currentWriters;
Expand All @@ -798,15 +798,31 @@ public Stream OpenRead()
throw new IOException("File is currently locked for writing");
}

lock (_sync)
_lock.EnterReadLock();
try
{
if (_currentWriters > 0)
{
throw new IOException("File is currently locked for writing");
}

++_currentReaders;
return new DisposingStream(new MemoryStream(_data, false), () => { lock (_sync) { --_currentReaders; } });
return new DisposingStream(new MemoryStream(_data, false), () =>
{
_lock.EnterWriteLock();
try
{
--_currentReaders;
}
finally
{
_lock.ExitWriteLock();
}
});
}
finally
{
_lock.ExitReadLock();
}
}

Expand All @@ -822,7 +838,8 @@ public Stream OpenWrite()
throw new IOException("File is currently locked for writing");
}

lock (_sync)
_lock.EnterWriteLock();
try
{
if (_currentReaders > 0)
{
Expand All @@ -838,16 +855,25 @@ public Stream OpenWrite()
MemoryStream target = new();
return new DisposingStream(target, () =>
{
lock (_sync)
_lock.EnterWriteLock();
try
{
--_currentWriters;
_data = new byte[target.Length];
target.Position = 0;
_ = target.Read(_data, 0, _data.Length);
LastWriteTimeUtc = DateTime.UtcNow;
}
finally
{
_lock.ExitWriteLock();
}
});
}
finally
{
_lock.ExitWriteLock();
}
}
}

Expand Down

0 comments on commit 806e55c

Please sign in to comment.