chocolatey / chocolatey/choco

"The use of .nupkg or .nuspec in for package name or source is known to cause issues." reports empty `nuspec` `<id />` when a `.nupkg` file was specified

Open
#2,850 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

### What You Are Seeing?

Being a novice chocolatey contributor, I follow documentation as I wanted to create a pull request for [Any plans to upgrade SetACL to the new version? · Issue #309 · bcurran3/ChocolateyPackages](https://github.com/bcurran3/ChocolateyPackages/issues/309).

So I expanded the cryptic `-dv -s .` switches from [Chocolatey Software | Building, Testing, and Pushing Your Package](https://community.chocolatey.org/courses/creating-chocolatey-packages/building-testing-and-pushing) into an understandable form in order to build and test before submitting any pull request for the above issue.

The first line after running `choco install setacl.3.1.2.0.nupkg --debug --verbose --source=.` surprised me as it did not help me into formulating the correct command (though I was happy the install did succeed).

Extract from the [full log gist](https://gist.github.com/jpluimers/a9d14b16529c1a7f5137338bff525920):

``` text
C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers\bcurran3.ChocolateyPackages\setacl>choco install setacl.3.1.2.0.nupkg --debug --verbose --source=.
The use of .nupkg or .nuspec in for package name or source is known to cause issues. Please use the package id from the nuspec `` with `-s .` (for local folder where nupkg is found).
Chocolatey v1.1.0
Chocolatey is running on Windows v 10.0.19044.0
...
```

### What is Expected?

Instead of `` I expected a `.nuspec` name, `.nuspec` filename or package name (as all three are in the `setacl.3.1.2.0.nupkg` which appears to be a [ZIP](https://en.wikipedia.org/wiki/ZIP_(file_format)) compressed Office Open XML file formats having both the source content and some extra meta-data).

### How Did You Get This To Happen? (Steps to Reproduce)

1. I forked https://github.com/bcurran3/ChocolateyPackages into https://github.com/jpluimers/bcurran3.ChocolateyPackages
2. From `C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers` I did a `git clone https://github.com/jpluimers/bcurran3.ChocolateyPackages`
3. In the directory tree `C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers\bcurran3.ChocolateyPackages\setacl` I changed the files according to the changes I documented in [Any plans to upgrade SetACL to the new version? · Issue #309 · bcurran3/ChocolateyPackages](https://github.com/bcurran3/ChocolateyPackages/issues/309)
4. Following the steps from the above documentation link, I started with `[choco pack](https://docs.chocolatey.org/en-us/create/commands/pack).` in that directory with the below output indicating that `setacl.3.1.2.0.nupkg` is the package name:

``` text
C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers\bcurran3.ChocolateyPackages\setacl>choco pack
Chocolatey v1.1.0
Attempting to build package from 'setacl.nuspec'.
Successfully created package 'C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers\bcurran3.ChocolateyPackages\setacl\setacl.3.1.2.0.nupkg'
```

If the last line had been as below, then it would have been clear to me that the package name is `setacl` and the package filename is `C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers\bcurran3.ChocolateyPackages\setacl\setacl.3.1.2.0.nupkg`

```text
Successfully created package file 'C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers\bcurran3.ChocolateyPackages\setacl\setacl.3.1.2.0.nupkg' from package `setacl` version `3.1.2.0`.
```

5. Now from a UAC elevated command prompt I ran `choco install setacl.3.1.2.0.nupkg --debug --verbose --source=.` with this output start:

``` text
C:\Users\jeroenp\Documents\Versioned\github.com\jpluimers\bcurran3.ChocolateyPackages\setacl>choco install setacl.3.1.2.0.nupkg --debug --verbose --source=.
The use of .nupkg or .nuspec in for package name or source is known to cause issues. Please use the package id from the nuspec `` with `-s .` (for local folder where
nupkg is found).
Chocolatey v1.1.0
Chocolatey is running on Windows v 10.0.19044.0
...
```

### System Details

* OS Build (In PowerShell run `[System.Environment]::OSVersion.version.tostring()`): `10.0.19044.0`
* Windows PowerShell version (Run: `$PSVersionTable`):
``` text
Name Value
---- -----
PSVersion 5.1.19041.1682
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1682
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```
* Chocolatey version (Run `choco --version`): `1.1.0`

### Output Log

Full Log Output

~~~sh
IF YOUR LOG CONTENT IS SHORT, PLACE IT HERE - WE NEED _ALL_ DETAILED OUTPUT BASED ON THE ABOVE TO BE ABLE TO PROVIDE SUPPORT (YOU WILL FIND THAT IN THE $env:ChocolateyInstall\logs\chocolatey.log between the `=====`)
IF YOUR LOG CONTENT IS LONG, PLEASE LINK TO A GIST (see https://docs.github.com/en/github/writing-on-github/editing-and-sharing-content-with-gists/creating-gists)
~~~

Full log in: https://gist.github.com/jpluimers/12154f5ce5500e1a7f3cb6a3596f0523

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the documented `choco install setacl.3.1.2.0.nupkg --debug --verbose --source=.` command and tracing the warning that prints an empty `nuspec` id. Compare it with the preceding `choco pack` output and the package contents described in the issue. Done means the warning identifies the relevant package name or id instead of displaying an empty value.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.