Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature proposal: opam install --justinstall #3380

Open
AltGr opened this issue May 28, 2018 · 7 comments
Open

Feature proposal: opam install --justinstall #3380

AltGr opened this issue May 28, 2018 · 7 comments
Assignees

Comments

@AltGr
Copy link
Member

AltGr commented May 28, 2018

There is currently still something that feels like a hole in our workflows, when working in an opam-aware project: these two are very good

  • use opam install . --deps-only to have opam handle the local source dependencies
  • use make to compile by hand

These can be enough, but sometimes, you need to also test the installation of your package by hand, and things get a bit worse:

  • either run opam install ., but if you do it repeatedly, there will be no incremental compilation, so this can get quite long
  • or run make install (possibly calling opam-installer if you use .install files), to use the results of your make. But then the resulting installation gets into your opam prefix, without being registered by opam, so this is a bit unclean (I admit I am using this a lot, though).

The option --reuse-build-dir and --inplace-build have somehow been attempts at helping here, but are not really satisfactory to that purpose: they are a bit heavy to use, bring some quirks and don't always behave as expected (e.g. --inplace-build will re-run ./configure with its own options from the opam file in your project dir, which may get annoying).


Enough for the summary of the issue, here is an idea to fill that gap:
let the user run the builds with their own tools, but let opam handle just the install part, from the source directory, and assuming the build was done properly. Could be something like:

opam install --justinstall foo

assuming foo is a locally-pinned package, or a directory containing one or more opam packages, run their installation instructions, including handling their .install and .config files if any, and register their installation into opam (then possibly recompiling dependents if any). Another plus is that uninstallation can then be cleanly handled by opam.

This could typically be used just after make, or directly from a Makefile install rule. Implementation-wise, care should be taken that the command is not allowed to modify any dependency of foo.

I'd like to have the input from the users here!

Another idea could be to just extend opam-installer (or a related command built-in opam) so that it registers the installation of the package within opam. It would certainly be simpler, but wouldn't handle installation outside of .install files, consistency with the package definition, or recompilation of dependents.

@Drup
Copy link
Contributor

Drup commented May 28, 2018

That sounds quite useful. I think it could also solve many of @gasche's woes regarding compiler development with opam.

@gasche
Copy link
Member

gasche commented May 29, 2018

The feature you propose sounds very nice. I have no strong opinion over whether it should be in opam install or opam-installer -- having it in the opam binary makes the setup slightly simpler, but well.

(I hadn't thought about the way opam-installer is limited by not being able to register packages within the opam database. Would it make sense for the (un)registration features to be available in an advanced root-administration tool provided in the opam library, that opam-installer or users could call to notify opam of such changes to their roots?)

@gasche
Copy link
Member

gasche commented May 29, 2018

P.S.: I would like to re-do my opam-compiler-conf performance tests under rc2, but the update approach that looked the nicest is stalled because, if I understand correctly,opam-devel 2~rc2 is not in opam yet.

@AltGr
Copy link
Member Author

AltGr commented May 29, 2018

WHAT? Gaaah, I was sure that was merged, should have been done before the announcement !

@gasche
Copy link
Member

gasche commented May 29, 2018

(For the record, it has just been merged by @AltGr)

@AltGr
Copy link
Member Author

AltGr commented May 29, 2018

yes, sorry about the delay...

@avsm
Copy link
Member

avsm commented May 29, 2018

If we do have this flag, it might be better called --install-only to match --deps-only.

@rjbou rjbou self-assigned this Jun 4, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants