-
Notifications
You must be signed in to change notification settings - Fork 43
AddNewNuGetConfigForDependencies: don't append to NuGet.config #497
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
base: main
Are you sure you want to change the base?
Conversation
When building VMR on darwin, I encountered this problem: > src/repos/projects/Directory.Build.targets(106,5): error MSB4018: The "AddSourceToNuGetConfig" task failed unexpectedly. > src/repos/projects/Directory.Build.targets(106,5): error MSB4018: System.Xml.XmlException->Microsoft.Build.Framework.BuildException.GenericBuildTransferredException: There are multiple root elements. Line 9, position 2.
I'm not 100% sure why there was an existing NuGet.config, and why it only happened on darwin, but not linux. I couldn't find a race in the particular msbuild run where this task is executed. |
Hi @corngood. This is a repo used for source-building the product, and we do not currently support source-building on Darwin: https://github.com/dotnet/source-build?tab=readme-ov-file#support. Please see https://github.com/dotnet/dotnet?tab=readme-ov-file#building for information on how to build the VMR (both for source-build and non-source-build scenarios). I'm going to close your PR per the above information, but please feel free to either file an issue, start a discussion, or add a follow-up comment in this PR if you'd like to continue this discussion. Thanks! |
I'm not asking for support with darwin, and I'm not sure that this problem is limited to darwin. I'm pretty sure that it's still a good change, because this code is writing a full configuration document to the file:
There's no situation where appending it would make sense. |
I see. I'll go ahead and re-open this PR. @MichaelSimons - can I get input on the above? TIA. |
@corngood, would you have a binlog that you can share from an environment which this happened? I am concerned that the RemoveNuGetConfig target may not be running. If that is the case, there could be other scenarios which your proposed fix may not address. |
Hmm, I think These paths are in the clone and don't actually exist (on a first build) until after
I think what's different on darwin is just the default case insensitive filesystem. Instead of creating NuGet.config next to the existing NuGet.Config, it appends to it. On linux with a case-sensitive filesystem I end up with both config files, and NuGet.config takes precedence. There's definitely something else that can be fixed here, but I still think this change is valid since we never want to append the nuget config. Maybe it should also be using |
Yeah, I think this could be fixed. We should be writing the NuGet config in a new temporary location rather than overwriting the existing NuGet.config. So I think that the Overwrite=true is probably incorrect, That sounds like we're attempting to write twice for some reason. Yeah, a binlog would be super helpful if you can get it. |
When building VMR on darwin, I encountered this problem:
Description
PR Checklist
If you are upgrading the version of a repo submodule, please follow this
checklist:
the upgrade. Both this PR and the PR doing the upgrade in the consuming repo
should link to that issue.
reference this version in 9.0, you should target the 9.0 branch.
in the consuming repo in a timely manner? If consuming the dependency flow of
this update takes a long time or needs to be backed out, it may require the
reversion of the upgrade in this PR. That's something we want to avoid.
After Merge
the darc subscription on the configuration from the consuming repo. Subscriptions
for release branches, for example, are typically disabled.
version upgrade, consider using a separate PR or at least changing the title of
the dependency flow PR to accurately reflect the purpose of the change. Seeing
a PR named "Upgrade IdentityModel to 8.0.1", for example, provides better
clarity than "Update dependencies from dotnet/source-build-externals".
and main branches.