Skip to content
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

Fix package casing issue breaking build on Linux #16014

Closed
wants to merge 1 commit into from

Conversation

nguerrera
Copy link

Building this repo was failing for me on Linux due to nunit vs NUnit casing.

Fixed by normalizing to NUnit, matching https://www.nuget.org/packages/NUnit/

@mikeharder
Copy link
Member

mikeharder commented Oct 15, 2020

@nguerrera: Any idea why this is failing for you on Linux, but it seems to work for other people, it works on our Linux build agents, etc? Is there something special about your Linux distro or config?

@nguerrera
Copy link
Author

@mikeharder Great question and I have no idea.

This is what I have:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.403
 Commit:    9e895200cd

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  20.04
 OS Platform: Linux
 RID:         ubuntu.20.04-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.403/

Host (useful for support):
  Version: 3.1.9
  Commit:  774fc3d6a9

.NET Core SDKs installed:
  3.1.403 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.23 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.23 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.23 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

@nguerrera
Copy link
Author

Maybe something broke in a newer SDK?

@nguerrera
Copy link
Author

These are the errors without this patch:

/home/nicholg/src/azure-sdk-for-net/sdk/core/Microsoft.Azure.Core.NewtonsoftJson/tests/Microsoft.Azure.Core.NewtonsoftJson.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/digitaltwins/Azure.DigitalTwins.Core/tests/Azure.DigitalTwins.Core.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Azure.Messaging.EventHubs.Processor.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Azure.Messaging.EventHubs.Shared.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/eventhub/Azure.Messaging.EventHubs/tests/Azure.Messaging.EventHubs.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/eventgrid/Azure.Messaging.EventGrid/tests/Azure.Messaging.EventGrid.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/extensions/Microsoft.Extensions.Azure/tests/Microsoft.Extensions.Azure.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/tests/Azure.ResourceManager.DigitalTwins.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.
/home/nicholg/src/azure-sdk-for-net/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Azure.Messaging.ServiceBus.Tests.csproj : error : The package reference 'NUnit' must have a version defined in '/home/nicholg/src/azure-sdk-for-net/eng/Packages.Data.props'.

@weshaggard
Copy link
Member

Hmmm... I know we haven't moved our agents to ubuntu 20.04 yet and I know we had some interesting string comparison issues come on there so I suspect this might be related to that somehow.

@mikeharder
Copy link
Member

@nguerrera: Before you merge this, let me create a quick PR to bump our build agent to Ubuntu 20 and see if it fails there.

@mikeharder
Copy link
Member

Draft PR testing Ubuntu 20: #16016

@nguerrera
Copy link
Author

@mikeharder Hmm that passed? Which SDK version is being used?

@weshaggard
Copy link
Member

@mikeharder
Copy link
Member

@mikeharder Hmm that passed? Which SDK version is being used?

Yes, it did pass but I'm not sure what is different. Let me try on a clean Ubuntu 20.04 VM.

This might be a bug in some of our custom build logic -- maybe we are comparing case-sensitive when it should be case-insensitive? This is the source of the error message but I'm not very familiar with this code:

<Error
Text="The package reference '%(PackageReference.Identity)' must have a version defined in '$(CentralPackagesFile)'."
Condition=" '%(PackageReference.IsImplicitlyDefined)' != 'true' And '%(PackageReference.Version)' == '' "
File="$(MSBuildProjectFullPath)" />

@mikeharder
Copy link
Member

I will also update my test PR to use SDK 3.1.403 (matching the original repro).

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Key Vault and Search changes LGTM, but I echo the concern this may be a regression in the .NET toolchain (I'm not aware of other toolchains' package managers being case-sensitive).

@mikeharder
Copy link
Member

This does look like a regression in the .NET SDK:

https://dev.azure.com/azure-sdk/public/_build/results?buildId=578706&view=logs&j=b08a78d6-c9ce-53c1-53b1-9a5d436f78f6&t=756e146f-7609-5d03-4e3a-e5bd2f3174ad&l=31

The build passes on Ubuntu 20.04 with SDK 3.1.301, but fails on Ubuntu 20.04 with SDK 3.1.402. I'll run a few more tests to find exactly which OS/SDK versions trigger the issue.

@mikeharder
Copy link
Member

Also fails on Ubuntu 18.04 with SDK 3.1.402. So the Ubuntu version is not relevant. This appears to be a regression in the .NET SDK on all Ubuntu versions.

@nguerrera
Copy link
Author

cc @dsplaisted @nkolev92 Does this ring a bell?

@dsplaisted
Copy link

dsplaisted commented Oct 16, 2020

Looks like the error is coming from the CentralPackageVersions SDK. @jeffkl

Also FYI @cristinamanum @anangaur

@jeffkl
Copy link

jeffkl commented Oct 28, 2020

I'm surprised, the condition that generates the error is in MSBuild and is not file system dependent. The Microsoft.Build.CentralPackageVersions SDK relies on <PackageReference Update="NUnit" Version="1.0" /> syntax, which should be case insensitive.

FYI @rainersigwald

@jsquire
Copy link
Member

jsquire commented Nov 20, 2020

Hi @nguerrera. There hasn't been recent engagement on this PR. Would you please be so kind as to let us know if this is still an active work stream or if the PR should be closed out?

@jsquire jsquire added the no-recent-activity There has been no recent activity on this issue. label Nov 20, 2020
@pakrym
Copy link
Contributor

pakrym commented Nov 20, 2020

This change is part of #16947

Closing.

@pakrym pakrym closed this Nov 20, 2020
@nguerrera
Copy link
Author

@pakrym Thanks for taking care of that. I was out for a month.

@nguerrera nguerrera deleted the linux-build-fix branch November 30, 2020 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Configuration Azure.ApplicationModel.Configuration Azure.Core Azure.Identity Cognitive - Form Recognizer Cognitive - Text Analytics Event Grid KeyVault no-recent-activity There has been no recent activity on this issue. Search Storage Storage Service (Queues, Blobs, Files) Tables
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants