forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR is a RFC, as it is not clear what we'd like to do here. There are two choices to support libraries : - extend native Dune scope [current approach, introduced by ocaml#2053] - make Super_context aware of the existence of different scope DB Both approaches have strengths and weaknesses; the first one for example forces to extend some `Lib` internals and indeed a few checks there don't really make sense for Coq; the second approach introduces some code duplication. It seems to me that the approach this PR proposes could make more sense; code duplication could be solved by using some programming abstractions.
- Loading branch information
Showing
9 changed files
with
56 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(* This file is licensed under The MIT License *) | ||
(* (c) MINES ParisTech 2019 *) | ||
(* (c) INRIA 2020 *) | ||
(* Written by: Emilio Jesús Gallego Arias *) | ||
|
||
type t = | ||
{ db : Coq_lib.DB.t | ||
} | ||
|
||
let libs { db; _ } = db | ||
|
||
module DB = struct | ||
|
||
type scope = t | ||
type t = scope | ||
|
||
let create = | ||
let db = Coq_lib.DB.create_from_coqlib_stanzas [] in | ||
{ db } | ||
|
||
let find_by_project _t = Obj.magic 0 | ||
let find_by_dir _t = Obj.magic 0 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(* This file is licensed under The MIT License *) | ||
(* (c) MINES ParisTech 2019 *) | ||
(* (c) INRIA 2020 *) | ||
(* Written by: Emilio Jesús Gallego Arias *) | ||
|
||
open! Stdune | ||
type t | ||
|
||
(** Return the library database associated to this scope *) | ||
val libs : t -> Coq_lib.DB.t | ||
|
||
module DB : sig | ||
type scope = t | ||
type t | ||
val create : t | ||
|
||
val find_by_dir : t -> Path.Build.t -> scope | ||
val find_by_project : t -> Dune_project.t -> scope | ||
|
||
end with type scope := t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters