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

Always embed git commit into --version output #1362

Merged
merged 2 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ jobs:
release: ${{ steps.config.outputs.release }}
retention-days: ${{ steps.config.outputs.retention-days }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: config
id: config
Expand Down Expand Up @@ -88,9 +89,10 @@ jobs:
VERSION: ${{ needs.config.outputs.version }}
RELEASE: ${{ needs.config.outputs.release }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -262,9 +264,10 @@ jobs:
# os: windows-2019
# continue-on-error: true # TODO: get Python client to work on Windows
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}

- uses: haskell/actions/setup@v2
with:
Expand Down Expand Up @@ -423,7 +426,9 @@ jobs:
cache-to: type=registry,ref=${{ matrix.cache }}:cache-${{ steps.common-tag.outputs.common-tag }},mode=max

- if: matrix.image == 'ghcr.io/galoisinc/cryptol-remote-api'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- if: matrix.image == 'ghcr.io/galoisinc/cryptol-remote-api'
uses: actions/setup-python@v2
Expand Down
14 changes: 3 additions & 11 deletions cry
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,17 @@ case $COMMAND in
# XXX: This is a workaround the fact that currently Cabal
# will not rebuild this file, even though it has TH code, that
# depends on the environment. For now, we temporarily modify the
# file, then build, then revert it back after build.
# file, then build, then revert it back, then build once more.

dirty_string="-- Last build $(date)"
echo "$dirty_string" >> src/GitRev.hs

if [[ -n "$RELEASE" ]]; then
sed -i.bak -e 's/^commitShortHash = .*$/commitShortHash = "UNKNOWN"/' \
-e 's/^commitHash = .*$/commitHash = "UNKNOWN"/' \
-e 's/^commitBranch = .*$/commitBranch = "UNKNOWN"/' \
-e 's/^commitDirty = .*$/commitDirty = False/' \
-e '/import qualified GitRev/d' \
src/Cryptol/Version.hs
rm -f src/Cryptol/Version.hs.bak
fi

cabal v2-build "$@" exe:cryptol

sed -i.bak "/^-- Last build/d" src/GitRev.hs
rm -f src/GitRev.hs.bak

cabal v2-build "$@" exe:cryptol
;;

haddock) echo Building Haddock documentation && cabal v2-haddock ;;
Expand Down
Loading