infra icon indicating copy to clipboard operation
infra copied to clipboard

ce_install github with prefix fails on first run

Open mattgodbolt opened this issue 5 years ago • 2 comments

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 "<string>", line 1, in <module>
  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.

mattgodbolt avatar Oct 19 '20 21:10 mattgodbolt

The prefix thing is mainly to handle the situations where the tgz for a release contains a folder that is not called the same. (I don't even know why that's a thing, but it's crazy annoying)

Via git these aren't a thing so you just name the target what the branch or tag is actually named.

But I don't mind if it's changed to include the prefix.

partouf avatar Oct 19 '20 21:10 partouf

Oh got it :)

mattgodbolt avatar Oct 19 '20 21:10 mattgodbolt