Skip to content

Commit

Permalink
Fix ConfigVersion failure in release archive
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Aug 18, 2022
1 parent 9e4901a commit 934e28a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
(target configVersion.ml)
(mode (promote (until-clean) (only configVersion.ml))) ; replace existing file in source tree, even if releasing (only overrides)
(deps (universe)) ; do not cache, always regenerate
(action (pipe-stdout (run git describe --all --long --dirty) (with-stdout-to %{target} (bash "xargs printf '(* Automatically regenerated, changes do not persist! *)\nlet version = \"%s\"'")))))
(action (pipe-stdout (bash "git describe --all --long --dirty || echo \"n/a\"") (with-stdout-to %{target} (bash "xargs printf '(* Automatically regenerated, changes do not persist! *)\nlet version = \"%s\"'")))))

(rule
(target configProfile.ml)
Expand Down
10 changes: 9 additions & 1 deletion src/version.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
let release = "%%VERSION_NUM%%"
let release_commit = "%%VCS_COMMIT_ID%%"

let goblint =
let commit = ConfigVersion.version in
if BatString.starts_with release "%" then
commit
else
else (
let commit =
if commit = "n/a" then (* released archive has no .git *)
release_commit
else
commit
in
Format.sprintf "%s (%s)" release commit
)

0 comments on commit 934e28a

Please sign in to comment.