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

GitVersion.CommandLine fails to run on Ubuntu #14

Closed
fkhoda opened this issue Jun 8, 2020 · 6 comments
Closed

GitVersion.CommandLine fails to run on Ubuntu #14

fkhoda opened this issue Jun 8, 2020 · 6 comments

Comments

@fkhoda
Copy link

fkhoda commented Jun 8, 2020

Hi,

It seems GitVersion.CommandLine is always failing when running under latest Ubuntu but not on Windows. See below.

Workflow error:

run-detectors: unable to find an interpreter for /home/runner/work/xxx/xxx/tools/GitVersion.CommandLine.5.1.2/tools/GitVersion.exe

An error occurred when executing task '__UpdateAssemblyVersionInformation'.

Error:
One or more errors occurred. (GitVersion: Process returned an error (exit code 2).)
GitVersion: Process returned an error (exit code 2).

##[error]The process 'tools/dotnet-cake' failed with exit code 1

Workflow snippet:

- name: Run the Cake script
        uses: cake-build/cake-action@v1
        with:
          script-path: build.cake
          target: Build
          verbosity: Verbose
          cake-version: ${{ matrix.cake }}
          cake-bootstrap: true

Cake script snippet:

#tool "nuget:?package=GitVersion.CommandLine&version=5.1.2"

GitVersion(new GitVersionSettings {
         UpdateAssemblyInfo = true,
         UpdateAssemblyInfoFilePath = "./src/Shared/SharedAssemblyInfo.cs",
         OutputType = GitVersionOutput.BuildServer
      });

Does the bootstrapper script takes the selected OS environment under consideration when running third-party Cake tools?

Fadil

@ecampidoglio
Copy link
Member

I've been running GitVersion (albeit an older version) using the Cake Action both on Windows and on Ubuntu without issues.

I noticed that you're running your build script using different versions of Cake:

cake-version: ${{ matrix.cake }}

Could you please post which versions of Cake you're using?

@ecampidoglio ecampidoglio added the waiting for author Waiting for the author of the issue or pull request label Jun 9, 2020
@fadil-khodabuccus-cko
Copy link

@ecampidoglio The Cake version I'm using is 0.38.1.

@ecampidoglio
Copy link
Member

Is it the only version defined in the matrix?

@fkhoda
Copy link
Author

fkhoda commented Jun 20, 2020

Hi @ecampidoglio ,

Sorry for my late reply.

Yes that's the only version I have in the script.

Have you been able to reproduce this?

Thanks..

@ecampidoglio ecampidoglio added pending investigation The issue needs to be investigated further and removed waiting for author Waiting for the author of the issue or pull request labels Jun 22, 2020
ecampidoglio added a commit that referenced this issue Jun 22, 2020
ecampidoglio added a commit that referenced this issue Jun 22, 2020
@ecampidoglio
Copy link
Member

ecampidoglio commented Jun 22, 2020

Yes, I was able to reproduce the error (cc5dee3).

It turns out that GitVersion.CommandLine is now Windows-only (GitTools/GitVersion#1908). If you want to run GitVersion on multiple operating systems, you should use GitVersion.Tool, which is a .NET Core Global Tool.

I tried it (5bc7b10) and it works like a charm:

-#tool nuget:?package=GitVersion.CommandLine&version=5.3.6
+#tool nuget:?package=GitVersion.Tool&version=5.3.6

Note that this requires Cake 0.35.0 or later, which supports .NET Core 3.0.

@ecampidoglio ecampidoglio added waiting for author Waiting for the author of the issue or pull request and removed pending investigation The issue needs to be investigated further labels Jun 22, 2020
@fkhoda
Copy link
Author

fkhoda commented Jun 24, 2020

Hi @ecampidoglio

I will change it to use GitVersion.Tool. Thanks a lot for pointing out.

Fadil

@ecampidoglio ecampidoglio removed the waiting for author Waiting for the author of the issue or pull request label Jun 24, 2020
binick added a commit to nils-a/Cake.Board that referenced this issue Oct 28, 2021
binick added a commit to cake-contrib/Cake.Board that referenced this issue Oct 28, 2021
* (maint) updated build pipeline

* Updated .NET to 3.1 in build
* Updated unit tests to target .NET 3.1
* switched from .NET Framework runner for Cake to .NET tool runner
* updated Cake to 0.38.5 in build (the last version before 1.0.0)
* Bumped build Azure Pipeline images to versions that work with Cake 0.38.5
* Bumped the reference of Cake.JSON to 5.0.0 because of Newtonsoft.JSON errors
* switched from deprecated TFBuild* commands to newer AzurePipeline commands

* added appveyor.yml

to pin the build image in appveyor

* Restore build script from https://raw.githubusercontent.com/cake-build/resources/master/dotnet-framework/build.ps1
Update BuildSystem on parameter.config

* Update ubuntu agent

* Move to GitVersion.Tool (cake-build/cake-action#14)

* Fixed ubuntu image version typo

* Upgrade build dependencies

Co-authored-by: binick <nicola.biancolini@gmail.com>
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