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

Git SHA isn't shown on cabal-head #10691

Open
ulysses4ever opened this issue Dec 31, 2024 · 10 comments · May be fixed by #10693
Open

Git SHA isn't shown on cabal-head #10691

ulysses4ever opened this issue Dec 31, 2024 · 10 comments · May be fixed by #10693

Comments

@ulysses4ever
Copy link
Collaborator

I'm getting

❯ cabal --version
cabal-install version 3.15.0.0 (commit , )
compiled using version 3.15.0.0 of the Cabal library 

with a cabal-head from a couple of days ago. Any ideas, @geekosaur?

@geekosaur
Copy link
Collaborator

hilfy Z$ unzip ../cabal-Linux-x86_64.zip 
Archive:  ../cabal-Linux-x86_64.zip
  inflating: cabal-head-Linux-x86_64.tar.gz  
hilfy Z$ ls
cabal-head-Linux-x86_64.tar.gz
hilfy Z$ tar xfz cabal-head-Linux-x86_64.tar.gz 
hilfy Z$ ls
cabal*  cabal-head-Linux-x86_64.tar.gz
hilfy Z$ ./cabal --version
cabal-install version 3.15.0.0 (commit 47db13d on HEAD, Mon Dec 30 00:27:54 2024 +0000)
compiled using version 3.15.0.0 of the Cabal library 

This is the download artifact from a recent PR (https://github.com/haskell/cabal/actions/runs/12539962957/artifacts/2370020177 from #10688). Where are you getting your build from?

@ulysses4ever
Copy link
Collaborator Author

As I said above, cabal-head. Which is https://github.com/haskell/cabal/releases/tag/cabal-head

@geekosaur
Copy link
Collaborator

Okay, this is weird.

hilfy Z$ tar xfz cabal-head-Linux-x86_64.tar.gz 
hilfy Z$ ls
 _/                                   'Jabra Evolve 65 Manual_EN_English_RevG.pdf'
 __/                                   JR.pdf
 actionlint_1.7.4_linux_amd64.tar.gz   LG-Monitor-ENG_US.pdf
 bibisco-linux-x64-2.1.0-CE.zip        manuskript-0.16.1-1.deb
 cabal*                                NETGEAR_R6400v2.cfg
 Cabal-3.14.0.0.md                     OI-hipster-gui-20240426.iso
 cabal-head-Linux-x86_64.tar.gz        op_linux_amd64_v2.30.0.zip
 cloisterbell_loop.mp3                 op.sig
 create_window.py                      _t/
 FreeBSD-14.2-RELEASE-amd64-dvd1.iso   VMware-Workstation-Full-17.6.1-24319023.x86_64.bundle
 glab_1.47.0_linux_amd64.deb           voyager-5200-ug-en-gb.pdf
 HaskellWiki-20210512195630.xml
hilfy Z$ ./cabal --version
cabal-install version 3.15.0.0 (commit ee944ea, Sun Dec 29 13:18:21 2024 +0000)
compiled using version 3.15.0.0 of the Cabal library 

(The commit corresponds to #10643)
So why isn't it working for you?

@ulysses4ever
Copy link
Collaborator Author

I'm using the static binary (I'm on NixOS and can't do otherwise). That's probably why.

@geekosaur
Copy link
Collaborator

That one is built in a container, and the tree it's built from may not have git information in it. That would cause all the git probes to fail and produce empty strings.

@ulysses4ever
Copy link
Collaborator Author

So, there are two issues in fact:

  1. it should properly fall back and don't print anything like (commit , ) if the git info isn't available
  2. it'd be good to set up the static build in a way that SHA was available, as my use case is not so exocotic (I hope) and deserves a proper support with the SHA.

The latter is debatable (unlike the former).

@geekosaur
Copy link
Collaborator

Welp.

/__w/_temp/f546cf22-56fa-4be1-9fe8-295d549754d9.sh: line 1: git: not found

Guess we need to install another package. (But then, how does actions/checkout manage to work?)

@ulysses4ever
Copy link
Collaborator Author

Yeah, that's what I gathered too. It's mysterious that the action/checkout works but that's not for us to figure. More importantly, the job already installs a bunch of packages in the beginning. So, it should be trivial to add git on the list?

@geekosaur
Copy link
Collaborator

I did that, now I'm getting a weird permission error apparently because uids inside and outside the container differ or something. More patching….

@geekosaur geekosaur linked a pull request Dec 31, 2024 that will close this issue
2 tasks
@geekosaur
Copy link
Collaborator

Alright, Alpine build seems to have git info now. Still need to have the git stuff degrade gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants