Skip to content

Commit

Permalink
Fix Nix build header: krml rev empty
Browse files Browse the repository at this point in the history
use krml -version instead of
git rev-parse HEAD in /home/build/dev/karamel/
  • Loading branch information
Antonin Reitz committed Oct 27, 2023
1 parent de6337b commit aff02d3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/Driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,11 @@ let detect_karamel () =
if not !Options.silent then
KPrint.bprintf "%sKaRaMeL home is:%s %s\n" Ansi.underline Ansi.reset krml_home;

if try Sys.is_directory (krml_home ^^ ".git") with Sys_error _ -> false then begin
let cwd = Sys.getcwd () in
Sys.chdir krml_home;
krml_rev := String.sub (read_one_line "git" [| "rev-parse"; "HEAD" |]) 0 12;
Sys.chdir cwd
end;
(* Use krml -version flag *)
krml_rev := String.sub
(read_one_line (krml_home ^^ "krml") [| "-version" |])
(String.length "KaRaMeL version: ")
12;

krmllib_dir := krml_home ^^ "krmllib";
runtime_dir := krml_home ^^ "runtime";
Expand Down

0 comments on commit aff02d3

Please sign in to comment.