NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 250 forks source link

Nuget.exe install does not honor requireLicenseAcceptance #8299

Open schultetwin1 opened 5 years ago

schultetwin1 commented 5 years ago

Details about Problem

When using the command line tool nuget.exe to install nuget packages, the requiredLicenseAcceptance field in a package does not appear to do anything. No license text is ever shown.

NuGet product used: NuGet.exe

NuGet version: 5.0.2.5988

OS version: Windows 10 1903 (18362.175)

Worked before?: Not that I know of

Detailed repro steps so we can see the same problem

  1. Install a package using nuget.exe "install" command nuget.exe install -verbosity detailed Microsoft.Azure.Kinect.Sensor

  2. Expect a license acceptance to be displayed to the user. But the installation occurs with no display of the license.

Verbose Logs

Output from command

> .\nuget.exe install -verbosity detailed Microsoft.Azure.Kinect.Sensor
NuGet Version: 5.0.2.5988
Feeds used:
  https://api.nuget.org/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Installing package 'Microsoft.Azure.Kinect.Sensor' to 'C:\Users\maschu.REDMOND\Downloads'.
  GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.azure.kinect.sensor/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/microsoft.azure.kinect.sensor/index.json 253ms

Attempting to gather dependency information for package 'Microsoft.Azure.Kinect.Sensor.1.1.0' with respect to project 'C:\Users\maschu.REDMOND\Downloads', targeting 'Any,Version=v0.0'
Package Microsoft.Azure.Kinect.Sensor from source Microsoft Visual Studio Offline Packages gathered from cache.
Package Microsoft.Azure.Kinect.Sensor from source nuget.org gathered from cache.
Total number of results gathered : 2
Gathering dependency information took 36.56 ms
Summary of time taken to gather dependencies per source :
Attempting to resolve dependencies for package 'Microsoft.Azure.Kinect.Sensor.1.1.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Azure.Kinect.Sensor.1.1.0'
Resolved actions to install package 'Microsoft.Azure.Kinect.Sensor.1.1.0'
Retrieving package 'Microsoft.Azure.Kinect.Sensor 1.1.0' from 'nuget.org'.
  GET https://api.nuget.org/v3-flatcontainer/microsoft.azure.kinect.sensor/1.1.0/microsoft.azure.kinect.sensor.1.1.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.azure.kinect.sensor/1.1.0/microsoft.azure.kinect.sensor.1.1.0.nupkg 233ms
Acquiring lock for the installation of Microsoft.Azure.Kinect.Sensor 1.1.0
Acquired lock for the installation of Microsoft.Azure.Kinect.Sensor 1.1.0
Installing Microsoft.Azure.Kinect.Sensor 1.1.0.
PackageSignatureVerificationLog: PackageIdentity: Microsoft.Azure.Kinect.Sensor.1.1.0 Source: https://api.nuget.org/v3/index.json PackageSignatureValidity: True
Completed installation of Microsoft.Azure.Kinect.Sensor 1.1.0
Adding package 'Microsoft.Azure.Kinect.Sensor.1.1.0' to folder 'C:\Users\maschu.REDMOND\Downloads'
Added package 'Microsoft.Azure.Kinect.Sensor.1.1.0' to folder 'C:\Users\maschu.REDMOND\Downloads'
Added package 'Microsoft.Azure.Kinect.Sensor.1.1.0' to folder 'C:\Users\maschu.REDMOND\Downloads' from source 'https://api.nuget.org/v3/index.json'
Successfully installed 'Microsoft.Azure.Kinect.Sensor 1.1.0' to C:\Users\maschu.REDMOND\Downloads
Executing nuget actions took 1.99 sec

Contents of Microsoft.Azure.Kinect.Sensor.nuspec:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>Microsoft.Azure.Kinect.Sensor</id>
    <version>1.1.0</version>
    <authors>Microsoft</authors>
    <owners>Microsoft</owners>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <license type="file">LICENSE.txt</license>
    <licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
    <projectUrl>https://github.com/Microsoft/Azure-Kinect-Sensor-SDK</projectUrl>
    <iconUrl>https://github.com/Microsoft/Azure-Kinect-Sensor-SDK/raw/develop/docs/logo.png</iconUrl>
    <description>The Microsoft C SDK for interfacing with Azure Kinect</description>
    <copyright>© Microsoft Corporation. All rights reserved.</copyright>
    <language>en-US</language>
    <tags>native</tags>
  </metadata>
</package>
rrelyea commented 5 years ago

Don’t believe this is a regression.

nkolev92 commented 5 years ago

NuGet.exe does not have any advanced UI capabilities currently.

As @rrelyea said, not a regression.

schultetwin1 commented 5 years ago

I agree this is not a regression, but most license files do not require advanced UI capabilities. The license text could just be spit out to the console with an interactive yes/no prompt. Would that be a possibility for a future feature?

nkolev92 commented 5 years ago

//cc @karann-msft Thoughts about this ask?

@schultetwin1

That might be a solution, but can't comment further as we have not analyzed it.

Note that any sort of interactive addition to this would probably not be there by default, as we would break everyone using nuget install in their scripts on the CIs.

schultetwin1 commented 5 years ago

Note that any sort of interactive addition to this would probably not be there by default, as we would break everyone using nuget install in their scripts on the CIs.

Totally makes sense. I would be fine with a command line switch for the install command.

rrelyea commented 5 years ago

Packages can be installed via:

1) VS UI 2) VS Package Management Console -- “install-package” 3) Hand editing csproj (in VS with sdk-style projects) or in notepad, etc… 4) Dotnet add package 5) Nuget.exe install [old command…doesn’t work in all scenarios]

Today, we show licenses as part of VS UI only.