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

Pass ocamlc explicitly to configurator using DUNE_CONFIGURATOR #695

Merged
merged 4 commits into from
Apr 12, 2018

Conversation

rgrinberg
Copy link
Member

The simplest way of obsoleting the -ocamlc flag. Some notes:

  • We are likely to still want to keep -ocamlc for debugging, but ideally, warn the user that this isn't necessary. Should we use the INSIDE_DUNE variable in configurator to issue a warning when this flag is passed?

  • Ideally, DUNE_CONFIGURATOR would be an s-expression containing all the config info dune wants to pass to configurator. But there's a couple of issues with this. The first one is that it's tough to write an sexp parser in configurator since the Sexp module is in dune itself. And the second issue is that we'd prefer to share the configuration record, but that would require a dependency between dune and configurator. To solve this, I guess we could make Sexp part of usexp (or a separate, internal lib) and then have dune depend on configurator to get the record definition. Not sure if this is right however.

Anyway, the contents of DUNE_CONFIGURATOR is an implementation detail and is easy to safely change. So we can always punt these decisions until later.

@rgrinberg rgrinberg requested a review from a user April 11, 2018 14:32
@ghost
Copy link

ghost commented Apr 11, 2018

Sys.getenv_opt is not available on older versions of OCaml.

@rgrinberg
Copy link
Member Author

Sys.getenv_opt is not available on older versions of OCaml.

Ah yes. We should probably add our own Sys module to stdune to workaround this stuff.

@ghost
Copy link

ghost commented Apr 11, 2018

Should we use the INSIDE_DUNE variable in configurator to issue a warning when this flag is passed?

That seems fine.

Regarding passing a S-expression, I guess we would indeed to move some more code to usexp.

There are a lot of modules in src/ that are specialized, and when extracting them to sub-libraries, I think we should clean them up, document and generalize them a bit. That makes them easier to understand as standalone components. For the S-expression combinators, one thing I don't really like at the moment is that we end up with a discrepancy in the naming, with some functions that are named t_of_sexp/sexp_of_t and some that are named just t. I wanted to sort that out before moving them to usexp.

@ghost
Copy link

ghost commented Apr 11, 2018

Ah yes. We should probably add our own Sys module to stdune to workaround this stuff.

Indeed

@rgrinberg
Copy link
Member Author

Actually, we can just issue the warning when DUNE_CONFIGURATOR is set. This has the same effect.

@rgrinberg
Copy link
Member Author

OK, I implemented the check for DUNE_CONFIGURATOR when parsing -ocamlc. However, I'm kind of tempted to just make -ocamlc a no-op and just emit a warning. $ jbuilder exec ./discover.exe -- -ocamlc foo would still emit a warning when manually testing. Sure, we could check that -ocamlc is actually different from DUNE_CONFIGURATOR, but this is complexity that doesn't seem to justify itself.

@ghost
Copy link

ghost commented Apr 12, 2018

Do we even need to keep the argument at all? Users will need to edit their jbuild file to switch from configurator to jbuilder.configurator, so we might as well remove the argument at the same time.

@rgrinberg
Copy link
Member Author

rgrinberg commented Apr 12, 2018 via email

@rgrinberg
Copy link
Member Author

@diml ok it's gone.

@ghost
Copy link

ghost commented Apr 12, 2018

Looks good

@rgrinberg rgrinberg merged commit f1f60c4 into ocaml:master Apr 12, 2018
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

1 participant