-
Notifications
You must be signed in to change notification settings - Fork 415
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
dune-site: use string list instead of Location.t #9662
Comments
cc @bobot |
So the producer depends on The alias |
Yes, I should have mentioned that I have In a way, this relates to #9661. I understand the motivation for the alias, but, in my opinion, this one alone doesn't justify enforcing the dependency on dune-site on the consumer. Maybe the alias could be included in the generated module? Interface before: module Sites : sig
val public : string list
end Interface after: type location := string
module Sites : sig
val public : location list
end Note, the non-exporting type definition as a bonus. Otherwise, good to hear |
I don't understand your proposition, no interface files '.mli' are generated. I'm not against your objective, and I see two possibilities for that as summarized before:
|
My bad, for (1) I wanted to suggest that the interface is also generated, or alternatively But I agree that (2) is simpler and would be my preferred suggestion. Re (3), as mentioned in the description, I did add the interface manually, but I consider this a workaround. |
Desired Behavior
Currently the site module generated with
generate_sites_module
produces code that represents paths asDune_site.Private_.Helpers.Location.t list
, which is simply an alias forstring list
.This means that if such a module is added to a standalone library and consumed as a dependency library the build fails with:
Of course, this can be fixed by depending on
dune-site
in both the sites "producer" library and the sites "consumer" library. I think only the producer should directly depend ondune-site
instead.A simple workaround for this is to add an interface file that constrains the
Dune_site.Private_.Helpers.Location.t list
type tostring list
, but ideally this shouldn't be necessary.I understand that there may be a need to future-proof locations, but would argue that providing a dependency-free interface is an important requirement for users of sites too.
The text was updated successfully, but these errors were encountered: