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

Cache results from ocamlfind query in _build/ #5550

Closed
vicuna opened this issue Mar 20, 2012 · 3 comments
Closed

Cache results from ocamlfind query in _build/ #5550

vicuna opened this issue Mar 20, 2012 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Mar 20, 2012

Original bug ID: 5550
Reporter: @gasche
Status: resolved (set by @damiendoligez on 2017-03-03T13:55:42Z)
Resolution: suspended
Priority: normal
Severity: feature
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: @gasche @diml @hcarty

Bug description

Anil Madhavapeddy reported that he uses ocamlbuild on large build trees for Mirage, and found the -use-ocamlfind integration unusable in his case because of the ocamlbuild's repeated invocation of ocamlfind query. His workaround is to devise his own ocamlfind logic in myocamlbuild.ml, that reuse library-location information gathered at ./configure time.

It would be nice if ocamlbuild cached ocamlfind query results in the _build/ subdirectory, so that they don't have to be recomputed across ocamlbuild calls.

Additional information

After a quick look at ocamlbuild/findlib.ml, it appears that ocamlbuild already caches ocamlfind query results across a single ocamlbuild run, by using a hashtable at runtime. So this amount to making this hash-table pervasive by somehow storing it in a file in _build.

@vicuna
Copy link
Author

vicuna commented Mar 20, 2012

Comment author: @gasche

Marking this acknowledged after discussion with xclerc.
As always, patches are welcome.

@vicuna
Copy link
Author

vicuna commented Mar 20, 2012

Comment author: @gasche

Remark: if documented, that feature should be documented because the user could observe caching by compiling a project, installing/removing/updating ocamlfind stuff, then recompiling from (now outdated) cached information.

I don't think there is any magic technique to detect such getting-out-of-date case: does ocamlfind store a time-of-last-update somewhere that is less costly to access that ocamlfind query? But this is probably a rare case and we could just document it and recommend to -clean on such occasions, or provide a -clean-ocamlfind option, or advise to rm _build/ocamlfind.cache or something.

@vicuna
Copy link
Author

vicuna commented Mar 3, 2017

Comment author: @damiendoligez

ocamlbuild is now a separate project that lives on GitHub.
PR transferred to ocaml/ocamlbuild#211

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

1 participant