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

gen_version: work when building without a git root #1198

Merged
merged 1 commit into from
Dec 19, 2019
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#### Bug fixes

+ Fix build version detection when building in the absence of a git root (#1198) (Anil Madhavapeddy)
+ Fix wrapping of or-patterns in presence of comments with `break-cases=fit` (#1167) (Jules Aguillon)
This also fixes an unstable comment bug in or-patterns
+ Fix an unstable comment bug in variant declarations (#1108) (Jules Aguillon)
Expand Down
14 changes: 8 additions & 6 deletions tools/gen_version.mlt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ let file, version =
(* file has been watermarked when building distrib archive *)
real_watermark
else
(* file has not been watermarked when building in dev git tree *)
let ic =
Unix.open_process_in "git describe --tags --dirty --always"
in
let version = input_line ic in
close_in ic ; version
try
(* file has not been watermarked when building in dev git tree *)
let ic =
Unix.open_process_in "git describe --tags --dirty --always 2>/dev/null"
in
let version = input_line ic in
close_in ic ; version
with End_of_file -> "unknown"
in
(file, version)
| _ ->
Expand Down