-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use PackageReference for C++ dependencies #8195
Conversation
Love the overall change. @JunielKatarn do you know the min version of VS this requires? Because end-users are buildings our source in addition to CI, there's some different versions out in the wild we need to support. @asklar maintains some scripts and documentation for this that may need to be updated, if the min required version goes up. This might require those manually doing a NuGet restore to change their logic, so I'm going to label this as breaking so a callout can be added to release notes? |
from a functionality standpoint this should be transparent to users - if they need to run something differently, that'd be a problem. If they are using the CLI or VS, this should just work |
If I recall correctly, it is Visual Studio 16.9. |
packages/@react-native-windows/cli/src/runWindows/utils/build.ts
Outdated
Show resolved
Hide resolved
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.
Chatted offline with Julio about the change. E.g. what would be good to validate.
We have manual + UT validation for autolinking looking good. As part of this change, Julio will add a document to our website to guide users on any migration they may need to do. run-windows
will continue to restore NuGet packages for community modules using packages.config
out of the box.
This reverts microsoft#8195, since it looks like it added some pretty critical regressions to user scenarios. The CLI relies on a system installed `nuget.exe` to restore, This causes the CLI to crash when the user has not separately installed `nuget.exe`. It also may call an incompatible version of `nuget.exe`, since the installed system version may not be compatible. This was not picked up in CI, since we have steps to manage the NuGet binary on the machine, for us to manually restore. First restore is also failing locally. The error pointed to a GitHub issue around C++ PackageReference usage in VS. NuGet/Home#11392. The inability to restore on first usage is a known issue, that the VS team is not investing in, claiming they do not officially support C++ PackageReference. On my own dev machine, this led to errrors both trying to restore via VS, or our CLI. This is a fairly serious regression, that may block work of other engineers, and prevent us from shipping the current branch. Creating this PR to revert, unless we think we can forward-fix these issues in a short-term timeframe.
This reverts commit bcdf9ad.
See dotnet/project-system#2491 (comment)
MSBuild AND Visual Studio now support
PackageReference
dependencies for MSVC projects.Using this will significantly reduce the project file clutter and largely simplify dependency management introducing the following enhancements:
packages.config
.GlobalPackagesFolder
instead of creating local copies per repository clone, saving a fair amount of disk space (dropspackages
folder).msbuild /t:restore
).Bonus:
Note, this change should be transparent while using Visual Studio but the MSBuild CLI and the CI restore steps will be affected.
Before:
After:
Pre-merge checklist
PackageReference
.packages.config
.WinUI
2.x@asklar: (i see it's commented out now), and that opting into winui3 brings it in
WinUI
2 version by updatingExperimentalFeatures.props
.RestoreLockedMode
.Use PackageReference for C++ dependencies #8195 (comment)
Future work this PR will allow us to do after merge:
[ ] Remove the/p:RestorePackagesConfig=true
once all packages.config files are gone.Useful for mixed
PackageReference
/packages.config
projects when combined withRestoreProjectStyle=PackagesConfig
.NuGet Restore
workflows.props
files.Microsoft Reviewers: Open in CodeFlow