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

FStarC.Util: make sure executable_name and exec_dir point to concrete… #3697

Merged
merged 1 commit into from
Jan 24, 2025
Merged
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
9 changes: 7 additions & 2 deletions src/ml/bare/FStarC_Util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,13 @@ let incr r = r := Z.(!r + one)
let decr r = r := Z.(!r - one)
let geq (i:int) (j:int) = i >= j

let exec_name = Sys.executable_name
let get_exec_dir () = Filename.dirname (Sys.executable_name)
(* Note: If F* is called invoked via a symlink, executable_name contains
the name of the unresolved link in macos (not so in Linux). Since
F* needs to find its library relative to the path of its installed
executable, we must resolve all links, so we use realpath. *)
let exec_name = Unix.realpath Sys.executable_name

let get_exec_dir () = Filename.dirname exec_name
let get_cmd_args () = Array.to_list Sys.argv
let expand_environment_variable x = try Some (Sys.getenv x) with Not_found -> None

Expand Down
Loading