-
Notifications
You must be signed in to change notification settings - Fork 520
Tweak manifest plugin to return ELP compatible information. #2910
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
Conversation
Since this provider was marked as experimental I don't see big problems with changing the format. That none of the tests captured it does point to some of these tests eventually needing some hardening, particularly to get out of experimental mode. |
That's exactly the plan. One thing we're considering is if we shouldn't simply output JSON, easier for tools to consume, given that OTP 27 comes with it. Of course we'd have to detect whether the |
Yes, should output json I think. Or at least take a |
8201256
to
9353ecb
Compare
format_error(no_json_module) -> | ||
io_lib:format("The 'json' module is not available. Either upgrade to OTP 27 or use a different format.", []); |
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.
"Either upgrade to OTP 27 or newer, or select a different output format." maybe
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.
Fixed the spelling, thanks.
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.
Seems good to me at this point, anything else you wanted on this or it's ready to go?
Ready to go for now. |
@ferd Not terribly urgent, but what's the ETA for the next rebar3 release? |
Yeah I'm probably due to cut a new one. Will try it this week, next week at the latest. |
3.24.0 was just released: https://github.com/erlang/rebar3/releases/tag/3.24.0 |
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [erlang/rebar3](https://github.com/erlang/rebar3) | minor | `3.22.0` -> `3.24.0` | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the warning logs for more information. --- ### Release Notes <details> <summary>erlang/rebar3 (erlang/rebar3)</summary> ### [`v3.24.0`](https://github.com/erlang/rebar3/releases/tag/3.24.0) [Compare Source](erlang/rebar3@3.23.0...3.24.0) New features: - [Turn rich compiler errors on by default](erlang/rebar3#2881) - [Tweak experimental manifest plugin to return ELP-compatible information](erlang/rebar3#2910) Bug fixes: - [make escriptize reproducible by setting timestamps for files in zip to unix epoch](erlang/rebar3#2900) - [Log path when plugin template file read fails](erlang/rebar3#2899) - [Prevent infinite compiler DAG growth](erlang/rebar3#2892) - [Port Relx compatibility fix for escript files in OTP-27](erlang/rebar3@26cd527) Internal maintenance: - [Made `rebar_utils:filtermap/2` to call directly `lists:filtermap/2`](erlang/rebar3#2907) - [Cleaned up additional definitions in `bootstrap`](erlang/rebar3#2905) - [Replaced rebar_utils:find_source/3 by a call to filelib:find_source/3](erlang/rebar3#2904) and [Marked rebar_utils:find_source/3 as deprecated](erlang/rebar3#2901) - [Fixing various typos in comments, types, and function names](erlang/rebar3#2902) - [Bump hex_core and certifi dependencies](erlang/rebar3#2898) - [Remove legacy hostname checks](erlang/rebar3#2896) - [Replaced group_by_namespace/1 by a call to maps:groups_from_list/2](erlang/rebar3#2895) - [Removed legacy OTP_RELEASE macro statements](erlang/rebar3#2891) - [Removed legacy fun_stacktrace usage](erlang/rebar3#2889) - [Removed unsused platform_define options](erlang/rebar3#2888) - [Standardizing templates indentation](erlang/rebar3#2884) Regarding rich compiler errors, the change is optional. Given the module: -module(fake_mod). -export([diagnostic/1]). diagnostic(A) -> X = add(5 / 0), {X,X}. add(X) -> X. add(X, Y) -> X + Y. Calling rebar3 compile can now yield: ... ===> Compiling apps/rebar/src/fake_mod.erl failed ┌─ apps/rebar/src/fake_mod.erl: │ 5 │ diagnostic(A) -> │ ╰── variable 'A' is unused ┌─ apps/rebar/src/fake_mod.erl: │ 6 │ X = add(5 / 0), │ ╰── evaluati...
Starting the discussion around the actual format to use in the
manifest
plugin.For the time being, instead of returning the raw context, I'm basically adopting the same format previously adopted by the
build_info
plugin, used by the ELP language server. Using the same format avoids changes to ELP itself.I am also adding a
json
format to make it easier for tools to consume the information.Test Plan
Generate build information for the Erlang LS repo via ELP (internally using the
build_info
plugin):Locally modify ELP to use the
experimental manifest
plugin instead, then:Finally compare the two generated files:
The only difference, for each application, is:
This should not be an issue, but we can double check that as a follow-up.