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

The dev manual is wrong regarding config files #2245

Closed
samoht opened this issue Jul 7, 2015 · 8 comments
Closed

The dev manual is wrong regarding config files #2245

samoht opened this issue Jul 7, 2015 · 8 comments

Comments

@samoht
Copy link
Member

samoht commented Jul 7, 2015

http://opam.ocaml.org/doc/manual/dev-manual.html#sec40 says $prefix/config/$name.config but it should be $prefix/lib/$name/opam.config. I am not sure that's the best name ever (as we already have opam, $name.install and now opam.config) so this should also be re-design properly -- as there is no user yet, that's a good time.

Moreover, few people have expressed an interest in having an opam config set <var> <value> or something similar. I think that's a good idea.

@dbuenzli
Copy link
Contributor

dbuenzli commented Jul 7, 2015

@samoht do you suggest then that $prefix/config/$name.config would be better ? (unclear from your message).

@samoht
Copy link
Member Author

samoht commented Jul 7, 2015

I came up with the 2 names so I have no opinion on which one is best. But we should be at least consistent ... there's also <pkg>.opam instead of opam who works if you have multiple opam packages in your repository, so ???/<pkg>.config could also work.

@samoht
Copy link
Member Author

samoht commented Jul 7, 2015

Note: storing the config file in the directory is good because that's less implicit installation magic (although we already move the .install in some other dir). Storing the file in config might be good if we want to persist data across reinstallation.

@hannesm
Copy link
Member

hannesm commented Jul 7, 2015

since it is user-defined and should imho be persistent across reinstallations (otherwise, opam update && opam upgrade doesn't work intuitively, and not reset all user-configured flags), it'd be great to have it in $prefix/config/.

I'm not sure whether there should be a single file (and variables being prefixed by package name), or one file per package (slightly prefer the former).

@dbuenzli
Copy link
Contributor

dbuenzli commented Jul 7, 2015

Storing the file in config might be good if we want to persist data across reinstallation.

I don't think it makes sense to persist the data across reinstallation. The config file is supposed to give information about the installation. If you want to use this as a way to configure the installation then I think another mechanism should be provided.

@hannesm
Copy link
Member

hannesm commented Jul 7, 2015

@dbuenzli right, these are two different things, and information about the installation should be kept in $prefix/lib/<pkg>/somewhere.

@dbuenzli
Copy link
Contributor

dbuenzli commented Jul 7, 2015

information about the installation should be kept in $prefix/lib//somewhere.

Yes, the rationale for this was made here.

So this means that maybe we could use the $prefix/config/$pkg.config for the persistency of per package variables. But still I think the design needs more work, mainly I would like to be able to document and declare the variables in the opam files themselves, so that we can actually advertise their existence in e.g. opam info PKG and have opam config set $PKG $var $value provide good errors message (e.g. if you are trying to set an inexisting variable).

@dbuenzli
Copy link
Contributor

dbuenzli commented Jul 7, 2015

I would like to be able to document and declare the variables in the opam files themselves

and provide a default value.

I'm writing up a proposal and thinking this with assemblage in mind in the sense that theses new variable declarations could be automatically added during opam metadata sync from assemblage configuration keys (they do have all the required info a name, a default value and a doc string, let's be DRY).

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

No branches or pull requests

4 participants