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

Get-Version.ps1 doesn't work in 2.2.13 #248

Closed
the-ress opened this issue Nov 7, 2018 · 11 comments
Closed

Get-Version.ps1 doesn't work in 2.2.13 #248

the-ress opened this issue Nov 7, 2018 · 11 comments
Assignees
Labels
Milestone

Comments

@the-ress
Copy link

the-ress commented Nov 7, 2018

Get-Version.ps1 fails with:

Exception calling "HelpFindLibGit2NativeBinaries" with "1" argument(s):
"Unable to find native binaries under directory: "[...]\NerdBank.GitVersioning\tools\..\build\MSBuildFull\lib\win32\x64"."

It seems 2.2.13 moved the lib directory (0da2e40), but the script wasn't updated.

@AArnott
Copy link
Collaborator

AArnott commented Nov 7, 2018

Thanks for the report. I haven't been testing the .ps1 scripts lately now that we have the nbgv dotnet CLI tool. Does that work for you?

@AArnott AArnott added the bug label Nov 7, 2018
@the-ress
Copy link
Author

the-ress commented Nov 7, 2018

The .ps1 script returns an object. With nbgv I would have to parse its output.

@AArnott
Copy link
Collaborator

AArnott commented Nov 8, 2018

True. That does make the .ps1 a bit more convenient. However you can use nbgv for that purpose as well:

nbgv get-version -f json | ConvertFrom-Json

And voila! You have a powershell object again. :)

@the-ress
Copy link
Author

the-ress commented Nov 8, 2018

Thank you, I didn't know get-version supported that.

@AArnott AArnott self-assigned this Nov 8, 2018
@heaths
Copy link
Contributor

heaths commented Nov 20, 2018

The problem is that nbgv get-version returns the wrong information. For example, it shows the build version as 3.2.0.37 while get-version.ps1 correctly shows 3.2.37. Did defaults in code change that don't necessarily agree?

My version.json file:

{
  "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
  "version": "3.3.0",
  "publicReleaseRefSpec": [
    "^refs/heads/master$"
  ],
  "cloudBuild": {
    "buildNumber": {
      "enabled": true,
      "includeCommitId": {
        "when": "nonPublicReleaseOnly",
        "where": "buildMetadata"
      }
    },
    "setVersionVariables": true
  }
}

@AArnott
Copy link
Collaborator

AArnott commented Nov 20, 2018

That's interesting. the ps1 script and the nbgv tool use exactly the same VersionOracle class to get the answers. I wonder if it's just a formatting thing.
FWIW, the version property in your version.json file looks misleading: it has a 3rd integer set to zero, but I think NB.GV ignores that. But it might be enough to throw off the nbgv tool and if so, is probably why I didn't catch it, since I'm not testing with an inert trailing .0 in my version property. @heaths if you wouldn't mind sharing your repo info with me, I can try it out.

@heaths
Copy link
Contributor

heaths commented Nov 20, 2018

I tried removing the ".0" and get the same result. See the develop branch of https://github.com/heaths/psmsi repo. Happens on an internal repo as well.

@AArnott
Copy link
Collaborator

AArnott commented Nov 24, 2018

I guess the trailing .0 isn't ignored any more anyway. NB.GV used to ignore that, but now it just moves height integer to the 4th position. Sorry I forgot about that.

Anyway, I can repro the .ps1 script failure, and also some inconsistencies in reporting versions by the various build/script/tools. So I'm working on that now.

@AArnott
Copy link
Collaborator

AArnott commented Nov 26, 2018

@heaths I tried commit a4b68111a on your repo (since your develop branch moved on since your report, evidently) and both nbgv and get-version.ps1 (after #258 and #256) report your version as 3.2.0.37, which given your version.json contains "3.2.0" appears to be the corrrect version.

For example, it shows the build version as 3.2.0.37 while get-version.ps1 correctly shows 3.2.37.

Why do you say 3.2.37 is the correct value when your version.json calls for "3.2.0" as the first three integers?

@heaths
Copy link
Contributor

heaths commented Nov 28, 2018

I did change it to "3.2", but, IIRC, may not have committed it, which would be required to make a difference in this case, right?

@AArnott
Copy link
Collaborator

AArnott commented Nov 29, 2018

Yes, in some cases at least, committing the version.json file is required.

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

No branches or pull requests

3 participants