-
Notifications
You must be signed in to change notification settings - Fork 235
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
Upgrade to 5.1.1: use compiler-libs' compression functions #1714
Conversation
2230f56
to
9f47271
Compare
Note that for 5.2, the |
So this is not ideal: linking compiler-libs lead to almost doubling Merlin's binary's size (10M -> 17M). |
is that an issue in terms of performance? |
@@ -35,7 +35,7 @@ type cmi_infos = { | |||
} | |||
|
|||
let input_cmi ic = | |||
let (name, sign) = (input_value ic : header) in | |||
let (name, sign) = (Ocaml_compression.input_value ic : header) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that still work when compression is disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's how it's done in the compiler: https://github.com/ocaml/ocaml/blob/5.1/file_formats/cmt_format.ml#L108
It's actually a simple call to Stdlib.input_value
that looks like it will be able to input both compressed (if supported) and uncompressed data.
I don't think it should have a noticeable impact: the actual binary that need to start quickly is the one written in C. We tried other approaches but could not get something reasonable so we are going to keep the solution in that PR and switch to an external library when it will be available. I will cut a release tomorrow. |
e5275d3
to
7ab0e75
Compare
(35fdd0226e2e05a1a8244ecfec780b563b23b59c)
7ab0e75
to
fcdd507
Compare
7f3af9d
to
15491d0
Compare
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) - Add support for OCaml 5.1.1 (ocaml/merlin#1714) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) - Add support for OCaml 5.1.1 (ocaml/merlin#1714) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-501) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-414) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) - Add support for OCaml 5.1.1 (ocaml/merlin#1714) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-501) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-414) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
This should fix #1713
@trefis I decided to rely on the new
Compression
module fromcompiler-libs
(in 2230f56). This greatly simplify the update. Does that feels right to you ? Not doing that would mean also vendoring the c-stubs for zstd and check how the compiler was configured...