Skip to content
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

Export config as library Ocamlcompconfig #9992

Closed
wants to merge 3 commits into from

Conversation

lthls
Copy link
Contributor

@lthls lthls commented Oct 26, 2020

A draft proposal for the option of exporting the Config module as a library of its own, as discussed in #9842.

@lthls lthls mentioned this pull request Oct 26, 2020
@dra27
Copy link
Member

dra27 commented Oct 26, 2020

I had originally thought it could be included in ocamlcompconfig.cma as config.cmo with that being a strength to prevent linking ocamlcommon and this at the same time, but that's possibly cruel to Dune!

LGTM - just an update to the header in utils/config.mli advertising that it's also available as Ocamlcompconfig in ocamlcompconfig.cma and also that, although the usual caveat emptor for compiler-libs applies, the interface isn't expected to change in a breaking manner very often.

@lthls
Copy link
Contributor Author

lthls commented Oct 26, 2020

I decided to go with a copy instead of reusing the original Config name to prevent various kinds of conflicts:

  • Config is a very common name, it likely occurs in a number of OCaml programs already.
  • While linking against both ocamlcommon.cma and ocamlcompconfig.cma should be discouraged, if you build an executable that uses two libraries, one linking against ocamlcommon.cma and the other against ocamlcompconfig.cma you can't avoid it.

@lthls
Copy link
Contributor Author

lthls commented Nov 26, 2020

It was discussed in the developer meeting that draft PRs should be more explicit about why they are in draft mode only.
For this one, I put it in draft mode because it is here to support the discussion at #9842, and I'm waiting for the discussion there to converge before getting this one out of draft mode.

@dra27
Copy link
Member

dra27 commented May 12, 2021

  • While linking against both ocamlcommon.cma and ocamlcompconfig.cma should be discouraged, if you build an executable that uses two libraries, one linking against ocamlcommon.cma and the other against ocamlcompconfig.cma you can't avoid it.

My feeling for this was that this really should be for executables - if a library has some need for a module from compiler-libs, then it really ought to link compiler-libs? It seems potentially more risky to me to have an executable which could have 3 interpretations of the configuration (one from Config, one from Ocamlconfig and then of course the actual configuration!).

@dra27 dra27 mentioned this pull request May 19, 2021
@dra27
Copy link
Member

dra27 commented May 20, 2021

#10419's merged, so I think this can be closed.

@dra27 dra27 closed this May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants