dotnet / NuGet.BuildTasks

The build tasks used to pick up package content from project.lock.json.
MIT License
45 stars 61 forks source link

Fix finding packages in lower-case dirs on case-sensitive .. #35

Closed radical closed 7 years ago

radical commented 7 years ago

.. filesystems.

NuGet now restores packages in lower case directory names, but the build task ResolveNuGetPackageAssets constructs the path from package name and version, like:

Microsoft.NETCore.Portable.Compatibility/1.0.1

.. instead of

microsoft.netcore.portable.compatibility/1.0.1

This breaks builds on msbuild/mono on case-sensitive filesystems, eg. on Linux.

The actual on-disk path is available in the lock/assets.json file as:

"libraries": {
"Newtonsoft.Json/10.0.2": {
...
"path": "newtonsoft.json/10.0.2",
...

So, we use that to look for the package. But fallback to the old method if this "path" is not available.

dnfclas commented 7 years ago

@radical, Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request. Thanks, .NET Foundation Pull Request Bot

emgarten commented 7 years ago

@tmeschter will you take a look also?

emgarten commented 7 years ago

@radical any reason for targeting dev15.1? I see this has some merge conflicts with the dev branch, can you resolve those and target dev? I don't think this will be used otherwise.

radical commented 7 years ago

dev15.1 has more recent commits, so I thought maybe that is the "active" branch. I have opened a new PR #36 .

emgarten commented 7 years ago

@radical makes sense, I didn't realize the branching strategy had changed. @tmeschter does using dev15.1 look correct to you?

tmeschter commented 7 years ago

@emgarten @radical The change should have gone into master rather than dev15.1, which was created specifically for Dev15.1 changes. However, it probably doesn't matter.

I had to create that branch a while back because master already contained changes that weren't approved for 15.1, and so I needed a 15.1-specific branch based on what we shipped for 15.0 RTM. Ideally what we would do is merge dev15.1 back into master, and for the time being use master for changes that are going to go into the next release (15.4 or 15.5).