-
Notifications
You must be signed in to change notification settings - Fork 51
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 #192
Port to jbuilder #192
Conversation
Thanks for trying this out! On Linux:
On Windows, it looks like there's a problem with the CI scripts not knowing the opam package name? Was renaming |
Yes it was necessary. Jbuilder shows ugly warnings on mli only modules.
You will need to pin jbuilder to master for the package option to be
available. Or wait until @diml makes another release.
…On Fri, Mar 24, 2017, 5:57 AM David Sheets ***@***.***> wrote:
Thanks for trying this out!
On Linux:
# File "gist/jbuild", line 6, characters 3-10:
# Error: Unknown field package
On Windows, it looks like there's a problem with the CI scripts not
knowing the opam package name?
Was renaming lib/github_s.mli to lib/github_s.ml necessary for the build?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#192 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIe-7F0cQXEsZZquWcbXwYt5BCaEMZ5ks5ro5NygaJpZM4MnqU3>
.
|
sorry, #193 will conflict with this -- will rebase once thats merged. |
Why will it conflict? I've only added new files here and haven't touched any of the oasis stuff. |
Oh I thought it would have removed oasis -- all is good with the world then. |
@rgrinberg yes -- I think jsoo is fine, to be consistent among our libraries. |
I'd really like to make this transition but I'm still rather disappointed about the mli becoming an ml... can we get jbuilder support for mli only files? |
I was a bit inaccurate in my previous comment btw. jbuilder does support mli only modules in a primitive way by creating an .mli -> .ml copying rule. We can just rely on this copying rule but I wouldn't like that. It shows an ugly warning and doesn't handle some corner cases. But if you'd like, we can still use it. See this ticket for why it will not get full mli only support: ocaml/dune#9 |
@dsheets is the .mli only issue a deal breaker for you? |
I don't know if it's a deal breaker but I'm interested in any work-around. Why would you dislike the copying rule? What are the edge cases that we are exposed to? How scary is the warning? I know that I could answer these questions myself but I'm extremely short on time recently -- sorry :-/. |
The warning looks like this:
The edge case where the copying rule doesn't work is described here: ocaml/dune#9 (comment) This doesn't affect |
@rgrinberg the argument for the mli-only module is to provide a single place where the interface is defined and documented. I don't think we need the module to be mli-only but we do need the module signatures to exist in an mli (not just an bare ml) with ocamldoc comments. The cost of that is a duplication of the module signatures in both mli and ml (without doc comments) which I'm not thrilled about but seems acceptable. I'm happy to have If you could simply keep the |
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 is awesome, thank you @rgrinberg!
Makefile
Outdated
.PHONY: all clean install build | ||
PREFIX ?= /usr/local | ||
all: | ||
jbuilder build @install -j 3 |
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.
should this be jbuilder build --dev
(for stricter warnings) and then it autofigures out the right value of -j
(i have 16 cores on my desktop)
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.
--dev
adds too many warnings. I'll address those in a separate PR
github-unix.opam
Outdated
@@ -0,0 +1,36 @@ | |||
opam-version: "1.2" | |||
name: "github" | |||
version: "2.2.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.
can remove name
and version
here (the name is wrong anyway)
github-jsoo.opam
Outdated
] | ||
depends: [ | ||
"jbuilder" {build} | ||
"cohttp" |
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.
probably good to put a minimum cohttp constraint here given its rich and storied history
BTW, if you write an explicit rule to copy the file, the warning will go away: (rule
((targets (foo.ml))
(deps (foo.mli))
(action (copy-and-add-line-directive ${<} ${@})))) |
github-jsoo.opam
Outdated
@@ -0,0 +1,32 @@ | |||
opam-version: "1.2" | |||
name: "github" | |||
version: "2.2.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.
The name and version are wrong here, too.
The explicit copy rule seems fine to me. As far as I can tell from ocaml/dune#9 (comment), the edge case arises when copying an ml to an mli which is exactly what we aren't doing (unless that was a mistaken assertion). I don't see any edge cases about mli -> ml. |
@dsheets the explicit copying rule is added |
All that remains for this PR is travis |
This will change the opam name of the library as used in dependencies that currently rely on, e.g., Thanks for contributing this! |
package "unix" ( | ||
description = "Deprecated. Use github-unix directly" | ||
requires = "github-unix" | ||
) |
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 think we should just break this and go to 3.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.
it's useful to keep this for a release so that old packages can just have their opam build deps changed, rather than having to re-release or upper-bound them.
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.
but this doesn't hold if you are doing other breaking API changes of course, so a 3.0 is probably more appropriate to not have this.
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.
The problem is that depending on github-unix
will implicitly depend on the next release and this release must exist for packages to depend on. We've got some other deprecated cruft so it seems simpler to just break compat for the small number of downstream packages.
I've rebased and added back some warnings but I can't work out how to get the new subpackages to build during development. I get an error like:
I'm not sure what the warning is about, either. What am I missing? I updated the Makefile to build all of the packages so that developers don't get nasty surprises during CI testing (see recent failing CI test) but I can't work out how to build |
Hmm, I'm not sure such a way exists. The point of |
|
Thanks @rgrinberg for your contribution, @avsm for your comments, and @diml for your guidance! |
And thank you for the review and merge @dsheets! |
Some things to note:
doesn't allow for binaries in the same dir with different config.