-
Notifications
You must be signed in to change notification settings - Fork 414
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
melange: add melc_flags #6569
melange: add melc_flags #6569
Conversation
Signed-off-by: Javier Chavarri <[email protected]>
src/dune_rules/ocaml_flags.ml
Outdated
and+ native = field_oslu "ocamlopt_flags" in | ||
let specific = Mode.Dict.make ~native ~byte in | ||
and+ native = field_oslu "ocamlopt_flags" | ||
and+ melange = field_oslu "melc_flags" in |
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 should be guarded behind the melange syntax. And the name should be melange.flags
or melange.melc_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.
Actually, never mind. We have a strange situation here:
- For the library stanza, we want the
melange.
prefix for the flags - For the emit stanza, this prefix is redundant.
Let me think a bit.
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.
Okay, so indeed we should have a melange.
prefix in the library field and in the env field. In the emit stanza, we don't need such a prefix. I'd personally vote for the names melange.compile_flags
and compile_flags
in library & emit respectively.
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.
> (target output) | ||
> (entries main) | ||
> (module_system commonjs) | ||
> (ocamlc_flags -w -14-26)) |
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 don't think we should even accept this field in melange.emit.
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.
One more thing to think about, melange compilation has two stages, (.ml -> .cmj, .cmj -> .js). We should have a way to provide compilation options to both stages. Finally, we should also add melange support to the env stanza. |
I'm not sure that there are currently any interesting flags to be passed to the
Opened #6572 to track this. |
Signed-off-by: Javier Chavarri <[email protected]>
8043ed0
to
3f5d9e6
Compare
Signed-off-by: Javier Chavarri <[email protected]>
Signed-off-by: Javier Chavarri <[email protected]>
I think I tackled the comments mentioned above. The PR now:
For now there's no support for flags configuration in the .cmj -> .js stage, following @anmonteiro guidance above. Once we see it's useful to add it, we could use |
Signed-off-by: Javier Chavarri <[email protected]>
Signed-off-by: Javier Chavarri <[email protected]>
Some tests need to be updated:
|
Signed-off-by: Javier Chavarri <[email protected]>
Oops. Checked the test failures, but saw the whitespace diffs and was too quick to assume everything else was ok. Fixed in c7d0dc0. |
Signed-off-by: Javier Chavarri <[email protected]>
* main: (54 commits) doc: how we write `to_dyn` and `equal` (ocaml#6621) test(cache): test output of man pages test: dune utop for (subdir ..) (ocaml#6629) refactor: improve style of utop rules (ocaml#6628) test: depend on utop (ocaml#6627) refactor(stdune): Add Appendable_list.cons (ocaml#6624) doc: tighten wording in README.md test: add a repro case for ocaml#6607 (ocaml#6612) doc: cleanup status badges in README.md (ocaml#6618) doc(README): rewrap paragraphs and cleanup links coq: more resilient config query fix: link time code gen (ocaml#6606) fix(melange): run melc ppx with merlin (ocaml#6476) feature(melange): add compile_flags (ocaml#6569) refactor: move `modules: Modules.t` from `Dune_package.Lib` to `Lib_info` (ocaml#6605) Set CLICOLOR_FORCE=0 (ocaml#6608) fix: declare deps for ccomp detection (ocaml#6610) refactor: assume Cmdliner.Arg.conv is abstract (ocaml#6609) refactor: gen_rules pattern matching (ocaml#6604) Add CI for MSVC using dkml-workflows (ocaml#6540) ...
Fixes #6470.