-
Notifications
You must be signed in to change notification settings - Fork 177
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
Port to jbuilder #374
Port to jbuilder #374
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments. This looks an awesome and a massive effort forward. I've made some suggestions to tweak the opam files and will give this a more thorough test later.
A couple of general points:
- How come the old build system isn't being deleted? Do we still need it for something.
- I wonder if lwt-syntax is such a great name. Perhaps something like lwt-camlp4 or even lwt-camlp4-deprecated to signify to people that this package shouldn't really be used.
lwt-core.opam
Outdated
build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] | ||
build-test: [ [ "jbuilder" "runtest" ] ] | ||
depends: [ | ||
"ocamlfind" {build & >= "1.5.0"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is findlib still explicitly necessary? jbuilder doesn't really use it anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. Jbuilder says it uses it if available, but I am not sure what difference it atually makes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ocamlfind is installed it will prefer $ ocamlfind printconf path
rather than just looking into opam directly. IMO, reducing dependence on findlib is a good thing as it's just a needless layer of indirection. But it's a minor issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense. Sounds like I should get rid of it.
lwt-core.opam
Outdated
license: "LGPL with OpenSSL linking exception" | ||
dev-repo: "https://github.com/ocsigen/lwt.git" | ||
build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] | ||
build-test: [ [ "jbuilder" "runtest" ] ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add "-p" name
in the build-test as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I added the package stanza to all the runtest aliases then forgot this bit!
lwt-ppx.opam
Outdated
depends: [ | ||
"ocamlfind" {build & >= "1.5.0"} | ||
"jbuilder" { build & >= "1.0+beta9" } | ||
"lwt-core" # is this really needed, or only sensible? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove it if it's not entirely necessary. It will give opam an opportunity to parallelize the builds more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree, lwt-ppx
's META should mention that lwt
is needed at runtime, which only make sense if lwt-core
is an opam dep.
lwt-ppx.opam
Outdated
license: "LGPL with OpenSSL linking exception" | ||
dev-repo: "https://github.com/ocsigen/lwt.git" | ||
build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] | ||
build-test: [ [ "jbuilder" "runtest" ] ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This build-test needs to be fixed as well.
lwt-preemptive.opam
Outdated
@@ -0,0 +1,27 @@ | |||
opam-version: "1.2" | |||
name: "lwt" | |||
version: "dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO you should remove the version/name from the opam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the version, it's better for pinning.
src/ppx/.merlin
Outdated
PKG compiler-libs.common | ||
PKG ocaml-migrate-parsetree | ||
PKG ppx_tools_versioned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.merlin file should be deleted
META.lwt.template
Outdated
@@ -0,0 +1,38 @@ | |||
# JBUILDER_GEN | |||
|
|||
version = "dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version here should be removed I believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, and possibly substituted eventually by topkg or similar.
I've been using the _oasis file as a reference. It can disappear soon.
Whatever's prefered. It's disturbingly easy to refactor jbuild files...(in fact I used had lwt-camlp4, then changed it to match the old naming). |
I agree with @rgrinberg that moving away from |
It's contrary to this particular goal, but IMO it's still worth thinking about. I feel uneasy about this dead weight being carried around with lwt and being named so inconspicuously. @hhugo opted to name the camlp4 extension |
NOTE: the packages in the PR are actually the same as v3.0 of lwt, not as described below. FYI;
In addition, the findlib names for the syntax extension package break down into;
Note that in the new scheme, the package called If you want to change the syntax name to I note one further inconsistency which is that I have used |
If we have a compatibility layer that rewires everything, we might as well take this occasion to change the names that we don't like, such as |
omg, this is amazing! :-) See mirage/mirage#818 (comment) |
Hmm configurator seems to depend on base. Is it acceptable to have that as a build time dependency for Lwt? |
It's gone now anyway. The discover script is rather more sophisticated than configurator at the moment. |
Given @diml's comment I refactored the jbuild files to model the current lwt package organisation. Fewest changes possible and all that. This is easy to change and can be addressed seperately. I have tested with ocaml 4.02.3, 4.03.0, and 4.04.0 on Ubuntu and it seems OK. Related issues;
The main remaining issue is how to properly expose configuration of A minor unresolved issue is how to hide the Lwt_config and Lwt_unix_jobs_generated modules. |
By the way, jbuilder organises sub-packages into their own directories so it should fix #364 (and break some dependent packages which are to some extent broken anyway - see bad_packages.md). |
Thanks for the ongoing work!
It would be nice to hide these, but I think not critical. I think we can assume that nobody has modules with these names, and we can check that in OPAM. |
fixes the linkall issue on the ppx
jbuilder seems to prefer an opam file per package. An empty opam file `lwt.opam` depends on the usual suspects. It just installs a META files and reexports packages under their expected names.
this should configure unix the same way as oasis did (by default).
parse `ocamlc -config` for parameters that used to come from oasis. adds base and stdio as dependancies
this isn't quite right for glib/ssl/react. maybe better to make the jbuild version use lwt_xxx throughout as that will be most compatible
looks in other packages directories to do this, which seems unclean but I dont know how else to do it.
The changes proposed in previous commits turn out to not be unnecessary.
Ok, I think the PPX issue doesn't block this PR then. Thanks for finding and diagnosing it :) Regarding 4.05, I'll edit the Travis build shortly after merging, and we'll have testing on it again. |
Mostly editing whitespace to restore lines to their former state; this makes it easier for git to identify which file was renamed from where. See ocsigen#374 (comment) Also restored constraints on lwt_react, and restored package names.
Mainly to reduce the net diff, but also to keep the OCaml version constraint. We shouldn't rely on jbuilder requiring 4.02.3 as a lower bound. Even though jbuilder is not likely to support 4.02.0, it's better to keep the inherent 4.02.0 constraint of Lwt in its own opam file, for now.
Since we decided not to change it in this PR :) This reduces the net diff slightly. More importantly, it eliminates the merge conflict, allowing the CI builds to run again without having to do a merge or rebase first.
- Restore authors. As far as I know, they were accurate. - Avoid moving the dev-repo field. We can move it later, if needed. - Restore constraint on Lwt in lwt_glib.
Doing this before the squash because it is harmful to do it in a separate commit to master afterwards: it will pollute the blame. [skip ci]
[skip ci]
Previewing rewriting of #374. [skip ci]
This also ports the PPX to ocaml-migrate-parsetree. The work in this commit, and the preceding one, was done by Andrew Ray (@andrewray) in #374. These two commits are just a more blame-friendly version; the detailed history is visible #374. Some number of follow-on commits will probably be needed to fully stabilize and finalize the port. Also, this commit breaks some packages that depend on Lwt incorrectly. We will probably take steps to break them more softly than is being done by this commit alone. Builds on 4.05 are temporarily disabled, due to jbuilder not working with the 4.05 betas. We will address this by building on trunk later. This port disables coverage via Bisect completely (#319). We will restore that in follow-on work; in the meantime, we expect few enough edits to the test suite to be made that we can run the test suite with coverage in a separate branch that does not yet have this commit, and cherry-pick commits over if any development of the test suite occurs. The build system produced by this commit is a bit of a chimera: it adopts jbuilder without adopting modern packaging best practices. We need to do the latter slowly, to avoid breaking projects that depend on Lwt without proper warning (#293). Work along this direction had already started (#301, #338, #370), and this jbuilder port will make it easier to continue. The port also pre-emptively solves a lot of other issues with the build system. See the pull request for any issue links, to be added over the coming days. Maintainer's note: squash and summary done by Anton Bachin (@aantron).
Summary of what happened in this PR: In a massive effort, @andrewray ported Lwt to jbuilder, but without splitting Lwt up into multiple OPAM packages, as originally stated. The Lwt project will do that in follow-on work over the next few months, mainly to avoid breaking projects that depend on Lwt (see #293 regarding Lwt's soft breakage policy).
This achievement is not to be understated: Lwt is one of the few OCaml projects tested on Cygwin and Win32, in addition to having many legacy quirks that we can only eliminate slowly. Thanks @andrewray! Several things are temporarily broken by this PR, which we will fix later (and definitely before the next release). See the message of commit 2163fb1 for details. This PR will be merged as #391, which has a simplified history for |
This also ports the PPX to ocaml-migrate-parsetree. The work in this commit, and the preceding one, was done by Andrew Ray (@andrewray) in #374. These two commits are just a more blame-friendly version; the detailed history is visible #374. Some number of follow-on commits will probably be needed to fully stabilize and finalize the port. Also, this commit breaks some packages that depend on Lwt incorrectly. We will probably take steps to break them more softly than is being done by this commit alone. Builds on 4.05 are temporarily disabled, due to jbuilder not working with the 4.05 betas. We will address this by building on trunk later. This port disables coverage via Bisect completely (#319). We will restore that in follow-on work; in the meantime, we expect few enough edits to the test suite to be made that we can run the test suite with coverage in a separate branch that does not yet have this commit, and cherry-pick commits over if any development of the test suite occurs. The build system produced by this commit is a bit of a chimera: it adopts jbuilder without adopting modern packaging best practices. We need to do the latter slowly, to avoid breaking projects that depend on Lwt without proper warning (#293). Work along this direction had already started (#301, #338, #370), and this jbuilder port will make it easier to continue. The port also pre-emptively solves a lot of other issues with the build system. See the pull request for any issue links, to be added over the coming days. Maintainer's note: squash and summary done by Anton Bachin (@aantron).
This also ports the PPX to ocaml-migrate-parsetree. The work in this commit, and the preceding one, was done by Andrew Ray (@andrewray) in #374. These two commits are just a more blame-friendly version; the detailed history is visible #374. Some number of follow-on commits will probably be needed to fully stabilize and finalize the port. Also, this commit breaks some packages that depend on Lwt incorrectly. We will probably take steps to break them more softly than is being done by this commit alone. Builds on 4.05 are temporarily disabled, due to jbuilder not working with the 4.05 betas. We will address this by building on trunk later. This port disables coverage via Bisect completely (#319). We will restore that in follow-on work; in the meantime, we expect few enough edits to the test suite to be made that we can run the test suite with coverage in a separate branch that does not yet have this commit, and cherry-pick commits over if any development of the test suite occurs. The build system produced by this commit is a bit of a chimera: it adopts jbuilder without adopting modern packaging best practices. We need to do the latter slowly, to avoid breaking projects that depend on Lwt without proper warning (#293). Work along this direction had already started (#301, #338, #370), and this jbuilder port will make it easier to continue. The port also pre-emptively solves a lot of other issues with the build system. See the pull request for any issue links, to be added over the coming days. Maintainer's note: squash and summary done by Anton Bachin (@aantron).
This also ports the PPX to ocaml-migrate-parsetree. The work in this commit, and the preceding one, was done by Andrew Ray (@andrewray) in #374. These two commits are just a more blame-friendly version; the detailed history is visible #374. Some number of follow-on commits will probably be needed to fully stabilize and finalize the port. Also, this commit breaks some packages that depend on Lwt incorrectly. We will probably take steps to break them more softly than is being done by this commit alone. Builds on 4.05 are temporarily disabled, due to jbuilder not working with the 4.05 betas. We will address this by building on trunk later. This port disables coverage via Bisect completely (#319). We will restore that in follow-on work; in the meantime, we expect few enough edits to the test suite to be made that we can run the test suite with coverage in a separate branch that does not yet have this commit, and cherry-pick commits over if any development of the test suite occurs. The build system produced by this commit is a bit of a chimera: it adopts jbuilder without adopting modern packaging best practices. We need to do the latter slowly, to avoid breaking projects that depend on Lwt without proper warning (#293). Work along this direction had already started (#301, #338, #370), and this jbuilder port will make it easier to continue. The port also pre-emptively solves a lot of other issues with the build system. See the pull request for any issue links, to be added over the coming days. Maintainer's note: squash and summary done by Anton Bachin (@aantron).
FYI the ocsigen.org manual seems to have survived this PR :) If any minor issues develop, we can fix them later. |
I just wanted to express my appreciation for all the hard work that went into this PR. We've been porting a large chunk of the Mirage package repository with a view to using a unified |
Module Markup_lwt_unix depends on Findlib packages lwt and lwt.unix. However, the only dependency actually listed in _tags was on package lwt. Until recently, Lwt installed all files in a flat directory. Depending on package lwt causes ocamlfind to add a -I option for that directory; since the directory was flat, that option was sufficient to be able to accidentally find the files of lwt.unix as well. Lwt now installs files in a directory hierarchy. In particular, lwt.unix is now installed in a separate subdirectory. The -I option implied by depending on package lwt is therefore no longer accidentally sufficient for using lwt.unix, and this causes an error during compilation of Markup.ml if Lwt is present. So, this commit does the right thing, and adds the proper, explicit dependency on lwt.unix. This bug was originally found in Markup.ml, as well as several other packages, by @andrewray during ocsigen/lwt#374. Fixes #18. See also ocsigen/lwt#401.
The new jbuilder build system, added in #374, does not emit warnings about duplicate topdirs.cmi files.
The new jbuilder build system, added in #374, does not emit warnings about duplicate topdirs.cmi files.
This was originally part of #374, but I wasn't sure what the right way to depend on ppx_tools_versioned and ocaml-migrate-parsetree is. However, since we directly use modules from OMP in the Lwt PPX, it now seems reasonable to depend on ocaml-migrate-parsetree directly.
It is for the OASIS build system, and obsolete since the port to Jbuilder (#374). [skip ci]
#365
This splits lwt into multiple opam packages, and ties them back together with an empty
lwt
package with appropriate dependancies and a special META file to map to the old package names.EDIT: Note from @aantron: