-
Notifications
You must be signed in to change notification settings - Fork 413
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
feature(coq): support for interproject composition of theories #5784
Conversation
Alizter
commented
May 26, 2022
•
edited by rgrinberg
Loading
edited by rgrinberg
- error messages for missing transitive deps
- error messages for private OCaml libs used as plugins for public theories
- allow_private_deps check
- delay library resolution errors until build time
- restore boot support
See my tree in my personal repos, it was at some point close to be done. |
test/blackbox-tests/test-cases/coq/compose-coq-projects.t/run.t
Outdated
Show resolved
Hide resolved
252ab2f
to
fc53f31
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
fd3dfbe
to
4aafc42
Compare
@Alizter better not to use |
@ejgallego ready for review I believe. |
A couple of things:
|
After a first quick review, this good in general, will be a game changer! Gonna do some deeper testing tho. |
051af67
to
0674f83
Compare
It seems we are close to be here, I found a small bug which you can reproduce using the https://github.com/ejgallego/coq-universe/ repos (do when the boot library is in scope |
Yeah, it seems that when compiling math-comp, the boot library is not detected properly. |
It is possible to add a test for this, I can write it, but the idea is that the test setups a theory that has prefix |
@ejgallego Looks like |
I don't see -boot being passed correctly. I'll post a build log where the problem is evident. Regarding the second point, I see there is already code in this PR to handle that case. |
@ejgallego Ah, do you mean that |
If the boot library is in scope, indeed you need to disable the automatic search path and let dune handle that, so yes, boot needs to be passed. Note that the code already is trying to do that when computing the flags. |
Sorry I was not precise, I mean that why we can't just use |
By the way, not a requirement, but I'd be cool to add a test |
For the closure it wouldn't matter (if we fix that validation issue), but I still think it's better to use the one equality function we defined as well behaved. |
Yes, we need to use a well-defined equality function. But that's the point I don't understand, why is
better behaved than
? I'm Ok with identifying Coq theories as a pair of (name,path), however we need to make this clearer in the code then, as for most purposes, the code assumes that Coq theories are identified only by name. Does it make sense? I'd be suprising for a user of |
Well, consider this setup:
Today this already works and has useful applications. Here we have two theories with the same name but we surely don't want |
Indeed, the example makes sense with private libs. The thing is that if I am correct, we have no user for So that's what got me confused, I was thinking that the more fancy compare was due to an actual use case. |
Actually, we also use it to make sure we use the same boot lib everywhere.
It's only OK if we introduce the validation I mentioned earlier. Without it, the closure will report cycles instead of giving us a proper error that we're linking two different libraries with the same name. |
5ed3228
to
4d4a3fc
Compare
The sooner we rid ourselves of (no) -boot the better.
We can do this.
The |
d35c621
to
472e707
Compare
@rgrinberg @ejgallego I did some further refactoring in a separate commit, please review and I will squash with the rest. We should merge this soon, or else I will keep adding patches. :-) |
@Alizter okay, but we need to add a test case for #5784 (comment) first. It demonstrates a real issue Emilio pointed out. It doesn't necessarily needs to be addressed right now, since we are not yet sure whether it should be dune or coqc giving the error. |
@rgrinberg Added a test. |
Co-authored-by: Rudi Grinberg <me@rgrinberg.com> Signed-off-by: Ali Caglayan <alizter@gmail.com>
Oh, that's great! Let's add this Coq's Universe CI and deploy the artifact 😈 |
Congrats on this great milestone! |
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.3.0) CHANGES: - Sandbox preprocessing, lint, and dialect rules by default. All these rules now require precise dependency specifications (ocaml/dune#5807, @rgrinberg) - Allow list expansion in the `pps` specification for preprocessing (ocaml/dune#5820, @Firobe) - Add warnings 67-69 to dune's default set of warnings. These are warnings of the form "unused X.." (ocaml/dune#5844, @rgrinbreg) - Introduce project "composition" for coq theories. Coq theories in separate projects can now refer to each other when in the same workspace (ocaml/dune#5784, @Alitzer, @rgrinberg) - Fix hint message for ``data_only_dirs`` that wrongly mentions the unknown constructor ``data_only`` (ocaml/dune#5803, @lambdaxdotx) - Fix creating sandbox directory trees by getting rid of buggy memoization (@5794, @rgrinberg, @snowleopard) - Handle directory dependencies in sandboxed rules. Previously, the parents of these directory dependencies weren't created. (ocaml/dune#5754, @rgrinberg) - Set the exit code to 130 when dune is terminated with a signal (ocaml/dune#5769, fixes ocaml/dune#5757) - Support new locations of unix, str, dynlink in OCaml >= 5.0 (ocaml/dune#5582, @dra27) - The ``coq.theory`` stanza now produces rules for running ``coqdoc``. Given a theory named ``mytheory``, the directory targets ``mytheory.html/`` and ``mytheory.tex/`` or additionally the aliases `@doc` and `@doc-latex` will build the HTML and LaTeX documentation repsectively. (ocaml/dune#5695, fixes ocaml/dune#3760, @Alizter) - Coq theories marked as `(boot)` cannot depend on other theories (ocaml/dune#5867, @ejgallego) - Ignore `bigarray` in `(libraries)` with OCaml >= 5.0. (ocaml/dune#5526, fixes ocaml/dune#5494, @moyodiallo) - Start with :standard when building the ctypes generated foreign stubs so that we include important compiler flags, such as -fPIC (ocaml/dune#5816, fixes ocaml/dune#5809).
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.4.0) CHANGES: - Make `dune describe` correctly handle overlapping implementations for virtual libraries (ocaml/dune#5971, fixes ocaml/dune#5747, @esope) - Building the `@check` alias should make sure the libraries and executables don't have dependency cycles (ocaml/dune#5892, @rgrinberg) - [ctypes] Add support for the `errno` parameter using the `errno_policy` field in the ctypes settings. (ocaml/dune#5827, @droyo) - Fix `dune coq top` when it is invoked on files from a subdirectory of the directory containing the associated stanza (ocaml/dune#5784, fixes ocaml/dune#5552, @ejgallego, @rlepigre, @Alizter) - Fix hint when an invalid module name is found. (ocaml/dune#5922, fixes ocaml/dune#5273, @emillon) - The `(cat)` action now supports several files. (ocaml/dune#5928, fixes ocaml/dune#5795, @emillon) - Dune no longer uses shimmed `META` files for OCaml 5.x, solely using the ones installed by the compiler. (ocaml/dune#5916, @dra27) - Fix handling of the `(deps)` field in `(test)` stanzas when there is an `.expected` file. (ocaml/dune#5952, ocaml/dune#5951, fixes ocaml/dune#5950, @emillon) - Ignore insignificant filesystem events. This stops RPC in watch mode from flashing errors on insignificant file system events such as changes in the `.git/` directory. (ocaml/dune#5953, @rgrinberg) - Fix parsing more error messages emitted by the OCaml compiler. In particular, messages where the excerpt line number started with a blank character were skipped. (ocaml/dune#5981, @rgrinberg) - env stanza: warn if some rules are ignored because they appear after a wildcard rule. (ocaml/dune#5898, fixes ocaml/dune#5886, @emillon) - On Windows, XDG_CACHE_HOME is taken to be the `FOLDERID_InternetCache` if unset, and XDG_CONFIG_HOME and XDG_DATA_HOME are both taken to be `FOLDERID_LocalAppData` if unset. (ocaml/dune#5943, fixes ocaml/dune#5808, @nojb)