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

Add prototype 'opam build' command #2822

Merged
merged 1 commit into from
Jan 18, 2017
Merged

Add prototype 'opam build' command #2822

merged 1 commit into from
Jan 18, 2017

Conversation

AltGr
Copy link
Member

@AltGr AltGr commented Jan 13, 2017

Provides tools for using a project directory from CWD.

Will auto-init and create a local switch unless specified otherwise.

Scans for local opam files and builds based on them.

Can install by copying the artefacts from the local switch to a given prefix.

Handling a local conf file that can give the specifics of how to create the
switch would be a nice addition.

@avsm
Copy link
Member

avsm commented Jan 16, 2017

This is exciting! Once merged, I can try include it in the CI and try it on the larger set of MirageOS opam packages. Does it require that the opam-version be OPAM2, or can it transparently pin to the existing OPAM1-format files that all the repos have?

@avsm
Copy link
Member

avsm commented Jan 16, 2017

It would be useful to be able to setup custom remotes and pins for this, as our master branches quite habitually require some customisation of the OPAM universe before things compile. How about an .opamrc that executes the local build commands after the init? That could also be interpreted by CI systems for their setup as well.

e.g. .opamrc:

opam remote add dev https://github.com/mirage/mirage-dev
opam pin add prometheus --dev

Provides tools for using a project directory from CWD.

Will auto-init and create a local switch unless specified otherwise.

Scans for local opam files and builds based on them.

Can install by copying the artefacts from the local switch to a given
prefix.

Handling a local conf file that can give the specifics of how to create
the switch would be a nice addition.
@AltGr
Copy link
Member Author

AltGr commented Jan 17, 2017

Indeed. We already have .opamrc files, but these are only useful for the original opam init command (they can define global variables, e.g. sys-ocaml-version, remotes, a formula to choose the default compiler, etc.) We also have export files that can be used to define a given package selection, pins,etc.

None of those will be automatically used by opam build at the moment, though.

  • an export file with a certain pre-defined name could be used automatically to initialise the switch (possibly depending on e.g. OS). Think "lock files".
  • a switch-init file format could be defined, similar to opamrc, but tailored for specific switch initialisation: allowing to define switch-local variables, pre-select repositories, choose compiler, etc. There may be some overlap with the above export files, which could be included or selected using a formula.
  • for depending on specific pins, see the proposal at [Feature Request] Specify exact git commit of a dependency #2762

Once properly defined, either wouldn't pose specific difficulties to implement, for interpretation when opam build is initially called and creates the local switch. However, what exactly should be done on further calls, if the files changed, isn't obvious and needs careful thought, and, maybe, careful handling.

@AltGr AltGr merged commit e8900ab into ocaml:master Jan 18, 2017
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.

2 participants