-
Notifications
You must be signed in to change notification settings - Fork 179
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 dune 2.0 #1196
Port to dune 2.0 #1196
Conversation
I would suggest to test carefully whether the behavior described in ocaml/dune#2958 affects tests, etc. here.
|
I think it's worth adding a line in the changelog that the required dune version is now >= 2.0.0, otherwise the changes in dune files look good. |
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.
Nice. I agree this should be in the changelog.
Compatibility is not necessarily a concern as upgrading OCamlformat itself is involved and I don't expect users to upgrade it as soon as possible.
I agree with the changelog. We can wait a bit until the dune 2 issues are identified. |
There might be a problem with Dune >= 2.0 migration - some popular packages still depend on the jbuilder (
P.S. You might want to rebase your PR. |
Since jbuilder and dune 2 can be co-installed, aren't those packages that depend on jbuilder.transition instead of jbuilder just broken? |
@jberdine I am not sure, opam doesn't allow me to upgrade those precisely because of that dependency on
|
You can still fix these packages, or use an older version of ocamlformat. The current situation with dependencies is not ideal: since at the moment you have to build ocamlformat in the same switch as your sources, it also induces a constraint on |
at the moment you have to build ocamlformat in the same switch as your sources
There must be some context I'm missing. I almost never build ocamlformat from the same switch as used for the code it formats.
|
I mean if you rely on opam to install ocamlformat as test-dep or something like that. I agree with you that it's best to do it in a separate switch (that's effectively what ocaml-ci is doing), but there's no way to tell opam to do that for now. |
f877114
to
c1b175c
Compare
I just rebased this; not sure what's going on with the ocp-indent tests. (I tried to force >= 1.8.1 in case of a different version but that did not fix the 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.
There seems to be a problem with dune build @fmt
. It seems that test/.ocamlformat_ignore
wasn't useful and formatting of tests were disabled by something else. Could it be that test/passing/dune-project
was overriding (using fmt)
(by not specifying it) from ./dune-project
?
The reason test/.ocamlformat_ignore
is not working is that it should be called test/.ocamlformat-ignore
.
Formatting rules were not set up by default as the project was a 1.x. In a 2.x project it's necessary to disable them using |
55bf97b
to
e8abe72
Compare
and this is working. nice catch, thanks! |
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.
Looks good, thanks!
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.
After that, I think we can merge !
34ed060
to
b6d2192
Compare
* Use (lang dune 2.2) * Use with-accepted-exit-codes * read lines in generator * use with-stdin-from * Use long-form target inference
This ports to
(lang dune 2.0)
and uses all niceties from the new dune lang.(with-accepted-exit-codes)
&(with-stdin-from)
(these replace all our uses of(system)
)(targets)
and refer to them as%{targets}
Note that this bumps the minimum dune version to 2.0.0. This shouldn't be too much of a problem since very few packages have a
< 2.0.0
constraint on opam-repository (and almost all of them have a fixed version - the compatibility is pretty good).Let me know what you think.