-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[main] Update dependencies from dotnet/runtime #17948
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
Merged
dotnet-maestro
merged 6 commits into
main
from
darc-main-355dc96c-6d24-406c-8a87-c981ebd7be22
May 31, 2021
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8e60274
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] 3726ce8
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] 425327b
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] 544faef
Update dependencies from https://github.com/dotnet/runtime build 2021…
dotnet-maestro[bot] 150c6fa
Fix issue where ASP.NET tests or tools could run on Stage 0 Microsoft…
dsplaisted 23ca01c
Fix dependency context test
dsplaisted File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Layout/toolset-tasks/AddBaseFrameworkToRuntimeConfig.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
// | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using Microsoft.Build.Framework; | ||
using Microsoft.Build.Utilities; | ||
using Microsoft.NET.Build.Tasks; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Microsoft.DotNet.Build.Tasks | ||
{ | ||
public sealed class AddBaseFrameworkToRuntimeConfig : Task | ||
{ | ||
[Required] | ||
public string RuntimeConfigPath { get; set; } | ||
|
||
[Required] | ||
public string MicrosoftNetCoreAppVersion { get; set; } | ||
|
||
public override bool Execute() | ||
{ | ||
JsonSerializer serializer = new JsonSerializer(); | ||
serializer.ContractResolver = new CamelCasePropertyNamesContractResolver(); | ||
serializer.Formatting = Formatting.Indented; | ||
serializer.DefaultValueHandling = DefaultValueHandling.Ignore; | ||
|
||
RuntimeConfig runtimeConfig; | ||
using (var sr = new StreamReader(RuntimeConfigPath)) | ||
{ | ||
runtimeConfig = serializer.Deserialize<RuntimeConfig>(new JsonTextReader(sr)); | ||
} | ||
|
||
IEnumerable<RuntimeConfigFramework> currentFrameworks = runtimeConfig.RuntimeOptions.Frameworks ?? Enumerable.Empty<RuntimeConfigFramework>(); | ||
if (runtimeConfig.RuntimeOptions.Framework != null) | ||
{ | ||
currentFrameworks = currentFrameworks.Prepend(runtimeConfig.RuntimeOptions.Framework); | ||
} | ||
|
||
if (!currentFrameworks.Any(f => f.Name.Equals("Microsoft.NETCore.App", StringComparison.OrdinalIgnoreCase))) | ||
{ | ||
var newFrameworks = currentFrameworks.Prepend(new RuntimeConfigFramework() | ||
{ | ||
Name = "Microsoft.NETCore.App", | ||
Version = MicrosoftNetCoreAppVersion | ||
}); | ||
|
||
runtimeConfig.RuntimeOptions.Framework = null; | ||
runtimeConfig.RuntimeOptions.Frameworks = newFrameworks.ToList(); | ||
|
||
using (JsonTextWriter writer = new JsonTextWriter(new StreamWriter(File.Create(RuntimeConfigPath)))) | ||
{ | ||
serializer.Serialize(writer, runtimeConfig); | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this means. The package supports
netstandard2.0
, why wouldn't that asset be used?cc @ViktorHofer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the latest build of DependencyModel now depends on System.Runtime.CompilerServices.Unsafe, and that package has a target in it blocking the build:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that explains it. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're the first one that encounters these recent changes. I plan to send out a breaking change notice later this week after I synced up with @terrajobst on the format.
Is there a reason for dotnet/sdk to still have tests that build against an unsupported version of .NETCoreApp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ViktorHofer Late reply: Generally we want the SDK to continue to build projects successfully even if they're out of support. IE when a runtime goes out of support it means it won't get updates anymore, not that suddenly the tools stop working for that runtime.