@Ali Caglayan , I was looking at why -boot
is not passed to coqdoc, but I'm puzzled, it seems the code should pass it, right?
coqdoc_file_flags
tries to do it
it is a laziness bug?
I'm not sure, have you gotten coqdoc to work with boot before?
Oh wait I filter that flag
yes it works if I pass the correct flags manuall
coqdoc flags are filtered because it errors on the boot flag
There should be a coqdoc_flags somewhere
let coqdoc_file_flags cctx =
let file_flags =
[ theories_flags cctx
; Command.Args.A "-R"
; Path (Path.build cctx.dir)
; A cctx.wrapper_name
]
in
[ Command.Args.Dyn
(Resolve.Memo.map
~f:(fun b -> Command.Args.S (Bootstrap.flags b))
cctx.boot_type
|> Resolve.Memo.read)
; S file_flags
]
I don't see the filter
Tho I think we need to do a bit of refactoring
thats true, but now that composition has been merged that should be easier
I propose this for now:
Coq_lib
Bootstrap.flags
take care of itYeah, but why is the flag not sent to coqdoc?
It should
Are you sure?
Can you check the actual command
I'm totally not sure
(cd _build/.sandbox/85f33dd7434aaa82f2761c47dadf4433/default/finmap && ../../install/default/bin/coqdoc -R ../coq-master/theories Coq -Q ../math-comp/mathcomp/ssreflect mathcomp.ssreflect -R . mathcomp.finmap --toc --html -d mathcomp.finmap.html finmap.v multiset.v set.v)
This resolve stuff is really brittle sometimes
can be very hard to reason about, as it happened with the bug in (env (coq ...))
Wait
theories_flags doesn't have boot does it?
We add -R Coq $path_to_coqlib
to theories flag in coq_lib
let theories_flags =
let setup_theory_flag lib =
let dir = Coq_lib.src_root lib in
let binding_flag = if Coq_lib.implicit lib then "-R" else "-Q" in
[ Command.Args.A binding_flag
; Path (Path.build dir)
; A (Coq_lib.name lib |> Coq_lib_name.wrapper)
]
in
fun t ->
Resolve.Memo.args
(let open Resolve.Memo.O in
let+ libs = t.theories_deps in
Command.Args.S (List.concat_map libs ~f:setup_theory_flag))
I suggest we move this to Bootstrap.flags
This is the code I suggest to remove:
let theories =
let open Resolve.O in
let* boot = boot in
match boot with
| None -> theories
| Some boot ->
let+ theories = theories in
(* TODO: if lib is boot, don't add boot dep *)
(* maybe use the loc for boot? *)
(Loc.none, boot) :: theories
ah wait I see the problem
let coqdoc_file_flags cctx =
let file_flags =
[ theories_flags cctx
; Command.Args.A "-R"
; Path (Path.build cctx.dir)
; A cctx.wrapper_name
]
in
[ Command.Args.Dyn
(Resolve.Memo.map
~f:(fun b -> Command.Args.S (Bootstrap.flags b))
cctx.boot_type
|> Resolve.Memo.read)
; S file_flags
]
mathcomp is not a boot lib so -boot wasn't being passed
right? Or am I misinterpreting
The code in coqc_file_flags is identical and it gets boot
Since it is composed with a boot lib, it should pass -boot everywhere
Yes, I think so
Recall that actually composition was implemented since coq lang 0.2
what was missing what the public_theories DB
so in this sense, the flags should include boot, but I think resolve is messing with our lives here...
I don't understand why you think Resolve it causing issues here
The composition Coq_lib.DB is a rewrite from 0.2 composition
Ali Caglayan said:
I don't understand why you think Resolve it causing issues here
It is a hypothesis
what's your explanantion for -boot
not appearing?
I'm having a look
Maybe this is the culprit?
let rule =
let file_flags = Context.coqdoc_file_flags cctx in
fun mode ->
let* () =
nope, false flag
I'm confused
I did a test, and -boot seems to be passed
Can you give me a dune build $target
that shows it in current Coq universe main?
No sorry I read it wrong
You're correct it is not being passed
I was looking at the output of --verbose
Last updated: Jun 03 2023 at 17:29 UTC