avoid command line parsing in a the middle of a library#2754
Draft
v-gb wants to merge 1 commit intoocaml-ppx:mainfrom
Draft
avoid command line parsing in a the middle of a library#2754v-gb wants to merge 1 commit intoocaml-ppx:mainfrom
v-gb wants to merge 1 commit intoocaml-ppx:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #2736.
The change wouldn't make sense to merge as is (for instance, this new
Bin_conf.global_conftype in the interface cannot be constructed from outside the module), this was more written to see how information flows. It'd need a bit of cleanup.The rpc server exe might change behavior slightly (not sure): it doesn't doesn't parse the command line at all. I think any command line flag would have been rejected by the outermost call to cmdliner anyway, but if Cmdliner terms consults environment variables, maybe something could be different here ?
Also the behavior of
update_using_cmdlineis perhaps different, not sure either. Specifically, the old code is doing something likeglobal_conf := apply_cli {!global_conf with lib_conf}vs afterlet new_value = global_conf.apply_cli { default with lib_conf }. I think this repeated mutations ofglobal_confis not necessary, but I'm not 100% sure.