compiler-explorer / compiler-explorer/infra

ce_install github with prefix fails on first run

Open
#425 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
434
Forks
429
Avg merge
4d 21h
Merged PRs (30d)
38

Description

With `target_prefix: v` in `clone_branch`, the first time you run you get:

```
2020-10-19 21:02:27,260 lib.installation INFO compilers/go/nightly/golang trunk: Most recent go-trunk is 20201019
Installing libraries/cuda/nightly/nvtx dev
2020-10-19 21:02:30,000 lib.installation INFO libraries/cuda/nightly/nvtx dev installed OK
Installing libraries/cuda/nvtx 3.0.1
error: pathspec '3.0.1' did not match any file(s) known to git
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/infra/bin/lib/ce_install.py", line 178, in main
if installable.install():
File "/home/ubuntu/infra/bin/lib/installation.py", line 512, in install
self.stage()
File "/home/ubuntu/infra/bin/lib/installation.py", line 491, in stage
self.clone_branch()
File "/home/ubuntu/infra/bin/lib/installation.py", line 451, in clone_branch
subprocess.check_call(['git', '-C', dest, 'checkout', '-q', self.target_name],
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', '-C', '/opt/compiler-explorer/libs/nvtx/v3.0.1', 'checkout', '-q', '3.0.1']' returned non-zero exit status 1.
```

The result is a directory called `v3.0.1` :

```
$ ls /opt/compiler-explorer/libs/nvtx/
v3.0.1/
```

the second run completes without issue.

```
Installing libraries/cuda/nvtx 3.0.1
2020-10-19 21:04:10,582 lib.installation INFO libraries/cuda/nvtx 3.0.1 is already installed, skipping
```

I was imagining the prefix would apply to the `tag` checked out, not the directory on disk? Maybe I misunderstand; that is I expected the direcotyr to be `{name}` and the tag `v{name}` but obviously I can rename. Either way, the first run doesn't complete successfully, perhaps due to confusion elsewhere.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.