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

Share the compilation/installation of ocaml compilers between aliases #107

Closed
samoht opened this issue Sep 5, 2012 · 8 comments
Closed

Comments

@samoht
Copy link
Member

samoht commented Sep 5, 2012

Currently, we download/compile/install a fresh OCaml compiler for each alias (when the compiler is different of system).

A very good optimization would be to do that once for compiler, and add the right path in $PATH for each alias.

@avsm
Copy link
Member

avsm commented Sep 5, 2012

would be good if the compiler files could be cached too. right now a fresh switch requires a net connection.

@avsm
Copy link
Member

avsm commented Sep 5, 2012

(can you tell I'm working on trains quite a lot :-)

@samoht samoht closed this as completed in 155f7f9 Sep 21, 2012
@samoht samoht reopened this Sep 21, 2012
@samoht
Copy link
Member Author

samoht commented Sep 21, 2012

wrong issue number in the commit previous commit ...

@rgrinberg
Copy link
Member

Is this issue on the cards for 2.0? This recompilation thing is very annoying.

Is there anything particularly hard about this or it's just low priority? I would very much like to have this so I wouldn't putting in some elbow grease if this feature is feasible.

@yomimono
Copy link
Member

yomimono commented Jul 6, 2016

I'd also really like this, although I can't commit to putting in any time on it.

@AltGr
Copy link
Member

AltGr commented Jul 7, 2016

This not getting updates is mostly because of issues with relocating the ocaml compiler itself.

Otherwise, with the 2.0 layout of compilers as packages, we could imagine having opam switch install <new-switch> --copy-from <existing-switch> that would create a new switch, and copy the compiler packages and their files from an existing switch to it. It would be possible (assuming that files installed by the compiler haven't changed in the origin switch) now that opam registers owning packages of each installed files.

If this works, we could even detect on opam switch install foo --alias-of bar that a switch based on bar already exists and propose to copy from it instead of recompile.

I don't know where exactly we stand on OCaml relocation. Setting always the proper environment variables in the ocaml packages, to make sure the right paths are used, may help, but note that on unix, the bytecode compilers, e.g. ocamlc, will still start with #!/absolute_path/to/original/ocamlrun. This can be patched with ocp-reloc, but I don't see a clean and generic way of doing this.

Another option could be to compile different versions of OCaml in separate directories and keep them isolated from the actual switches, that would use them like is done for "system" compilers. This sounds a bit tedious to maintain though.

@hcarty
Copy link
Member

hcarty commented Aug 11, 2017

Would it be possible to treat an opam installed switch as a system switch? This could at least allow sharing the compiler itself across switches without requiring an external-to-opam compiler installation.

@AltGr
Copy link
Member

AltGr commented Dec 15, 2017

Superseded by #629

@AltGr AltGr closed this as completed Dec 15, 2017
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

6 participants