-
Notifications
You must be signed in to change notification settings - Fork 62
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
Dunification #197
Dunification #197
Conversation
tools/jbuild
Outdated
(public_name tyxml.tools) | ||
(wrapped false) | ||
(modules tyxml_name) | ||
(libraries (bytes)))) |
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's no need to ever use the bytes
lib with jbuilder. This library is only useful for building on <4.02
which you can't do anyway with jbuilder. On the other hand, it forces you to declare a dependency on base-bytes
which depend on findlib
. A big negative IMO.
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.
Fair enough!
test/jbuild
Outdated
; (alias | ||
; ((name runtest) | ||
; (deps (html_fail.result html_fail.expected)) | ||
; (action (run diff -dEbZBt html_fail.result html_fail.expected)) |
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 you revive this test, take a look at the diff
action. It streamlines the definition of such tests.
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 know about it, but it doesn't support custom flags. :/
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's --diff-command
to set it for your project. But you're right, this should be customizable per action as well. I'd open a ticket regarding this.
META.tyxml.template
Outdated
@@ -0,0 +1,2 @@ | |||
# JBUILDER_GEN | |||
archive(byte,toploop) += "tyxml_top.cma" |
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.
Wouldn't it be better to use requires
and tyxml.top
as opposed to archive
here? It's a bit more general.
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 goal of this is to auto-load tyxml.top
in the toplevel when tyxml
is #required. Do you have another way of doing that?
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.
requires(byte, toploop) += "tyxml.top"
should do the same thing but also handle dependencies if your toplevel lib has dependencies. Anyway, I'm not too sure what's best here. None of it is gonna work with $ jbuilder utop
anyway :/
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.
Ah, I see. Yes, your version is better. I should probably open a ticket about better support for this.
3b16d5e
to
af6f7e5
Compare
Ppx_common can't be used in both the ppx and ppx_reflect.
f53b6b3
to
378fb09
Compare
@rgrinberg I fixed the toplevel test in a way that is utterly disgusting, but I don't know how to do better. Do you have any propositions ? |
What you can try and do is manually create a driver executable using your local ppx and then see if you can massage the flags to make it output what you want. I managed to do this in my ppx_getenv2 example project: https://github.com/rgrinberg/ppx_getenv2/blob/master/test/jbuild#L16 But I used ppx_driver. You can probably get it to work with omp.driver as well. |
@rgrinberg the ppx is not the problem. The issue is that the code that is executed by the toplevel should have visibility over the |
Oh, I see that's a bit shitty. However, can't you build a custom toplevel as an executable, include |
Building a custom toplevel that |
Oh yeah, I remember having to do that to make |
Everything seem to be as good as it can possibly be. Merging! |
CHANGES: * Dunify This also removes all the deprecated libraries (`tyxml.syntax`, `tyxml.parser`) and removes the ocamlfind library `tyxml.ppx` in favor of `tyxml-ppx`. (ocsigen/tyxml#197 by Drup, Rudi Grinberg and Anton Bachin) * Add simplistic indentation for the Format-based printer (ocsigen/tyxml#187 by Drup) * Allow the ppx to be used for more exotic tyxml instances, such as reactive elements (ocsigen/tyxml#200 by Drup) * Add `Html.of_seq` and `Svg.of_seq`, which allow to easily import HTML parsed with markup in TyXML (ocsigen/tyxml#221 by Drup) ## Elements and attributes * Add Html.txt and Svg.txt as an alias for `pcdata` (ocsigen/tyxml#222 by Drup) * Add noopener link types (ocsigen/tyxml#198 by Jérôme Vouillon) * Slightly relax dt content type (ocsigen/tyxml#193 by Anton Bachin) * Add touch events (ocsigen/tyxml#211 by Malthe Borch) * Fix handling of figcaption in the PPX (ocsigen/tyxml#219 by Drup)
CHANGES: * Dunify This also removes all the deprecated libraries (`tyxml.syntax`, `tyxml.parser`) and removes the ocamlfind library `tyxml.ppx` in favor of `tyxml-ppx`. (ocsigen/tyxml#197 by Drup, Rudi Grinberg and Anton Bachin) * Add simplistic indentation for the Format-based printer (ocsigen/tyxml#187 by Drup) * Allow the ppx to be used for more exotic tyxml instances, such as reactive elements (ocsigen/tyxml#200 by Drup) * Add `Html.of_seq` and `Svg.of_seq`, which allow to easily import HTML parsed with markup in TyXML (ocsigen/tyxml#221 by Drup) ## Elements and attributes * Add Html.txt and Svg.txt as an alias for `pcdata` (ocsigen/tyxml#222 by Drup) * Add noopener link types (ocsigen/tyxml#198 by Jérôme Vouillon) * Slightly relax dt content type (ocsigen/tyxml#193 by Anton Bachin) * Add touch events (ocsigen/tyxml#211 by Malthe Borch) * Fix handling of figcaption in the PPX (ocsigen/tyxml#219 by Drup)
I think we can do it this time! :)
It's not completely finished: I need to look at the ppx failing tests, the ocsigen doc generation and sort out CI. But otherwise, it should be on the right track.
cc @rgrinberg (and @aantron ?), I would appreciate review!