Skip to content

Commit

Permalink
Merge pull request #3512 from mtzguido/fix
Browse files Browse the repository at this point in the history
Fix library finding in binary package
  • Loading branch information
mtzguido authored Oct 2, 2024
2 parents 6c7225f + 1d10d76 commit ec6ff77
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
23 changes: 21 additions & 2 deletions ocaml/fstar-lib/generated/FStar_Options.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions src/basic/FStar.Options.fst
Original file line number Diff line number Diff line change
Expand Up @@ -1833,17 +1833,27 @@ let expand_include_ds (dirnames : list string) : list string =
List.collect expand_include_d dirnames
(* TODO: normalize these paths. This will probably affect makefiles since
make does not normalize the paths itself. *)
make does not normalize the paths itself. Also, move this whole logic away
from this module. *)
let lib_root () : option string =
(* No default includes means we don't try to find a library on our own. *)
if get_no_default_includes() then
None
else
(* FSTAR_LIB can be set in the environment to override the library *)
match Util.expand_environment_variable "FSTAR_LIB" with
| Some s -> Some s
| None -> Some (fstar_bin_directory ^ "/../ulib")
| None ->
(* Otherwise, try to find the library in the default locations. It's ulib/
in the repository, and lib/fstar/ in the binary package. *)
if Util.file_exists (fstar_bin_directory ^ "/../ulib")
then Some (fstar_bin_directory ^ "/../ulib")
else if Util.file_exists (fstar_bin_directory ^ "/../lib/fstar")
then Some (fstar_bin_directory ^ "/../lib/fstar")
else None
let lib_paths () =
Common.option_to_list (lib_root()) |> expand_include_ds
Common.option_to_list (lib_root ()) |> expand_include_ds
let include_path () =
let cache_dir =
Expand Down
2 changes: 1 addition & 1 deletion ulib/install-ulib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
set -x

for f in *.fst *.fsti experimental/*.fst experimental/*.fsti .cache/*.checked ml/Makefile.realized ml/Makefile.include gmake/* legacy/*.fst legacy/*.fsti Makefile.extract.fsharp fs/* fs/VS/* ; do
for f in fstar.include *.fst *.fsti experimental/*.fst experimental/*.fsti .cache/*.checked ml/Makefile.realized ml/Makefile.include gmake/* legacy/*.fst legacy/*.fsti Makefile.extract.fsharp fs/* fs/VS/* ; do
if [[ -f $f ]] ; then
"$INSTALL_EXEC" -m 644 -D -p $f $PREFIX/lib/fstar/$f
fi
Expand Down

0 comments on commit ec6ff77

Please sign in to comment.