Closed
Conversation
2 tasks
ed4efe1 to
2f3bf47
Compare
c3433d2 to
217ee25
Compare
217ee25 to
1eee50c
Compare
1eee50c to
9bf38b0
Compare
Gbury
reviewed
Jan 5, 2022
Contributor
Gbury
left a comment
There was a problem hiding this comment.
I haven't really looked at how the build process works (and I guess that as long as CI (and us) manage to build the tree, these changes should be fine), however you should also update the documentation about the version of dune required in the README.
Better yet, you could push your branch to the ocaml-flambda fork of dune (and overwrite the current special_dune branch with your branch), so that we only need to update our local dune ?
Collaborator
|
Yeah I will sort out the update of |
NOTE: This commit requires updating your special Dune to the [lukemaurer:special-dune-2.9][] branch. [lukemaurer:special-dune-2.9]: http://github.com/lukemaurer/dune/tree/special-dune-2.9 The current system relies on modifying the `ocaml/` subtree in place. This is fragile, and is particularly a problem now that we have stage1 and stage2 as build contexts sharing a `_build` directory (and hence sharing saved build state): stage1 and stage2 can clobber each other's inputs, triggering unnecessary rebuilds. We can avoid ever modifying a file in `ocaml/` by exploiting two non-obvious properties of Autoconf: - a `configure` script can be run from any directory and will only create files where it's run - the `config.status` script that `configure` generates can generate individual files on demand, also from any directory For stage1 and stage2, then, we can just use `configure` to generate a `config.status`, and then Dune can take care of running `config.status` for itself - which naturally happens in the stage's own `_build` subdirectory. There's some faff required to use a `config.status` as a Dune action, since it normally creates files in subdirectories, which Dune doesn't support. Also, Dune wants to know exactly what files `config.status` will create, so we end up tied more closely to the upstream `configure.ac` than we might like. Finally, we have several Dune actions that run Make and thus depend on `Makefile.config`, which has to be declared explicitly now because `Makefile.config` is not in the source tree. But in return, the build should be considerably more robust, and we continue moving work from Make to Dune (`make stage1` and `make stage2` barely do anything more than call Dune).
a540d32 to
6f85282
Compare
Also added a comment to make the new stage0 config code a little clearer.
Contributor
Author
|
Superseded by #585. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: Requires updating your special Dune to the lukemaurer:special-dune-2.9 branch.
The current system relies on modifying the
ocaml/subtree in place. This is fragile, and is particularly a problem now that we have stage1 and stage2 as build contexts sharing a_builddirectory (and hence sharing saved build state): stage1 and stage2 can clobber each other's inputs, triggering unnecessary rebuilds.We can avoid ever modifying a file in
ocaml/by exploiting twonon-obvious properties of Autoconf:
a
configurescript can be run from any directory and will only create files where it's runthe
config.statusscript thatconfiguregenerates can generate individual files on demand, also from any directoryFor stage1 and stage2, then, we can just use
configureto generate aconfig.status, and then Dune can take care of runningconfig.statusfor itself - which naturally happens in the stage's own_buildsubdirectory. There's some faff required to use aconfig.statusas a Dune action, since it normally creates files in subdirectories, which Dune doesn't support. Also, Dune wants to know exactly what filesconfig.statuswill create, so we end up tied more closely to the upstreamconfigure.acthan we might like. Finally, we have several Dune actions that run Make and thus depend onMakefile.config, which has to be declared explicitly now becauseMakefile.configis not in the source tree. But in return, the build should be considerably more robust, and we continue moving work from Make to Dune (make stage1andmake stage2barely do anything more than call Dune).