Open swasey opened 3 months ago
I will check next week, but there is some code to avoid loading the same file twice. So I guess this is a bug. It is possible I do put the current v file name in the uuid of the unit one accumulates, that would explain the problem.
It looks to me like accumulating files is meant to be idempotent. I give an example where it is not, using
Extra Dependency
and accumulating into an Elpi program twice from separate Coq files. (The example uses a type abbreviation and draws the Elpi typecheck error "duplicate type abbreviation".)There are several files:
progam.v
provides a trivial Elpi program (thinkderive
)library.elpi
provides some code we'll accumulate twice into the programaccumulate{1,2}.v
each importprogram
, accumulate the library into it, and typecheck the programtest_accumulate_twice.v
requiresaccumulate{1,2}.v
and cannot typecheck the programdune
sets up context (if you use dune, you'll also need a dune-project file)The files follow inline. (In case it's simpler, here's a tarball: accumulate_bug.tgz.)
(I believe there are work arounds through either accumulating databases or never duplicating effects as done in this example.)
program.v
library.elpi
accumulate1.v
accumulate2.v
(Identical to
accumulate1.v
.)test_accumulate_twice.v
dune