GitTools / GitVersion

From git log to SemVer in no time
https://gitversion.net/docs/
MIT License
2.87k stars 654 forks source link

[BUG]: GitVersion doesn't work from non-root user in linux #4182

Open meandrii opened 2 months ago

meandrii commented 2 months ago

Prerequisites

GitVersion package

GitHub Release

GitVersion version

2.4.3

Operating system

Linux

What are you seeing?

user@location:~$ gitversion Failed to map file. open(/usr/bin/gitversion) failed with error 13 Failure processing application bundle. Couldn't memory map the bundle file for reading. A fatal error occurred while processing application bundle

What is expected?

user@localhost:~$ gitversion Cannot find the .git directory

Steps to Reproduce

  1. install gitversion from sudo account GITVERSION_VER="6.0.2" cd tmp && wget -q \ https://github.com/GitTools/GitVersion/releases/download/${GITVERSION_VER}/gitversion-linux-x64-${GITVERSION_VER}.tar.gz \ && tar -xzvf gitversion-linux-x64-${GITVERSION_VER}.tar.gz \ && chmod +x gitversion \ && sudo cp gitversion /usr/bin \ && rm -rf gitversion-linux-x64-${GITVERSION_VER}.tar.gz
    1. try to run without sudo

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

No response

nfstein commented 1 month ago

I am hitting this as well with gitversion 6.0.2 on a redhat enterprise linux 8 machine edit: I was able to resolve by adding read permissions sudo chmod +rx <path-to-gitversion>