Skip to content

nuget.exe pack doesn't allow a pre-release tag which begins with numbers #1743

Closed

Description

@kevinkuszyk

I was expecting the following command to work:

nuget pack ClassLibrary1.csproj /version 1.0.0-123-foo

But it doesn't. This is the output using the latest (v3.2.0) nuget.exe:

MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
Attempting to build package from 'ClassLibrary1.csproj'.
Packing files from 'C:\Projects\ClassLibrary1\ClassLibrary1\bin\Debug'.
Using 'ClassLibrary1.nuspec' for metadata.
'1.0.0-123-foo' is not a valid version string.
Parameter name: version

From readying the semver specs, I think this should be allowed. From semver v1:

A pre-release version number MAY be denoted by appending an arbitrary string immediately following the patch version and a dash. The string MUST be comprised of only alphanumerics plus dash [0-9A-Za-z-]. Pre-release versions satisfy but have a lower precedence than the associated normal version. Precedence SHOULD be determined by lexicographic ASCII sort order. For instance: 1.0.0-alpha1 < 1.0.0-beta1 < 1.0.0-beta2 < 1.0.0-rc1 < 1.0.0.

And semver v2:

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.

Activity

  1. added this to the milestone on Nov 20, 2015
  2. added
    Priority:3
    help wanted
    on Nov 20, 2015
  3. yishaigalatzer commented on Nov 20, 2015

    @yishaigalatzer

    Sounds like something we might fix, after cleaning several higher priority issues. If you think this is something you need earlier, we will gladly take a pull request.

  4. kevinkuszyk commented on Nov 25, 2015

    @kevinkuszyk
    Author

    Thanks @yishaigalatzer. Can you re-open the issue? I will take a look at it when I get some time.

  5. yishaigalatzer commented on Nov 25, 2015

    @yishaigalatzer

    Sorry closed by accident

  6. Lette commented on Nov 26, 2015

    @Lette

    I got the same issue, I think. In my AssemblyInfo.cs, I have AssemblyInformationalVersion("1.2.3-beta.1"). nuget pack project.csproj silently fails and picks up the AssemblyVersion instead. If I explicitly use -version 1.2.3-beta.1, nuget pack fails with '1.2.3-beta.1' is not a valid version string.

    Using 1.2.3-beta in the attribute or on the -version parameter works.

    I'm pretty sure I'm not violating SemVer 2.0.0, which @kevinkuszyk quoted above.

    Any progress on this? (I might be able to help out, if help is needed.)

  7. yishaigalatzer commented on Nov 26, 2015

    @yishaigalatzer

    @Lette This new report seems unrelated. Note we only support semver1 at the moment so you need to use 1.0-beta0001 or something like that.

    We of course will gladly take a fix for the item above.

  8. Lette commented on Nov 26, 2015

    @Lette

    All right. So, we need SemVer 2 support. Do you know of any specific difficulties regarding this? If all that needs to be done is parsing/validation of the version string, then I guess it's pretty straightforward..?

  9. yishaigalatzer commented on Nov 26, 2015

    @yishaigalatzer

    It's a lot more complex, and we decided to put support for semver2 in the upcoming release on hold for now. We will get back to it at some point

  10. Lette commented on Nov 26, 2015

    @Lette

    OK, but correcting the OPs problem with semver 1 is still doable, right?

  11. yishaigalatzer commented on Nov 26, 2015

    @yishaigalatzer

    What does op mean?

  12. 2 remaining items

  13. yishaigalatzer commented on Nov 26, 2015

    @yishaigalatzer

    Thanks Jeff, yes we would like to get it fixed

  14. modified the milestones: , on Apr 19, 2016
  15. kevinkuszyk commented on Aug 23, 2016

    @kevinkuszyk
    Author

    Thanks @emgarten - I actually tried it last week and it seems to be working. I didn't want to close the issue in case it didn't make it into the RTM for any reason.

  16. emgarten commented on Aug 23, 2016

    @emgarten
    Member

    @kevinkuszyk thanks for verifying! I'll close it.

  17. self-assigned this
    on Aug 23, 2016
  18. modified the milestones: 3.5 RTM, on Aug 23, 2016
  19. added and removed
    help wanted
    on Sep 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Functionality:PackPriority:3Product:NuGet.exeType:Bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions