feat(dune): support + prefixes for PPX CLI flags #11234
feat(dune): support + prefixes for PPX CLI flags #11234anmonteiro merged 5 commits intoocaml:mainfrom
+ prefixes for PPX CLI flags #11234Conversation
+ prefixes for PPX CLI flags
|
I think this needs to be versioned. You can version this under dune's own language or melange's. Depending on how stable you'd like to keep this feature. |
|
Why do you think this needs to be versioned? I believe the previous behavior would just plainly return an error, so we shouldn't have anyone depending on these features, right? |
|
Suppose that somebody would try to use this feature in a publicly released project. That person would need to remember to update the constraints in their project file to require at least dune 3.18. Without the version check, it is very likely that the person would forget to add this constraint, or they might even do it incorrectly, if they misremember which version of dune introduced this feature. Downstream user of this project might then encounter build failures should they build with an older version of dune. If we add a version check, we make this scenario more or less impossible. It's true that the above argument is applicable to basically any user visible change in dune, but I think it works best for features. As for bug fixes, it's good that users can benefit from those without opting in. I think that this PR is certainly more of a feature than a bug fix. |
|
absolutely, thanks for the explainer! |
8cdabdc to
493b6f9
Compare
|
@rgrinberg ready for another look. |
| with | ||
| | Yes, _ -> Right s | ||
| | _, Yes when syntax_version >= (3, 18) -> Right s | ||
| | (No | Unknown _), _ -> |
There was a problem hiding this comment.
I think you could improve the error message here with a hint for prefix = "+" when syntax_version < (3, 18)
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
493b6f9 to
e57cc15
Compare
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
* test(ppx): show flags starting with `+` are interpreted as library names Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * feat(dune): support `+` prefixes for PPX CLI flags Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * cr: only enabled for Dune versions starting with 3.18 Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * cr: add a better error message for `prefix = "+"` Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> --------- Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
* test(ppx): show flags starting with `+` are interpreted as library names Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * feat(dune): support `+` prefixes for PPX CLI flags Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * cr: only enabled for Dune versions starting with 3.18 Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * cr: add a better error message for `prefix = "+"` Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> --------- Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> Signed-off-by: Chris Armstrong <chris-armstrong@users.noreply.github.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> Signed-off-by: Chris Armstrong <chris-armstrong@users.noreply.github.com>
CHANGES: ### Fixed - Support HaikuOS: don't call `execve` since it's not allowed if other pthreads have been created. The fact that Haiku can't call `execve` from other threads than the principal thread of a process (a team in haiku jargon), is a discrepancy to POSIX and hence there is a [bug about it](https://dev.haiku-os.org/ticket/18665). (@Sylvain78, ocaml/dune#10953) - Fix flag ordering in generated Merlin configurations (ocaml/dune#11503, @voodoos, fixes ocaml/merlin#1900, reported by @vouillon) ### Added - Add `(format-dune-file <src> <dst>)` action. It provides a replacement to `dune format-dune-file` command. (ocaml/dune#11166, @nojb) - Allow the `--prefix` flag when configuring dune with `ocaml configure.ml`. This allows to set the prefix just like `$ dune install --prefix`. (ocaml/dune#11172, @rgrinberg) - Allow arguments starting with `+` in preprocessing definitions (starting with `(lang dune 3.18)`). (@amonteiro, ocaml/dune#11234) - Support for opam `(maintenance_intent ...)` in dune-project (ocaml/dune#11274, @art-w) - Validate opam `maintenance_intent` (ocaml/dune#11308, @art-w) - Support `not` in package dependencies constraints (ocaml/dune#11404, @art-w, reported by @hannesm) ### Changed - Warn when failing to discover root due to reads failing. The previous behavior was to abort. (@KoviRobi, ocaml/dune#11173) - Use shorter path for inline-tests artifacts. (@hhugo, ocaml/dune#11307) - Allow dash in `dune init` project name (ocaml/dune#11402, @art-w, reported by @saroupille) - On Windows, under heavy load, file delete operations can sometimes fail due to AV programs, etc. Guard against it by retrying the operation up to 30x with a 1s waiting gap (ocaml/dune#11437, fixes ocaml/dune#11425, @MSoegtropIMC) - Cache: we now only store the executable permission bit for files (ocaml/dune#11541, fixes ocaml/dune#11533, @ElectreAAS) - Display negative error codes on Windows in hex which is the more customary way to display `NTSTATUS` codes (ocaml/dune#11504, @MisterDA)
CHANGES: ### Fixed - Support HaikuOS: don't call `execve` since it's not allowed if other pthreads have been created. The fact that Haiku can't call `execve` from other threads than the principal thread of a process (a team in haiku jargon), is a discrepancy to POSIX and hence there is a [bug about it](https://dev.haiku-os.org/ticket/18665). (@Sylvain78, ocaml/dune#10953) - Fix flag ordering in generated Merlin configurations (ocaml/dune#11503, @voodoos, fixes ocaml/merlin#1900, reported by @vouillon) ### Added - Add `(format-dune-file <src> <dst>)` action. It provides a replacement to `dune format-dune-file` command. (ocaml/dune#11166, @nojb) - Allow the `--prefix` flag when configuring dune with `ocaml configure.ml`. This allows to set the prefix just like `$ dune install --prefix`. (ocaml/dune#11172, @rgrinberg) - Allow arguments starting with `+` in preprocessing definitions (starting with `(lang dune 3.18)`). (@amonteiro, ocaml/dune#11234) - Support for opam `(maintenance_intent ...)` in dune-project (ocaml/dune#11274, @art-w) - Validate opam `maintenance_intent` (ocaml/dune#11308, @art-w) - Support `not` in package dependencies constraints (ocaml/dune#11404, @art-w, reported by @hannesm) ### Changed - Warn when failing to discover root due to reads failing. The previous behavior was to abort. (@KoviRobi, ocaml/dune#11173) - Use shorter path for inline-tests artifacts. (@hhugo, ocaml/dune#11307) - Allow dash in `dune init` project name (ocaml/dune#11402, @art-w, reported by @saroupille) - On Windows, under heavy load, file delete operations can sometimes fail due to AV programs, etc. Guard against it by retrying the operation up to 30x with a 1s waiting gap (ocaml/dune#11437, fixes ocaml/dune#11425, @MSoegtropIMC) - Cache: we now only store the executable permission bit for files (ocaml/dune#11541, fixes ocaml/dune#11533, @ElectreAAS) - Display negative error codes on Windows in hex which is the more customary way to display `NTSTATUS` codes (ocaml/dune#11504, @MisterDA)
* test(ppx): show flags starting with `+` are interpreted as library names Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * feat(dune): support `+` prefixes for PPX CLI flags Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * cr: only enabled for Dune versions starting with 3.18 Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * cr: add a better error message for `prefix = "+"` Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> --------- Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
this is useful for cases like
melange.ppxwhich emit alerts and allow to configure them via-alert ....