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
Warn when incompatible dune version detected in dune-project #3705
Conversation
e8abc2e
to
cb7cf6c
Compare
cb7cf6c
to
c47978e
Compare
I seem to have had the wrong ocamlformat version and then it didn't format. I formatted the code and force pushed now. |
LGTM. Can you add a test case for this behavior and make sure it only fires for dune 2.8 and above? We try not to alter dune's behavior for a fixed version. @kit-ty-kate do you agree with the behavior proposed here? |
src/dune/opam_create.ml
Outdated
-> | ||
User_warning.emit | ||
~hints: | ||
[ Pp.textf "Set dune constraint to >= %s" |
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.
note that currently if (lang dune ...)
is set to 2.6 or above, and the constraint is set, dune won't do anything clever and will just add two constraints (i.e. will become "dune" {>= "2.6" & >= "2.6"}
). It's not wrong but visually annoying imo, so maybe we could add something for that or simply say "remove the constraint if (dune lang ...)
is set to 2.6 or above". Idk. I don't mind too much either way.
Does this apply even if it's just a warning? |
That's what we've done when introducing other warnings. For example, the merlin warning. |
the thing is that otherwise the warning is rather useless as from |
Even if the user already set a constraint manually? |
yeah :/ Line 153 in ea9020b
|
This behavior seems a bit weird. For example, if I add a
I wonder if would be better to just have a warning rather than use the existing constraint. I suppose we could add the warning retroactively, but I think we need to make sure it doesn't fire up in the vendored directory. |
Signed-off-by: Ulrik <ulrik.strid@outlook.com>
Signed-off-by: Ulrik <ulrik.strid@outlook.com>
Signed-off-by: Ulrik <ulrik.strid@outlook.com>
acb74ff
to
b590efc
Compare
Added tests but they will fail until 2.8 is a valid language version. |
@rgrinberg what can I do to move this PR forward? |
Isn't the issue solved by upgrading your dune language version already? Then the up to date constraint is always inserted. |
This is quite hacky but something to get the ball rolling.
Fixes #3700