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

missing functionality: ability to do download, build and install as separate steps #2895

Open
ghost opened this issue Mar 28, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 28, 2017

The functionality that we (part of the Coq team) currently miss is the ability to do these steps:

  • download
  • build
  • install

separately. At the moment, install command does all that (an more).

The reason is that we are using OPAM to distribute Coq packages.
At the moment we are investigating whether we can rely on opam command in our benchmarking machinery. Natually, we would like to measure only build phase (not download, not install).

Currently, they are mixed together even though the necessary input for each these actions is already clearly separate.

I am not sure if this qualifies as a missing feature because I am not sure whether this could be useful to other team (I can imagine that it could be useful to Ocaml team, @gasche what do you think?).

Let me know whether this qualifies or not.

@avsm
Copy link
Member

avsm commented Mar 28, 2017

This would also be useful for the OPAM CI, which could do sandboxed builds without external network access if it had commands to prepare the build environment (for Git clone etc) separately from the build phase.

The lack of external network access, combined with OPAM2's sandboxed installation, would improve security and reproducibility of builds significantly.

@dra27
Copy link
Member

dra27 commented May 21, 2017

@avsm - we can sort of do this with the developer mode proposed in #2937. Though even that would require URL rewriting to local copies for Git clones.

@MatejKosik - it's probably not of much use to OCaml itself, as it sits below opam (and we have enough circular dependencies to contend with in FlexDLL and, soon, Menhir!), but regardless I think this is a good idea.

@AltGr
Copy link
Member

AltGr commented Sep 27, 2017

Having a download-only option that fills the local cache would be fairly easy. However, building without installing would be tricky for several reasons: ① packages expect their dependencies to be installed before they get built, ② the build directories are in general generated fresh and wiped after the build (although there is --keep-build-dir/--reuse-build-dir).

One solution that I could suggest for benchmarking, though, is to use the hooks. These need to be configured by hand in ~/.opam/config, and are documented here. For example, you could use:

wrap-build-commands: [ "/usr/bin/time" "-o" "/tmp/timings" "-a" "-f" "%{package}%: %e %C" ]

and then gather all the data from /tmp/timings. You probably also want to disable parallel builds (use -j 1 or OPAMJOBS=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants