Repository navigation
Conversation
|
I'm going to park this one until we have settled on a path in #638. Also, upgrades between 10.x must always be backwards compatible and |
|
Ok.. but why this shouldn't be backwards compatible? The one and only reason for this is to stay without breaking changes (or in other words: be prepared for .NET 10.0.400 SDK upgrade in consumer projects) I did this for two projects to be able to move forward to 10.0.400. |
I don't understand your point. It's just that I want to make sure that we're not going to misuse |
|
😆 Ok.. I don't get it either, because it is no breaking change in the v10 stream, but a potential breaking change (which this could prevent) in the consumer's repos when upgrading to 10.0.400.. |
|
Getting back to this PR, the way I interpret it is that it doesn't solve the problem unless people use And I don't see the "pin" this PR talks about. So can we just do what I suggested here so that people bumping the Fallout packages from 10.4 to 10.5 will get the fix automatically? |
|
Line 331-336 adds the pin with a descriptive comment |
Sure, if this works :) |
That's
Why the smiley? You don't think that will work? |
|
Hmm.. not sure. Because of the .netstandard2.0 "burden". Otherwise, everything netstandard2.0 related here makes no sense. |
dennisdoomen
left a comment
There was a problem hiding this comment.
Did some testing. After #677, the pin isn't necessary anymore. But we could still have this migration step to remove it when people upgrade to version 10.5 or higher. However, it needs to become a separate step. That RewriteCsprojsStep is already exploding.
|
ok.. should I also remove explicit pins for |
0750890 to
44beaee
Compare
Why would they break compilation? |
Hmm.. true, but still unnecessary though. Remove or leave alone? |
If people have been adding it to work around the .NET 10.0.400 issue, it might be nice to have |
|
So, not like now, but a v11 migration only? |
Yes, as the migration tool is only expected to be used to migrate from Nuke->Fallout or between major Fallout versions. |
This only runs for v11 or later
NuGet.Framework for .NET SDK 10.0.400; auto-remove on future major versionsNuGet.* version pins on future major versions
dennisdoomen
left a comment
There was a problem hiding this comment.
🔧🤖 The PR description still describes inserting a delete-at-v11 marker block into _build.csproj, but the PR now only removes pins. Please rewrite it for the two removal steps and their version gating.
| /// </summary> | ||
| internal sealed class RemoveNugetFrameworkPinStep : IMigrationStep | ||
| { | ||
| private static readonly Regex explicitPinPattern = new( |
There was a problem hiding this comment.
🔧 Add a human-friendly explanation to the Regex, e.g. something like
/// <summary>
/// Finds a whole line with a self-closing <c><PackageReference></c>
/// for <c>NuGet.Frameworks</c> that has a <c>Version</c> attribute.
/// </summary>
/// <remarks>
/// The match includes leading spaces, trailing spaces, and the line break.
/// Replace it with an empty string to remove the line.
/// The tag must be on one line and must end with <c>/></c>.
/// <c>Include</c> and <c>Version</c> can appear in any order.
/// Use this with <see cref="RegexOptions.Multiline"/>.
/// The match is case-sensitive.
/// </remarks>|
|
||
| namespace Fallout.Migrate.Steps; | ||
|
|
||
| /// <summary> |
There was a problem hiding this comment.
🔧🤖 The summary lists Framework, Protocol, Packaging and Resolver, but the regex only removes NuGet.Frameworks. Fix the text.
| RegexOptions.Compiled | RegexOptions.Multiline); | ||
|
|
||
| /// <inheritdoc /> | ||
| public Task ExecuteAsync(MigrationContext context, Summary summary) |
| /// <inheritdoc /> | ||
| public Task ExecuteAsync(MigrationContext context, Summary summary) | ||
| { | ||
| foreach (var path in MigrationFileOperations.EnumerateFiles(context.RootDirectory, "*.csproj")) |
There was a problem hiding this comment.
❓🤖 This scans every *.csproj, so a library that uses NuGet.Frameworks directly loses its reference. Is that intended, or should it only touch _build.csproj? Same for RemoveRelatedNugetPinsStep.
| /// </summary> | ||
| internal sealed class RemoveNugetFrameworkPinStep : IMigrationStep | ||
| { | ||
| private static readonly Regex explicitPinPattern = new( |
| return Task.CompletedTask; | ||
| } | ||
|
|
||
| private static bool RunsFor(string version) |
There was a problem hiding this comment.
🔧🤖 RunsFor has no docs. Say what it returns for null or unparseable input. Same for MinimumFalloutMajor.
fallout-migratenow pinsNuGet.Framework7.9.0 on 10.x build projects, and removes that pin when the target Fallout major matches or moves beyond the marker.I chose the marker version v11 because of various comments mentioning this version upgrade in that major version.
If someone feels to leave it until v12, please ping me on that one.
Changes
RewriteCsprojsStepinserts this block into the firstItemGroupof only the_build.csproj:v11in the marker is the next major afterMigrationContext.FalloutVersion(the versionfallout-migrateresolved for this run).:startthrough:end.Why?
.NET SDK 10.0.400 loads
NuGet.Frameworks7.9.0.0 while evaluating the build project. Without an explicit pin, MSBuild fails when calling e.g.Solution.MyProject.GetTargetFrameworks(). The pin is only needed on the 10.x line. The marker tellsfallout-migrateto drop the block on v11 so consumers do not have to edit the csproj by hand.Proposed workaround migration for #638