Compile error when outside of git
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Overview of the Issue
When compiling a `consul1.18.0` version from a source tarball instead of from within a git repository, during the `make tools` step errors like the following occur:
```
+ make tools
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
installing tool (install): github.com/hashicorp/lint-consul-retry@v1.4.0
go: downloading github.com/hashicorp/lint-consul-retry v1.4.0
installing tool: github.com/reillywatson/enumcover/cmd/enumcover@master
go: downloading github.com/reillywatson/enumcover v0.0.0-20220328132544-fca0883325c8
go: downloading golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386
installing tool (install): github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
go: downloading github.com/golangci/golangci-lint v1.55.2
go: downloading github.com/gofrs/flock v0.8.1
go: downloading github.com/fatih/color v1.15.0
go: downloading github.com/spf13/pflag v1.0.5
...
Defaulting to user installation because normal site-packages is not writeable
Collecting pre-commit
Downloading pre_commit-3.6.2-py2.py3-none-any.whl (204 kB)
Collecting nodeenv>=0.11.1
Downloading nodeenv-1.8.0-py2.py3-none-any.whl (22 kB)
Collecting identify>=1.0.0
Downloading identify-2.5.35-py2.py3-none-any.whl (98 kB)
Collecting pyyaml>=5.1
Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)
Collecting cfgv>=2.0.0
Downloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)
Requirement already satisfied: virtualenv>=20.10.0 in /usr/lib/python3.9/site-packages (from pre-commit) (20.21.1)
Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (from nodeenv>=0.11.1->pre-commit) (53.0.0)
Requirement already satisfied: platformdirs<4,>=2.3 in /usr/lib/python3.9/site-packages (from virtualenv>=20.10.0->pre-commit) (2.5.4)
Requirement already satisfied: distlib<1,>=0.3.2 in /usr/lib/python3.9/site-packages (from virtualenv>=20.10.0->pre-commit) (0.3.2)
Requirement already satisfied: filelock<4,>=3.3.1 in /usr/lib/python3.9/site-packages (from virtualenv>=20.10.0->pre-commit) (3.7.1)
Installing collected packages: pyyaml, nodeenv, identify, cfgv, pre-commit
WARNING: Value for scheme.platlib does not match. Please report this to
distutils: /home/ub/.local/lib/python3.9/site-packages
sysconfig: /home/ub/.local/lib64/python3.9/site-packages
WARNING: Additional context:
user = True
home = None
root = None
prefix = None
Successfully installed cfgv-3.4.0 identify-2.5.35 nodeenv-1.8.0 pre-commit-3.6.2 pyyaml-6.0.1
An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory?
Check the log at /home/ub/.cache/pre-commit/pre-commit.log
make: *** [Makefile:487: tools] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.W8Qnb6 (%build)
```
#### Reproduction Steps
Steps to reproduce the behavior:
1. Get and unpack vault source with `wget https://github.com/hashicorp/consul/archive/refs/tags/v1.18.0.tar.gz`
2. Assuming a sufficiently new version of go is in your PATH, follow the instructions for compiling
```
cd conusl-1.18.0
make tools
```
3.See error
### Operating system and Environment details
Server Operating System/Architecture: AlmaLinux 9/x86_64
Contributor guide
Assessment
This issue has not been assessed yet.