From e181cc9af03cf51ea517e7ec5f0b003b235b7457 Mon Sep 17 00:00:00 2001 From: Nikhil Swamy Date: Sun, 19 Jan 2025 21:03:51 -0800 Subject: [PATCH] remove special handling in the dependence analysis for files in the current directory --- src/basic/FStarC.Find.fst | 6 ++++++ src/parser/FStarC.Parser.Dep.fst | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/basic/FStarC.Find.fst b/src/basic/FStarC.Find.fst index a4a97963272..98b85727099 100644 --- a/src/basic/FStarC.Find.fst +++ b/src/basic/FStarC.Find.fst @@ -96,6 +96,12 @@ let include_path () = cache_dir @ lib_paths () @ include_paths @ cmd_line_file_dirs let do_find (paths : list string) (filename : string) : option string = + if BU.is_path_absolute filename then + if BU.file_exists filename then + Some filename + else + None + else let filename = BU.basename filename in try (* In reverse, because the last directory has the highest precedence. *) diff --git a/src/parser/FStarC.Parser.Dep.fst b/src/parser/FStarC.Parser.Dep.fst index 0765704fda9..2149141e3d9 100644 --- a/src/parser/FStarC.Parser.Dep.fst +++ b/src/parser/FStarC.Parser.Dep.fst @@ -471,14 +471,13 @@ let build_inclusion_candidates_list (): list (string & string) = (* Note that [BatList.unique] keeps the last occurrence, that way one can * always override the precedence order. *) let include_directories = List.unique include_directories in - let cwd = normalize_file_path (getcwd ()) in include_directories |> List.concatMap (fun d -> let files = safe_readdir_for_include d in files |> List.filter_map (fun f -> let f = basename f in check_and_strip_suffix f |> Util.map_option (fun longname -> - let full_path = if d = cwd then f else join_paths d f in + let full_path = join_paths d f in (longname, full_path)) ) )