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

Stop adding user-contrib, xgd dirs and COQPATH to ml loadpath #19842

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions doc/changelog/14-misc/19842-no-ml-misc-dirs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- **Changed:**
the `user-contrib`, XDG and `COQPATH` directories are not implicitly added to the ML loadpath
(`#19842 <https://github.com/coq/coq/pull/19842>`_,
by Gaëtan Gilbert).
13 changes: 6 additions & 7 deletions sysinit/coqloadpath.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ let build_stdlib_vo_path ~unix_path ~rocq_path =
let build_userlib_path ~unix_path =
let open Loadpath in
if Sys.file_exists unix_path then
let ml_path = System.all_subdirs ~unix_path |> List.map fst in
let vo_path =
{ unix_path
; coq_path = Libnames.default_root_prefix
; implicit = false
; recursive = true
} in
ml_path, [vo_path]
else [], []
[vo_path]
else []

(* LoadPath for Coq user libraries *)
let init_load_path ~coqenv =
Expand All @@ -46,12 +45,12 @@ let init_load_path ~coqenv =
else []
in
let stdlib = Boot.Env.stdlib coqenv |> Boot.Path.to_string in
let contrib_ml, contrib_vo = build_userlib_path ~unix_path:user_contrib in
let contrib_vo = build_userlib_path ~unix_path:user_contrib in

let misc_ml, misc_vo =
List.map (fun s -> build_userlib_path ~unix_path:s) (xdg_dirs @ rocqpath) |> List.split in
let misc_vo =
List.map (fun s -> build_userlib_path ~unix_path:s) (xdg_dirs @ rocqpath) in

let ml_loadpath = meta_dir @ contrib_ml @ List.concat misc_ml in
let ml_loadpath = meta_dir in
let vo_loadpath =
(* current directory (not recursively!) *)
[ { unix_path = "."
Expand Down
Loading