-
Notifications
You must be signed in to change notification settings - Fork 258
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
[.NET 9 Preview 3] no-op restore is no longer a no-op #13269
Comments
Changes: dotnet/installer@0a73f81...d070660 Changes: dotnet/runtime@dcc66a7...99b7601 Changes: dotnet/emsdk@258b51a...2d3f1fe Updates: * Microsoft.Dotnet.Sdk.Internal: from 9.0.100-preview.2.24122.3 to 9.0.100-preview.3.24126.2 * Microsoft.NETCore.App.Ref: from 9.0.0-preview.2.24122.2 to 9.0.0-preview.2.24123.1 * Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport: from 9.0.0-preview.2.24120.1 to 9.0.0-preview.2.24121.1 * Microsoft.NET.ILLink.Tasks: from 9.0.0-preview.2.24122.2 to 9.0.0-preview.2.24123.1 Other changes: * [tests] ignore `IncrementalFastDeployment` for now Context: NuGet/Home#13269 Co-authored-by: Jonathan Peppers <[email protected]>
Hey @jonathanpeppers, Where do you see that delta? The thing that determines whether a restore should happen is a nuget.dgspec.json file in the obj folder, before and after. If you can't, one of us can try to run the test locally. |
We have just one |
Yeah, I think I see a difference in the files: obj.zip Comparing the two folders with WinMerge: The problem also occurred here, maybe the diff is smaller: |
Thanks @jonathanpeppers That's really, really helpful! |
I was unable to figure out where the regression is, but I did make some progress. GetRestoreSettingsTask seems to return different values for the sources, but the inputs are the same. I was able to reproduce a duplicate nuget.config, but both with 6.9 and 6.10 of NuGet (so not a regression within the commits above). To reproduce this, I just added the same source with different ids in the nuget.config. I attempted to debug the test, but I was unable to, since it's requiring a commercial build, but I'm having a tough time making progress on that. The contributing instructions seem to be outdated: https://github.com/xamarin/xamarin-android/blob/main/Documentation/building/windows/instructions.md#running-specific-nunit-tests. I originally thought it'd be something like: NuGet/NuGet.Client#5620, but I'm still not sure why the same inputs would change the output. @jonathanpeppers Any advice you can provide here? Unfortunately the binlogs are not enough to figure out where the regression is. |
@nkolev92 it doesn't feel like the problem here would be specific to Android, but maybe just our Let me see if I can make a simpler repro with two class libraries and a console app. |
A few months ago I refactored I'm very busy with other work, that is well behind "schedule", so I haven't tried myself, but try a repro where nuget.config has two package sources with different keys, but the same url. You can also check |
I checked source deduping with 6.9 only, since I assumed that any regressions would've been introduced in 6.10, but may we already have that problem in 6.9. I'll check against 6.8. |
6.8 doesn't have any duplicate sources. So NuGet/NuGet.Client@1942c17#diff-93482a8631efd30f5df833baa903bcf342fb99a2e93cf9a3dea6a672b44d3a61L81 definitely introduced a problem. I'm still not sure why this would lead to a break in no-op though. So while that needs fixed, there's probably something else going on here. |
It's the end of my day, so I'm not going to investigate in the next few hours, but to test the hypothesis that my change broke something, you can create a console app that references NuGet.Configuration, use Settings.LoadDefaultFrom("path to android repo"), then use I think this should be an "easy" way to validate, and if it does show a difference, as long as your debugger is using microsoft's symbol server, you should be able to debug into NuGet's source. |
That's basically what I did, and meant to say in #13269 (comment). For the same set of configs, the API now returns more sources than it did in 6.8. |
@nkolev92 did you see a duplicate source in our This happened during an MSBuild integration test, perhaps it generates a |
Ok, I found: <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
...
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
...
<add key="testsource2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
</packageSources>
</configuration> |
We're making good progress here! One thing I'm having trouble understand is why the restore would change within the same version. This feels like one of those that'd be consistent within the same version, but buggy when comparing say 6.9 and 6.10 of NuGet. basically, the change we've confirmed may have regressed something, I'm not confident that's all. |
Context: NuGet/Home#13269 (comment) In 2f4e01e, we saw a problem with no-op NuGet restore, no longer being a no-op. So we temporarily disabled the failing `IncrementalFastDeployment` test. It turns out, it might be related to a duplicate source listed in our `NuGet.config` during MSBuild tests: <add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" /> <add key="testsource2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" /> This might have surfaced a bug in NuGet, but for now let's stop emitting duplicate sources?
Trying this for now: dotnet/android#8772 |
Changes: dotnet/installer@0a73f81...ac2dff8 Changes: dotnet/runtime@dcc66a7...64c3513 Changes: dotnet/emsdk@258b51a...f87c716 Updates: * Microsoft.Dotnet.Sdk.Internal: from 9.0.100-preview.2.24122.3 to 9.0.100-preview.2.24128.2 * Microsoft.NETCore.App.Ref: from 9.0.0-preview.2.24122.2 to 9.0.0-preview.2.24127.9 * Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport: from 9.0.0-preview.2.24120.1 to 9.0.0-preview.2.24123.4 * Microsoft.NET.ILLink.Tasks: from 9.0.0-preview.2.24122.2 to 9.0.0-preview.2.24127.9 Other changes: * [tests] ignore `IncrementalFastDeployment` for now Context: NuGet/Home#13269 Co-authored-by: Jonathan Peppers <[email protected]>
Context: NuGet/Home#13269 (comment) In 2f4e01e, we saw a problem with no-op NuGet restore, no longer being a no-op. So we temporarily disabled the failing `IncrementalFastDeployment` test. It turns out, it might be related to a duplicate source listed in our `NuGet.config` during MSBuild tests: <add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" /> <add key="testsource2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" /> This might have surfaced a bug in NuGet, but for now let's stop emitting duplicate sources? Additionally, use `ExtraNuGetConfigSources.Distinct ()` in case we have a test that passes in duplicate sources.
After more investigation, I think NuGet/NuGet.Client#5666 is sufficient. [Fact]
public void LoadPackageSources_DeduplicatesBasedOnValue()
{
// Arrange
using TestDirectory testDirectory = TestDirectory.Create();
const string sourceUrl = "https://contoso.test/nuget/index.json";
const string contents = $@"<configuration>
<packageSources>
<add key=""s1"" value=""{sourceUrl}"" />
<add key=""s2"" value=""{sourceUrl}"" />
</packageSources>
</configuration>
";
var path = Path.Combine(testDirectory.Path, Settings.DefaultSettingsFileName);
File.WriteAllText(path, contents);
Settings settings = new Settings(testDirectory.Path);
// Act
List<PackageSource> sources = LoadPackageSources(settings);
// Assert
sources.Should().HaveCount(1);
} Returns 2 in both the commit before Andy's change and latest dev. |
NuGet Product Used
dotnet.exe
Product Version
.NET SDK 9.0.100-preview.3.24126.2
Worked before?
.NET SDK 9.0.100-preview.2.24122.3
Impact
It's more difficult to complete my work
Repro Steps & Context
We discovered here a test failure: dotnet/android#8763
The underlying cause appears to be:
This was an incremental build with no changes to the project.
Digging deeper, the offending build seems to have some NuGet sources listed twice:
So there must be something that adds extra feeds, making the no-op restore skip? so it runs a full restore?
Verbose Logs
Here are two
.binlog
files,install2.binlog
restores as expected,install3.binlog
does not:nuget-noop.zip
The text was updated successfully, but these errors were encountered: