-
Notifications
You must be signed in to change notification settings - Fork 409
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
doc/melange.rst - make the alias attachment behavior of melange.emit
clearer
#7924
Conversation
fyi: @anmonteiro |
f9a9351
to
64fb995
Compare
Signed-off-by: Haochen Kotoi-Xie <[email protected]>
64fb995
to
7c06acb
Compare
Sorry that my previous force push (to fix a layout problem) wasn't containing the intended fix and I just force pushed again. |
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. I wonder if it's better to remove the explicit build of output/hello.js
altogether, as it breaks as soon as there are two modules, and it's not the recommended way to build Melange projects in any case. @anmonteiro wdyt?
doc/melange.rst
Outdated
file structure: | ||
After running ``dune build output/hello.js`` or ``dune build @melange`` | ||
(by default, all ``melange.emit`` stanzas will attach their targets to | ||
the ``melange`` alias), |
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 behavior is explained in the alias
field of the melange.emit
stanza docs, a few paragraphs below. I am not sure it's worth adding a reference?
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.
When I was following the introduction section and got hello.js
in the minimal example built, I started to hacking the minimal example around and was met with surprises when dune build
(without specifying the melange
alias) wasn't generating the javascript files.
I personally wasted some decent time trying to debug it was the case and only realized such behavior after very carefully reading the document again.
Yes the behavior is already documented, but I think it's probably not be only me getting the impression that the targets added by melange.emit
stanza will be attached to the default
alias (as for most other dune stanzas) after just following the current introduction.
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 was not aware that all other targets (including jsoo ones, it seems) are added to the default alias. I am onboard with adding melange.emit
targets to the default alias, but I'm not sure if this addition was avoided for some reason that I'm not aware of. @rgrinberg @anmonteiro do you know?
(Probably something that should be discussed in a separate 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.
I think adding it to the default alias (@all
in this case) is the correct thing to do.
I have no preference. @anmonteiro should have a better say. |
@haochenx thanks for starting the discussion on this. I agree the language is confusing, but I'm concerned we might have added more confusion in this PR by explaining too much. Given the other comment, I wonder whether this would be an appropriate course of action:
@haochenx would you like to tackle 1. ? I believe it'd be a matter of adding more rules to the implicit default alias here: dune/src/dune_rules/melange/melange_rules.ml Lines 326 to 335 in 0591719
You can get the default alias with: |
If you want to attach melange.emit to default, we can do it in time for 3.8.2. Just open a PR or issue and add it to #7907. |
You could, but that would be a mistake. The default alias can be customized by the user so we don't want to attach to it directly and prevent the user from changing it. By "default", it's set to
We don't add features to point releases. |
Oh right, we should be using |
I am also in favor of adding the targets to I’m happy to send a PR making such a change and update this PR to reflect the point (2) and (3) by @anmonteiro. My concern is that this will be a breaking change to an already shipped feature. I’m not sure whether silently changing the behavior is a good thing to do. Maybe we would like to bump the plugin version? (i.e. only change the default alias if the user specify But if we agree that given the experimental status of the current melange support it’s acceptable to have such “silent” breaking changes. It’s definitely easier to implement and maintain this way.
|
My opinion is that we don't care too much in this phase and we can ship this change. If others feel differently, I'm happy to defer to stronger opinions.
Happy to keep the alias change and the documentation in a separate PR. |
It's acceptable. The only potential for breakage is for those already using this experimental feature. |
Signed-off-by: Haochen Kotoi-Xie <[email protected]>
melange.emit
clearer
Now #7296 is merged and I have updated the patch to document accordingly. |
Signed-off-by: Haochen Kotoi-Xie <[email protected]>
It seems that the windows CI job is stalling: https://github.com/ocaml/dune/actions/runs/5241726516/jobs/9464209550?pr=7924 It might be a good idea to restart it (I doesn't seem to have the permission to do so) |
Should we remove the reference to build an individual - After running ``dune build output/hello.js``, Dune produces the following
- file structure:
+ After running ``dune build @melange`` or just ``dune build``, Dune
+ produces the following file structure: One of my conclusions from this PR is that including instructions to build individual |
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.
Thank you! Just one suggestion, see previous comment.
Ah! Indeed. I made that change but it seems that I somehow accidentally thrown away that change down the way. |
Signed-off-by: Haochen Kotoi-Xie <[email protected]>
77d2154
to
8fc805e
Compare
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
@jchavarri @anmonteiro Thank you! |
Thanks again! |
Thank you all! |
melange.emit
targets to@all
alias as well by default #7926Before #7926, targets declared by
melange.emit
stanza is not attached to the dune's default@all
stanza, which can be confusing. #7926 changes that and this PR aims to make the document clearer.original (and out-of-date) pr description
Following the introduction of the current melange document page I was confused by why running `dune build` would not produce the javascript outputs and only realize that the `melange.emit` stanza by default attach the targets to the `melange` alias instead of the default alias after a very careful examination of the documentation.It would be nice to make the default alias attachment clear in the introduction section to avoid potential confusions of new adopters.
(initial) diff:
that is, the following text being inserted:
"or
dune build @melange
(by default, allmelange.emit
stanzas will attach their targets to themelange
alias)"