-
Notifications
You must be signed in to change notification settings - Fork 992
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
Configure repo for Central Package Management #12175
Conversation
src/Common/tests/TestUtilities/System.Windows.Forms.Common.TestUtilities.csproj
Show resolved
Hide resolved
Unsure why its failing but:
|
The remaining problems are to do with package source mapping. I have to figure that out. |
This seems to be the remaining problem: Determining projects to restore...
D:\a\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.24473.2\tools\Tools.proj : error NU1100: Unable to resolve 'sn (>= 1.0.0)' for '.NETFramework,Version=v4.7.2'. PackageSourceMapping is enabled, the following source(s) were not considered: dotnet-eng, dotnet-public, dotnet-tools, dotnet10, dotnet10-transport, dotnet8, dotnet8-transport, dotnet9-transport, richnav, winsdk.
##[error].packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.24473.2\tools\Tools.proj(0,0): error NU1100: (NETCORE_ENGINEERING_TELEMETRY=Restore) Unable to resolve 'sn (>= 1.0.0)' for '.NETFramework,Version=v4.7.2'. PackageSourceMapping is enabled, the following source(s) were not considered: dotnet-eng, dotnet-public, dotnet-tools, dotnet10, dotnet10-transport, dotnet8, dotnet8-transport, dotnet9-transport, richnav, winsdk.
D:\a\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.24473.2\tools\Tools.proj : error NU1100: Unable to resolve 'MicroBuild.Core (>= 0.2.0)' for '.NETFramework,Version=v4.7.2'. PackageSourceMapping is enabled, the following source(s) were not considered: dotnet-eng, dotnet-public, dotnet-tools, dotnet10, dotnet10-transport, dotnet8, dotnet8-transport, dotnet9-transport, richnav, winsdk.
##[error].packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.24473.2\tools\Tools.proj(0,0): error NU1100: (NETCORE_ENGINEERING_TELEMETRY=Restore) Unable to resolve 'MicroBuild.Core (>= 0.2.0)' for '.NETFramework,Version=v4.7.2'. PackageSourceMapping is enabled, the following source(s) were not considered: dotnet-eng, dotnet-public, dotnet-tools, dotnet10, dotnet10-transport, dotnet8, dotnet8-transport, dotnet9-transport, richnav, winsdk.
D:\a\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.24473.2\tools\Tools.proj : error NU1100: Unable to resolve 'MicroBuild.Core.Sentinel (>= 1.0.0)' for '.NETFramework,Version=v4.7.2'. PackageSourceMapping is enabled, the following source(s) were not considered: dotnet-eng, dotnet-public, dotnet-tools, dotnet10, dotnet10-transport, dotnet8, dotnet8-transport, dotnet9-transport, richnav, winsdk.
##[error].packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.24473.2\tools\Tools.proj(0,0): error NU1100: (NETCORE_ENGINEERING_TELEMETRY=Restore) Unable to resolve 'MicroBuild.Core.Sentinel (>= 1.0.0)' for '.NETFramework,Version=v4.7.2'. PackageSourceMapping is enabled, the following source(s) were not considered: dotnet-eng, dotnet-public, dotnet-tools, dotnet10, dotnet10-transport, dotnet8, dotnet8-transport, dotnet9-transport, richnav, winsdk.
Failed to restore D:\a\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\10.0.0-beta.24473.2\tools\Tools.proj (in 3.35 sec).
Build FAILED. I'm not sure how to map the package sources that are (presumably) injected by a proj file from a package. |
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.
Thank you for taking a look into enabling CPM in WinForms! Just have some questions, but we would really want to take this.
src/Common/tests/TestUtilities/System.Windows.Forms.Common.TestUtilities.csproj
Show resolved
Hide resolved
The current problem is that some |
Arcade is adding an implicit reference to xunit.assert for all test projects so this PackageVersion is only needed when a non-test project references it. This conditions out the reference to avoid the NU1009 error.
Do not add a <PackageVersion /> for xunit.assert for test projects
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12175 +/- ##
===================================================
+ Coverage 75.35733% 75.43488% +0.07755%
===================================================
Files 3097 3103 +6
Lines 634294 634314 +20
Branches 46876 46876
===================================================
+ Hits 477987 478494 +507
+ Misses 152899 152402 -497
- Partials 3408 3418 +10
Flags with carried forward coverage won't be shown. Click here to find out more. |
The key challenge to overcome was implicit references. We used the following syntax (the <PackageVersion Include="xunit.assert" Version="$(XUnitAssertVersion)" Condition="'$(IsTestProject)' != 'true'" /> |
After this PR merges, feel free to remove the Asn1 references from projects @lonitra. |
Recording some more notes... I had to do two things for
What I'd really like is the following to be easier, ideally w/o touching any files:
|
@richlander could you clarify what PSM and GPF is in your previous comment? |
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.
Awesome 🥳
Both are covered at https://learn.microsoft.com/nuget/consume-packages/package-source-mapping |
<package pattern="microsoft.*" /> | ||
</packageSource> | ||
<packageSource key="dotnet-public"> | ||
<package pattern="Argon" /> |
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.
Where did this list come from? E.g., Argon
isn't used in this repo (at least explicitly).
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 is coming from
Line 18 in c9a58e9
<PackageReference Include="Verify.Xunit" Version="$(VerifyXunitVersion)" /> |
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.
The is change is noisy: 3ae1ec6. I updated to a newer/stable version of This change makes it so that Asn1 doesn't need to be added to individual projects: b03c264. It wasn't compatible with some of the references in the repo, which likely suggests that they are wrong. I expect other references are wrong/stale. CPM/PSM are much more strict than the old model. It seems like we need a way to discover stale dependencies. |
I made a bunch more changes to address feedback. How does this look @lonitra @RussKie? I also addressed most of the change at #12249 per @mmitche. I couldn't address all of that due to #12219 (comment). That seems like something good to resolve 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.
LGTM
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.
Thank you!
I wanted to learn CPM better and used this repo as a real-world target for that. If you want to merge this PR, cool. If not, that's also fine.
I used the Aspire repo as a model:
I just tested restore. It succeeds with these changes.
Thanks to @jkoritzinsky @JonDouglas for the help.
Microsoft Reviewers: Open in CodeFlow