-
Notifications
You must be signed in to change notification settings - Fork 58
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
linux static build juvix version shows UNKNOWN for hash and date #2294
Comments
It's probably because we're not fetching all the git info. To fetch all history and the tags, I'd add the following to the nightly-builds ci to corresponding places, e.g:
|
Unfortunately the fetch-depth trick doesn't work https://github.com/paulcadman/juvix-nightly-builds/actions/runs/5924999532/job/16063576847 |
Could it be that https://github.com/anoma/juvix-nightly-builds/blob/976dae867348b7bf388b501222b66616b8feda58/.github/workflows/release-nightly.yaml#L6-L9 + https://github.com/anoma/juvix-nightly-builds/blob/976dae867348b7bf388b501222b66616b8feda58/.github/workflows/release-nightly.yaml#L29 does not exactly the same as https://github.com/anoma/juvix-nightly-builds/blob/859869e0e67ead7bf88cb9e5eb82e102025a581d/.github/workflows/release-nightly.yaml#L21? I know that would be weird. But you never know... (Not only the image was changed in In anoma/juvix-nightly-builds@d0dbb42, but also these lines.) |
Thanks for looking at this. My understanding is that |
No.
on:
workflow_dispatch:
inputs:
ref:
description: "the repository ref to build"
required: true
default: "main"
type: string I do not use GitHub Actions myself. I am more of a GitLab guy... |
You mean in the second one there's a warning about default branch during |
Simply revert the If not, there might be something missing in my image. |
Related to acfoltzer/gitrev#23? |
Solution is maybe haskell/cabal#7355 (comment). In this case adding
to the cabal file. |
Good idea - I will try that. |
We would like to test to see if this is causing an issue with the gitrev dependency. See anoma/juvix#2294
This an issue with cabal install sandboxed builds, the |
Still the same... Two things:
There are no locale-related |
P.S.: The following images are more recent and already include an unsupported (= self-built), statically linked binary of Stack (v2.11.1):
P.P.S.: The Haskell Tool Stack switched to |
Great - this means we won't need to install stack when we next upgrade the LTS stackage resolver.
Well done! |
Switch to githash?: https://hackage.haskell.org/package/githash |
Maybe @snoyberg has an idea why this happens. The Haskell Tool Stack switched to githash some time ago: commercialhaskell/stack@a0276ae |
Thanks for looking into this, we're planning to remove this information from the version string to avoid these issues #2130 |
I used githash - I see this error in the container when evaluating template haskell:
https://github.com/paulcadman/juvix-nightly-builds/actions/runs/5951105777/job/16140262228 So there's a permissions issue in the container which makes the git command fail. I will try running |
This workaround fixes the issue. @benz0li I'm not sure if this is an issue with the container, or it's how permissions in containers are supposed to work? Should I raise an issue in https://github.com/benz0li/ghc-musl for this? https://github.com/paulcadman/juvix-nightly-builds/actions/runs/5951493332/job/16141415424 |
If a local build succeeds with
Rather not. |
I have not tried this locally, it's not easy for me to do this as I'm using a mac. Agreed we don't need to raise this unless it can be reproduced locally. Thanks |
My machine is a MacBook Pro. 'Docker Desktop' or Podman should do the job. And because the image is multi-arch ( |
You're right! I will try it then. |
DockerfileARG GHC_VERSION=9.4.5
ARG STACK_VERSION=2.11.1
FROM glcr.b-data.ch/commercialhaskell/ssi:${STACK_VERSION} as ssi
FROM glcr.b-data.ch/ghc/ghc-musl:${GHC_VERSION}
ARG STACK_VERSION
ENV STACK_VERSION=${STACK_VERSION}
COPY --from=ssi /usr/local/bin/stack /usr/local/bin/stack Hostdocker build -t ghc-musl-stack . docker run --rm -ti ghc-musl-stack bash Containerapk add --no-cache clang14 git clone https://github.com/anoma/juvix.git && cd juvix make runtime LIBTOOL=llvm14-ar stack install --no-install-ghc --system-ghc --ghc-options='-split-sections' --flag juvix:static ℹ️ And yes: Juvix also builds fine on/for Linux AArch64 aka |
I built locally and |
This PR replaces [gitrev](https://hackage.haskell.org/package/gitrev) with [githash](https://hackage.haskell.org/package/githash) which provides more reliable git information about the current git info, it seems to work as expected. githash originated as a fork of gitrev containing fixes snoyberg/githash#11 This PR also fixes the issue with git info detection in the linux static build. There was a permission issue in the build container that caused git cli calls to fail. Closes: * #2294 * #2130
You can clearly see the issue by looking at the nightly-build release:
https://github.com/anoma/juvix-nightly-builds/releases/tag/nightly-2023-08-11-0.4.2-UNKNOWN
The version string for the published Juvix binary is
0.4.2-UNKNOWN
, instead of0.4.2-<hash>
.Cause?
After merging #2275 we run the linux static build inside glcr.b-data.ch/ghc/ghc-musl:9.4.5. For some reason the gitrev library cannot detect the git info in the Juvix checkout as part of the build, and is substituting UNKNOWN instead.
I cannot reproduce this by running the build locally in the
ghc-musl:9.4.5
docker container (i.e when I do a manual build, the version git information is populated correctly). So the bug may come from a bad interaction between the docker container an thecheckout
action in the GitHub action build.The text was updated successfully, but these errors were encountered: