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

##[error]Error: Unable to locate executable file: 'dotnet-gitversion'. #1034

Closed
carlh98 opened this issue Feb 7, 2024 · 6 comments
Closed

Comments

@carlh98
Copy link

carlh98 commented Feb 7, 2024

Hi, on certain macOS MS-Hosted machines, when I run the following

steps:
  - task: gitversion/setup@0
    retryCountOnTaskFailure: 3
    inputs:
      versionSpec: '5.12.0'
    displayName: 'Install GitVersion'

  - task: gitversion/execute@0
    inputs:
      useConfigFile: true
      configFilePath: $(Build.SourcesDirectory)/.template.config/build/gitversion-config.yml
    displayName: 'Calculate Template Version'

I get the following as a result

Starting: Install GitVersion
==============================================================================
Task         : Setup GitVersion Task
Description  : Easy Semantic Versioning (http://semver.org/) for projects using Git
Version      : 0.10.2
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Agent: 'Azure Pipelines'

--------------------------
Acquiring GitVersion.Tool version spec: 5.12.0
--------------------------
Command: dotnet tool install GitVersion.Tool --tool-path /Users/runner/work/_temp --version 5.12.0
/Users/runner/hostedtoolcache/dotnet/dotnet tool install GitVersion.Tool --tool-path /Users/runner/work/_temp --version 5.12.0
Caching tool: GitVersion.Tool 5.12.0 x64
--------------------------
GitVersion.Tool version: 5.12.0 installed.
--------------------------
Prepending PATH environment variable with directory: /Users/runner/hostedtoolcache/GitVersion.Tool/5.12.0/x64
Finishing: Install GitVersion

Starting: Calculate Template Version
==============================================================================
Task         : Execute GitVersion Task
Description  : Easy Semantic Versioning (http://semver.org/) for projects using Git
Version      : 0.10.2
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Agent: 'Azure Pipelines'
Command: dotnet-gitversion /Users/runner/work/1/s /output json /output buildserver /config /Users/runner/work/1/s/.template.config/build/gitversion-config.yml
##[error]Error: Unable to locate executable file: 'dotnet-gitversion'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
Finishing: Calculate Template Version

Image information:
Agent machine name: 'Mac-1707230360839'
Current agent version: '3.232.3'
Operating System
macOS
12.7.3
21H1015
Runner Image
Image: macos-12
Version: 20240127.1
Included Software: https://github.com/actions/runner-images/blob/macOS-12/20240127.1/images/macos/macos-12-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20240127.1
Runner Image Provisioner
2.0.341.1+ea3907f30f87ddf37e44fa45b753abddb03811b4
Current image version: '20240127.1'

@arturcic
Copy link
Member

Could you please update the task up to version 0.11? and see if it works for you?

@carlh98
Copy link
Author

carlh98 commented Feb 29, 2024

@arturcic I have the same issue with 0.11

Starting: Calculate Template Version
==============================================================================
Task         : Execute GitVersion Task
Description  : Easy Semantic Versioning (http://semver.org/) for projects using Git
Version      : 0.11.0
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Agent: 'Azure Pipelines'
Command: dotnet-gitversion /Users/runner/work/1/s /output json /output buildserver /config /Users/runner/work/1/s/.template.config/build/gitversion-config.yml
##[error]Error: Unable to locate executable file: 'dotnet-gitversion'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
Finishing: Calculate Template Version

and with 0.12

Starting: Calculate Template Version
==============================================================================
Task         : Execute GitVersion Task
Description  : Easy Semantic Versioning (https://semver.org/) for projects using Git
Version      : 0.12.0
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Agent: 'Azure Pipelines'
Command: dotnet-gitversion /Users/runner/work/1/s /output json /output buildserver /config /Users/runner/work/1/s/.template.config/build/gitversion-config.yml
##[error]Error: Unable to locate executable file: 'dotnet-gitversion'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
Finishing: Calculate Template Version

@deadlydog
Copy link
Contributor

I'm having the same issue using the ubuntu-latest runner. You can view the GitHub Action run with the error here, and the barebones workflow file here.

I also see a similar error reported in Azure DevOps pipelines here that was never resolved.

Can you please reopen this issue, as it looks to still be a problem.

@arturcic
Copy link
Member

@deadlydog in the barebones workflow you missed the setup step that actually installs the tool. Please check this test repository we're using to test the tasks
There are .github/workflow and .azure folders with examples. Don't miss the setup action

@deadlydog
Copy link
Contributor

Ah, I see, thanks @arturcic ! That fixed my issue. For some reason when I scanned over the docs page here I was thinking that the Setup was a different action.

It may be helpful to update the execute docs example to explicitly call out at the top that the Setup step needs to be run first, and have an example workflow code that includes the checkout step, the setup step, and the execute step altogether. Since there were no examples showing using both steps together, I never realized that the execute depended on the setup.

@arturcic
Copy link
Member

That's something I want to address soon

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

No branches or pull requests

3 participants