@ -241,14 +241,10 @@ let version_string =
Unix . time * )
Unix . time * )
let initial_analysis_time = Unix . time ()
let initial_analysis_time = Unix . time ()
(* Recursively resolve symlinks until we get something that is not a link. Executables may be
(* Resolve symlinks to get to the real executable. The real executable is located in [bin_dir]
below , which allows us to find [ lib_dir ] , [ models_dir ] , etc . , relative to it . * )
let real_exe_name =
(* Recursively resolve symlinks until we get something that is not a link. Executables may be
( multiple levels of ) symbolic links to the real binary directory , eg after ` make install ` or
( multiple levels of ) symbolic links to the real binary directory , eg after ` make install ` or
packaging . * )
packaging . * )
let rec real_path path =
let rec real_path path =
match Unix . readlink path with
match Unix . readlink path with
| link when Filename . is_relative link ->
| link when Filename . is_relative link ->
(* [path] is a relative symbolic link *)
(* [path] is a relative symbolic link *)
@ -258,7 +254,11 @@ let real_exe_name =
real_path link
real_path link
| exception Unix . Unix_error ( Unix . EINVAL , _ , _ ) ->
| exception Unix . Unix_error ( Unix . EINVAL , _ , _ ) ->
(* [path] is not a symbolic link *)
(* [path] is not a symbolic link *)
path in
path
(* Resolve symlinks to get to the real executable. The real executable is located in [bin_dir]
below , which allows us to find [ lib_dir ] , [ models_dir ] , etc . , relative to it . * )
let real_exe_name =
real_path Sys . executable_name
real_path Sys . executable_name
let current_exe =
let current_exe =
@ -418,10 +418,10 @@ let init_work_dir, is_originator =
else
else
Sys . getcwd ()
Sys . getcwd ()
with _ ->
with _ ->
Sys . getcwd ()
Sys . getcwd () in
in
let real_cwd = real_path cwd in
Unix . putenv " INFER_CWD " cwd ;
Unix . putenv " INFER_CWD " real_ cwd;
( cwd, true )
( real_ cwd, true )
(* * Resolve relative paths passed as command line options, i.e., with respect to the working
(* * Resolve relative paths passed as command line options, i.e., with respect to the working
directory of the initial invocation of infer . * )
directory of the initial invocation of infer . * )