-
Notifications
You must be signed in to change notification settings - Fork 454
[RPC] Allow formatting while watch server is running #12064
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
|
Hi! Could you provide some context by explaining what you find sketchy about the enabling? |
2ca0ac7 to
9f8f770
Compare
76a520d to
1bd122a
Compare
ef30614 to
69f5c7d
Compare
src/dune_rpc_impl/server.ml
Outdated
| let f _ promote = | ||
| let server = Fdecl.get t in | ||
| let outcome = Fiber.Ivar.create () in | ||
| let target = server.parse_build_arg "(alias_rec fmt)" 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.
Not sold on the idea of having the target be determined by a string parse like this, isn't there a cleaner way?
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.
We don't have access to any of the information of the build targets here since interpretation comes at a later point. If you are uncomfortable by the string, you could use
let target =
Sexp.(List [ Atom "alias_rec"; Atom "fmt" ])
|> Sexp.to_string
|> server.parse_build_arg
inbut ultimately it's the same thing.
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.
Not sold on the idea of having the target be determined by a string parse like this, isn't there a cleaner way?
The cleaner way is to introduce a new build request that offers a stable type for targets.
You are right to be suspicious of this since the way the server is parsing this string depends is dependent on the dune lang. This makes RPC more fragile than needed.
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.
Dune_lang.Dep_conf.Alias_rec (Dune_lang.String_with_vars.make_text Loc.none "fmt") is how it's now done. If there is another way about doing this then I don't know what it is
84568f6 to
77a9fba
Compare
src/dune_rpc_impl/dune
Outdated
| stdune | ||
| unix) | ||
| (synopsis "Dune's rpc server + a usable client")) | ||
|
|
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.
Pet peeve, but this should be sorted. I added dune_lang as I pull it up as dependency in server.ml
77a9fba to
28a68c5
Compare
|
@ElectreAAS Can this be merged now? |
Now, yes it is! |
a79bdb7 to
f4e74ad
Compare
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
effcaf7 to
d1f6af9
Compare
This PR is a second step towards implementing #11958, and is the 'big sister' of #12010.
Like its sister, this PR contains stolen code from Steve's #11900.'Stolen' code has been merged on mainIt is currently in draft modeIt is now ready for review! The mechanism for promotion is now sound :)