-
Notifications
You must be signed in to change notification settings - Fork 456
Fix/good error msg pkg enabled #12802
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
Conversation
47184b5 to
80dd5e8
Compare
Leonidas-from-XIV
left a comment
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.
Thanks for the PR. I have made some comments on how to improve the code.
However I think I would ask the opinion of other Dune maintainers to ask whether adding support for pkg in dune-project only to state that you don't support is is a good idea. It feels a bit.. odd. Likewise, should we add stanzas for other error cases too (lock_dir etc)?
test/blackbox-tests/test-cases/workspaces/pkg-in-dune-project.t/dune-project
Outdated
Show resolved
Hide resolved
Thanks for the feedback @Leonidas-from-XIV ! I've implemented all your suggestions ! You raise a good point about whether this approach feels odd. I can see the concern, we're essentially adding a field just to reject it with a better error message. |
73e634e to
5bc200f
Compare
|
@Leonidas-from-XIV Given that we are/will be pushing people to use package management it would be good to handle this particular case since it does occur if users are new to the dune-workspace file. It's better than the confusing message we get otherwise. #12761 (comment) |
|
Thanks for addressing the issues, quite nice. I've been looking at this a little and if we decide that we want to support a feature like this maybe we should extend |
5bc200f to
39c60f3
Compare
39c60f3 to
d031b30
Compare
c74120e to
58b4cfe
Compare
| File "dune-project", line 2, characters 0-13: | ||
| 2 | (pkg enabled) | ||
| ^^^^^^^^^^^^^ | ||
| Error: The (pkg ...) configuration is only valid in dune-workspace, not a | ||
| dune-project. | ||
| Hint: Add this configuration to your dune-workspace file (create one in your | ||
| workspace root if you don't have one). | ||
| [1] |
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.
cc @avsm, since you encountered this situation before, could you give this a read and see if you would have found it useful with your issue before?
Alizter
left a comment
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.
Sorry to keep iterating on the wording but I am still not happy. Let me block this to avoid others merging.
This should be better I think. |
Sure @Alizter |
b740483 to
47180f5
Compare
|
Hey @Alizter, is there any update on the new message text |
|
@benodiwal Did you see my proposed wording above? #12802 (comment) |
Ohh shoot, missed it. Making the change now |
Signed-off-by: Sachin Beniwal <[email protected]>
Signed-off-by: Sachin Beniwal <[email protected]>
Signed-off-by: Sachin Beniwal <[email protected]>
Signed-off-by: Sachin Beniwal <[email protected]>
Signed-off-by: Sachin Beniwal <[email protected]>
Signed-off-by: Sachin Beniwal <[email protected]>
47180f5 to
a95cd99
Compare
Signed-off-by: Sachin Beniwal <[email protected]>
src/dune_lang/dune_project.ml
Outdated
| "Move this stanza to your dune-workspace file. If you don't have one,\n\ | ||
| \ create one in your workspace root." |
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.
You don't need to put new lines in the text. Pp will break it appropriately for you.
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 have fixed it
Signed-off-by: Sachin Beniwal <[email protected]>
Alizter
left a comment
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 great. Thanks!
|
@shonfeder This will be in 3.21, but I don't know if you want to keep the changelog entry since it is package management related. I think its fine to keep in this case but I defer judgement to you. |
Closes #12801