Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Issue with prereleases coming from nuget.semanticversion #85

Open
maxkorp opened this issue Nov 25, 2015 · 9 comments
Open

Issue with prereleases coming from nuget.semanticversion #85

maxkorp opened this issue Nov 25, 2015 · 9 comments

Comments

@maxkorp
Copy link

maxkorp commented Nov 25, 2015

So we're trying to build prerelease versions with names like 3.2.1-RC4, but nuget semver is throwing weird errors where it strips out most of the version number.

Running "create-windows-installer:latest" (create-windows-installer) task
>> System.ArgumentException: '4' is not a valid version string.
>> Parameter name: version
>>    at NuGet.SemanticVersion.Parse(String version)
>>    at Squirrel.VersionExtensions.ToSemanticVersion(String fileName)
>>    at Squirrel.ReleaseEntry.<WriteReleaseFile>b__6(ReleaseEntry x)
>>    at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
>>    at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
>>    at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
>>    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
>>    at System.String.Join(String separator, IEnumerable`1 values)
>>    at Squirrel.ReleaseEntry.WriteReleaseFile(IEnumerable`1 releaseEntries, Stream stream)
>>    at Squirrel.ReleaseEntry.WriteReleaseFile(IEnumerable`1 releaseEntries, String path)
>>    at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi)
>>    at Squirrel.Update.Program.executeCommandLine(String[] args)
>>    at Squirrel.Update.Program.main(String[] args)
>>    at Squirrel.Update.Program.Main(String[] args)
Warning: Command failed: C:\projects\GitKraken\build\node_modules\grunt-electron-installer\vendor\Update.com --releasify C:\Users\appveyor\AppData\Local\Temp\1\si1151024-2184-1gv97u2\gitkraken.3.2.1-RC4.nupkg --releaseDir C:
\projects\GitKraken\dist --loadingGif C:\projects\GitKraken\resources\win\installerImage.gif --signWithParams /a /f "C:\projects\GitKraken\vendor\windows_codesigning_cert.pfx" /p "asdf"
System.ArgumentException: '4' is not a valid version string.
Parameter name: version
   at NuGet.SemanticVersion.Parse(String version)
   at Squirrel.VersionExtensions.ToSemanticVersion(String fileName)
   at Squirrel.ReleaseEntry.<WriteReleaseFile>b__6(ReleaseEntry x)
   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.String.Join(String separator, IEnumerable`1 values)
   at Squirrel.ReleaseEntry.WriteReleaseFile(IEnumerable`1 releaseEntries, Stream stream)
   at Squirrel.ReleaseEntry.WriteReleaseFile(IEnumerable`1 releaseEntries, String path)
   at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi)
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
   at Squirrel.Update.Program.Main(String[] args)
Use --force to continue.

Aborted due to warnings.

Now, in nuget's semver specs it says soemthing like 3.2.1-RC.4 is not allowed, but something without the period in the component after the - is. This module is even splitting on that -, and removing all of the periods in the tailing component of the version to match that. It appears however that they're somehow stripping down everything before the -, and then their semver parse is stripping off the text before numbers. Is this a known issue (with nuget, squirrel, grunt-electron-installer, or commonly in end-user code)?

@anaisbetts
Copy link
Contributor

This feature was only very recently added, are you using the latest version of erry'thing?

@maxkorp
Copy link
Author

maxkorp commented Nov 25, 2015

grunt-electron-installer at 1.1.0, yeah.

@maxkorp
Copy link
Author

maxkorp commented Nov 25, 2015

So, at what point were prereleases added to nuget? It looks like the nuget in squirrel.windows hasn't really been tied to the core since may? (Forked by Haacked then, and paul has 3 new commits since then locally).

Edit: For the time being, I was able to replace the version I passed to the grunt config for the task with one replacing -RC with 000, so 3.2.1-RC4 becomes 3.2.10004. Since we keep our prereleases in a separate folder entirely, thats enough to get it working short term. Still not ideal, but it works.

@anaisbetts
Copy link
Contributor

Prereleases in NuGet have been there forever, but we recently enabled them in Squirrel.Windows (previously Squirrel used the prerelease tag for its own purposes). Atom is using the -betaN tag and we've done it as well, it's surprising that -RC doesn't work. Can you try with -beta just for funsies?

@maxkorp
Copy link
Author

maxkorp commented Nov 25, 2015

Sure thang 👍

@maxkorp
Copy link
Author

maxkorp commented Nov 25, 2015

That worked O.o

@anaisbetts
Copy link
Contributor

I think the word beta has special meaning to NuGet :-/

@maxkorp
Copy link
Author

maxkorp commented Nov 30, 2015

Well, their docs specify that pretty much whatever should be ok there. I'll play with it more, see if maybe capitalization has a role? All of their examples are lower case, now that I think of it.

@DanSantimore
Copy link

For what it's worth, I think the semanticversion.parse() regex in the nuget version being used by squirrel must be wrong, because it seems to fail whenever I use upper case. E.g., 1.0.0-QA41 fails, but 1.0.0-qa41 succeeds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants