aboutsummaryrefslogtreecommitdiff
path: root/Makefile.dune
AgeCommit message (Collapse)Author
2021-04-01[doc] [dune] Some tweaks from #13617Emilio Jesus Gallego Arias
Tweaks to docs that are independent / unrelated to that PR.
2021-03-03[build] Split stdlib to it's own opam package.Emilio Jesus Gallego Arias
We introduce a new package structure for Coq: - `coq-core`: Coq's OCaml tools code and plugins - `coq-stdlib`: Coq's stdlib [.vo files] - `coq`: meta-package that pulls `coq-{core,stdlib}` This has several advantages, in particular it allows to install Coq without the stdlib which is useful in several scenarios, it also open the door towards a versioning of the stdlib at the package level. The main user-visible change is that Coq's ML development files now live in `$lib/coq-core`, for compatibility in the regular build we install a symlink and support both setups for a while. Note that plugin developers and even `coq_makefile` should actually rely on `ocamlfind` to locate Coq's OCaml libs as to be more robust. There is a transient state where we actually look for both `$coqlib/plugins` and `$coqlib/../coq-core/plugins` as to support the non-ocamlfind plus custom variables. This will be much improved once #13617 is merged (which requires this PR first), then, we will introduce a `coq.boot` library so finally `coqdep`, `coqchk`, etc... can share the same path setup code. IMHO the plan should work fine.
2020-05-04[dune] [doc] TweaksEmilio Jesus Gallego Arias
Close #12167
2020-04-13dune states target: respect user's global verbosity settingGaëtan Gilbert
2020-04-11[dune] [doc] Remove the quick targets in favor of the shims.Emilio Jesus Gallego Arias
These targets are redundant with the shims. We also improve the documentation quite a bit.
2020-04-11[dune] [stdlib] Build the standard library natively with Dune.Emilio Jesus Gallego Arias
This completes a pure Dune bootstrap of Coq. There is still the question if we should modify `coqdep` so it does output a dependency on `Init.Prelude.vo` in certain cases. TODO: We still double-add `theories` and `plugins` [in coqinit and in Dune], this should be easy to clean up. Setting `libs_init_load_path` does give a correct build indeed; however we still must call this for compatibility?
2020-03-24Fix world and watch targets of Makefile.dune now that doc has install rules.Théo Zimmermann
2020-03-22Merge PR #11855: Build and install refman with Dune.Emilio Jesus Gallego Arias
Ack-by: SkySkimmer Reviewed-by: ejgallego
2020-03-20Build and install refman with Dune.Théo Zimmermann
2020-03-19[ocamformat] Update to 0.13.0Emilio Jesus Gallego Arias
We include the `version=0.13.0` field that should help users not to use the wrong version. `disable=true` still seems a noop with `dune`. There are some minor changes in the way comments are formatted; I'm unsure if this is due to the `wrap-comments` option; as always; tweaks to the config are most welcome.
2020-01-22[lint] Use makefile wrapper instead of calling dune command directly.Emilio Jesus Gallego Arias
This is necessary until we get of the voboot step. See https://github.com/coq/coq/pull/11406#issuecomment-577261843 for more details.
2019-12-16[dune] Use a special directory for the boot buildEmilio Jesus Gallego Arias
This is related to and fixes #10694 in part. When calling bootstrap in an incremental build step, we must be sure the generated dune files are in place. In the CI, these won't be in place, so we must bootstrap without altering the digest and trace database coming from the artifact. Using a separate boot step to recreate the missing `dune` files works fine and takes just a few seconds.
2019-09-20[ci] Remove OCaml "trunk" CI jobs.Emilio Jesus Gallego Arias
It will take non-trivial effort to make Coq work with OCaml >= 4.10.0.
2019-05-21Fixing typos - Part 1JPR
2019-03-28[dune] Don't regenerate ltac/dune after bootstrapping.Emilio Jesus Gallego Arias
Once we have the good `plugins/ltac/dune` in place for bootstrapping, we should not regenerate it. Thanks to @maximedenes for the report. This fixes `make states` always rebuilding ltac's dependencies.
2019-03-03[dune] Shim for starting `coqtop/coqide` with minimal config.Emilio Jesus Gallego Arias
As requested by Gaëtan Gilbert, we add shims - `dev/shim/coqtop-prelude` - `dev/shim/coqide-prelude` that will build and start `coqtop` and `coqide` with just the prelude loaded properly. `dune exec dev/shim/coqtop-prelude` will build and execute this shim, equivalent to doing `make states && bin/coqtop` under the old model. This PR is just a bit of "a hack" until proper support for Coq libraries arrives to Dune, however there is nothing wrong with it. In particular, we must bootstrap `coq.plugins.ltac` as Dune needs to compute the full installation path to allow `%{bin:foo}` in deps, [this is a kind of shortcoming of the current implementation, and the error message is just terrible] We cannot depend on installed `.vo` files without doing a gross hack [including them inside an ml lib] so for now we just depend on their non-installed forms. Using `%{bin}` is good enough for the shims who would like to locate binaries using `PATH`. The long term plan (for now) is to have a command similar to `dune utop $dir`, `dune coqtop $dir`, which would spawn a proper Coq shell with the corresponding libraries on the path. This will work for `dir=stdlib/Init/` for example, or for any other combination.
2019-03-01[dune] Add quickide target for building of IDE.Emilio Jesus Gallego Arias
Note that `states` doesn't work reliably yet, but that is a separate problem that will be fixed in Dune 1.6. [Or we could also fix it improving the rules in envars.ml]
2019-02-26[dune] Simple rule to generate Stdlib's documentation.Emilio Jesus Gallego Arias
Ideally this will be handled by Dune's native library support, but this could be useful for the likes of #9648. I am not sure what should be done w.r.t. style files.
2019-02-20[azure] [ci] Build on Windows using Dune.Emilio Jesus Gallego Arias
We may want to keep the make-based and Dune job, however the make-based setup is tested by the INRIA workers so it may not be needed. In order for some test to run well, we always run in Dune with an absolute path. The easiest way to get a portable absolute path is to use OCaml itself so we introduce a small executable to do that. While we are at it, we do some cleanup of the test-suite `dune` file, in particular we remove useless comments, set `--no-buffer` so results can be seen in real time, and recognize the `NJOBS` variable as we have moved to a Dune version that supports env vars.
2019-02-07[dune] Fix OCaml trunk build.Emilio Jesus Gallego Arias
I forgot to change the profile call; we should find some better solution but that's OK for now.
2019-02-04[dune] Fix Dune build in Windows.Emilio Jesus Gallego Arias
In order for Dune to work in Windows we need to tweak some script calls, they need a POSIX shell and the `(run ...)` / `(system ...)` actions use `cmd.exe` on Windows. Hopefully, we will rely less on `bash` when Dune can understand Coq libraries. This affects shell scripts in `kernel/**.sh` for example. It is interesting to see how faster the Coq Windows build is with Dune + Windows. There are some problems with PATHs that prevent the test suite from working, these will be fixed in a future PR.
2018-12-19[dune] Add targets for Coq individual packages.Emilio Jesus Gallego Arias
2018-12-14[dune] [gitlab] Test OCaml trunk.Emilio Jesus Gallego Arias
We add a job testing the build of Coq with OCaml 4.08 [AKA `trunk`] CoqIDE is not supported in 4.08 due to missing `lablgtk`, also `oUnit` cannot be currently installed, thus we have to add a switch to the test suite to disable `unit-tests`. Many deprecation warnings happened in 4.08 so we use the `release` profile to make them not fatal. Using a 4.08 build profile would be an option too.
2018-12-13[dune] [doc] Support for building the reference manual with Dune.Emilio Jesus Gallego Arias
This is a reduced version of #8503 as to provide a way to build the reference manual with Dune. Dune 1.6 supports (experimentally) directories as targets, thus we introduce a rule that will call `sphinx` to build the manual. This only provides build, however generation of `.install` rules is not done, it will be hopefully addressed in #8503. Note that we set `expire: 1 month` for all the artifacts we build with Dune. IMHO this makes most sense as not to abuse Gitlab's hosting, however of course we could consider a different deployment strategy if wanted.
2018-11-12Merge PR #8960: [dune] Build `cmxs` files instead of `cmxa` in "quick" target.Enrico Tassi
2018-11-09Merge PR #8949: Remove checker printersEmilio Jesus Gallego Arias
2018-11-09[dune] Build `cmxs` files instead of `cmxa` in "quick" target.Emilio Jesus Gallego Arias
This fixes #8954
2018-11-09Fix dune runtest invocationGaëtan Gilbert
2018-11-08Remove checker printersGaëtan Gilbert
Now that the checker is using the regular kernel files it can also use the normal printers.
2018-11-06[dune] Add "quick" and "check" targets for fast builds.Emilio Jesus Gallego Arias
In #8900 a quicker build target is requested, this PR does provide targets towards that goal. - `check`, introduced in Dune 1.5.0, will build all ml files in a fast way, - `quick{byte,opt}`, does build a set of relevant hand-picked targets. Further improvements could come from having `coq_dune` use `coqtop.byte` when appropriate, taking advantage from https://github.com/ocaml/dune/issues/1073, and not generating rules for `.vo` files.
2018-10-11[dune] [test-suite] Support for running the test suite with Dune.Emilio Jesus Gallego Arias
2018-10-09[dune] Provide an optimized build profile with inlining reports.Emilio Jesus Gallego Arias
This satisfies a wish by @ppedrot
2018-10-02[dune] Fix couple of minor bugs in #8617Emilio Jesus Gallego Arias
I forgot to update `.PHONY` and to put the proper flags in the new workspace file.
2018-10-02Merge PR #8623: [dune] Fix PHONY target in Dune's helper makefile.Théo Zimmermann
2018-10-02[dune] Provide workspace file will all OCaml builds tested in CI.Emilio Jesus Gallego Arias
2018-10-02[dune] Fix PHONY target in Dune's helper makefile.Emilio Jesus Gallego Arias
2018-09-28[dune] Pack checker to avoid [odoc] problems + build doc for plugins.Emilio Jesus Gallego Arias
We also build documentation for plugins, for example Ltac_plugin is often used in other plugins.
2018-09-27[configure] [dune] Don't force the Dune user to set envars.Emilio Jesus Gallego Arias
In order to support sending the OPAM prefix to configure via Dune, we introduced a `COQ_CONFIGURE_PREFIX` variable. However, this had the pitfall that now the developer had to set it or else face a hanging build due to configure expecting user input. While we wait for a larger cleanup in `-prefix`, we introduce a `no-ask` option in `./configure` that will avoid this problem. If `-no-ask` is passed to `configure` no interactive question or display will be shown to the user.
2018-09-21Merge PR #8443: [opam] [dune] Fix typo + set prefix for configure.Théo Zimmermann
2018-09-21[dune] [configure] Allow to set prefix using environment variable.Emilio Jesus Gallego Arias
This is a hack to enable correct OPAM building, the medium-term plan is to avoid having to set a prefix at configure time but instead using a set of rules to locate the Coq library. We use `(env_var ...)` in a dependency rule, which a feature of Dune 1.2
2018-09-20[dune] Add "watch" target for continuous build mode.Emilio Jesus Gallego Arias
`make -f Makefile.dune watch` will now watch for files changes and rebuild what is needed. This feature requires `fswatch` or `inotifywait`, and Dune >= 1.2.0. Note that the current CI image ships an older Dune version.
2018-09-10[dune] Add apidoc target using `odoc`Emilio Jesus Gallego Arias
We build the `@doc` target in the `dune` job: - The documentation can be found in `_build/default/_doc/` - We had to fix a couple of quoting problems.
2018-09-06[dune] [ci] Fix and test release profile + use 1.1 dune-workspaceEmilio Jesus Gallego Arias
Dune 1.1 allows us to define the `env` flags in the workspace file, which is a better place than the current situation. Along the way, We fix the build flags for release mode [missing `-rectypes` and add a `release` build profile CI job.
2018-09-05[build] Preliminary support for building Coq with `dune`.Emilio Jesus Gallego Arias
[Dune](https://github.com/ocaml/dune) is a compositional declarative build system for OCaml. It provides automatic generation of `version.ml`, `.merlin`, `META`, `opam`, API documentation; install management; easy integration with external libraries, test runners, and modular builds. In particular, Dune uniformly handles components regardless whether they live in, or out-of-tree. This greatly simplifies cases where a plugin [or CoqIde] is checked out in the current working copy but then distributed separately [and vice-versa]. Dune can thus be used as a more flexible `coq_makefile` replacement. For now we provide experimental support for a Dune build. In order to build Coq + the standard library with Dune type: ``` $ make -f Makefile.dune world ``` This PR includes a preliminary, developer-only preview of Dune for Coq. There is still ongoing work, see https://github.com/coq/coq/issues/8052 for tracking status towards full support. ## Technical description. Dune works out of the box with Coq, once we have fixed some modularity issues. The main remaining challenge was to support `.vo` files. As Dune doesn't support custom build rules yet, to properly build `.vo` files we provide a small helper script `tools/coq_dune.ml`. The script will scan the Coq library directories and generate the corresponding rules for `.v -> .vo` and `.ml4 -> .ml` builds. The script uses `coqdep` as to correctly output the dependencies of `.v` files. `coq_dune` is akin to `coq_makefile` and should be able to be used to build Coq projects in the future. Due to this pitfall, the build process has to proceed in three stages: 1) build `coqdep` and `coq_dune`; 2) generate `dune` files for `theories` and `plugins`; 3) perform a regular build with all targets are in scope. ## FAQ ### Why Dune? Coq has a moderately complex build system and it is not a secret that many developer-hours have been spent fighting with `make`. In particular, the current `make`-based system does offer poor support to verify that the current build rules and variables are coherent, and requires significant manual, error-prone. Many variables must be passed by hand, duplicated, etc... Additionally, our make system offers poor integration with now standard OCaml ecosystem tools such as `opam`, `ocamlfind` or `odoc`. Another critical point is build compositionality. Coq is rich in 3rd party contributions, and a big shortcoming of the current make system is that it cannot be used to build these projects; requiring us to maintain a custom tool, `coq_makefile`, with the corresponding cost. In the past, there has been some efforts to migrate Coq to more specialized build systems, however these stalled due to a variety of reasons. Dune, is a declarative, OCaml-specific build tool that is on the path to become the standard build system for the OCaml ecosystem. Dune seems to be a good fit for Coq well: it is well-supported, fast, compositional, and designed for large projects. ### Does Dune replace the make-based build system? The current, make-based build system is unmodified by this PR and kept as the default option. However, Dune has the potential ### Is this PR complete? What does it provide? This PR is ready for developer preview and feedback. The build system is functional, however, more work is necessary in order to make Dune the default for Coq. The main TODOs are tracked at https://github.com/coq/coq/issues/8052 This PR allows developers to use most of the features of Dune today: - Modular organization of the codebase; each component is built only against declared dependencies so components are checked for containment more strictly. - Hygienic builds; Dune places all artifacts under `_build`. - Automatic generation of `.install` files, simplified OPAM workflow. - `utop` support, `-opaque` in developer mode, etc... - `ml4` files are handled using `coqp5`, a native-code customized camlp5 executable which brings much faster `ml4 -> ml` processing. ### What dependencies does Dune require? Dune doesn't depend on any 3rd party package other than the OCaml compiler. ### Some Benchs: ``` $ /usr/bin/time make DUNEOPT="-j 1000" -f Makefile.dune states 59.50user 18.81system 0:29.83elapsed 262%CPU (0avgtext+0avgdata 302996maxresident)k 0inputs+646632outputs (0major+4893811minor)pagefaults 0swaps $ /usr/bin/time sh -c "./configure -local -native-compiler no && make -j states" 88.21user 23.65system 0:32.96elapsed 339%CPU (0avgtext+0avgdata 304992maxresident)k 0inputs+1051680outputs (0major+5300680minor)pagefaults 0swaps ```