8000 Tweak manifest plugin to return ELP compatible information. by robertoaloi · Pull Request #2910 · erlang/rebar3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 3 commits into from
Aug 11, 2024

Conversation

robertoaloi
Copy link
Contributor
@robertoaloi robertoaloi commented Aug 7, 2024

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):

elp build-info --project ~/git/github/erlang-ls/erlang_ls --to /tmp/erlang-ls-build

Locally modify ELP to use the experimental manifest plugin instead, then:

elp build-info --project ~/git/github/erlang-ls/erlang_ls --to /tmp/erlang-ls-manifest

Finally compare the two generated files:

diff /tmp/erlang-ls-build /tmp/erlang-ls-manifest

The only difference, for each application, is:

<         "include"
---
>         "include",
>         "src",
>         ""

This should not be an issue, but we can double check that as a follow-up.

@ferd
Copy link
Collaborator
ferd commented Aug 7, 2024

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.

@robertoaloi
Copy link
Contributor Author
robertoaloi commented Aug 8, 2024

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 json module is available and bail out if that's not the case.

@tsloughter
Copy link
Collaborator

Yes, should output json I think. Or at least take a -o json argument.

@robertoaloi robertoaloi force-pushed the tweak-manifest-plugin branch from 8201256 to 9353ecb Compare August 8, 2024 15:06
Comment on lines 77 to 78
format_error(no_json_module) ->
io_lib:format("The 'json' module is not available. Either upgrade to OTP 27 or use a different format.", []);
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the spelling, thanks.

Copy link
Collaborator
@ferd ferd left a 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?

@robertoaloi
Copy link
Contributor Author

Ready to go for now.

@ferd ferd merged commit 1959c16 into erlang:main Aug 11, 2024
6 checks passed
@robertoaloi
Copy link
Contributor Author

@ferd Not terribly urgent, but what's the ETA for the next rebar3 release?

@ferd
Copy link
Collaborator
ferd commented Aug 20, 2024

Yeah I'm probably due to cut a new one. Will try it this week, next week at the latest.

@ferd
Copy link
Collaborator
ferd commented Aug 29, 2024

3.24.0 was just released: https://github.com/erlang/rebar3/releases/tag/3.24.0

heyoka pushed a commit to heyoka/faxe that referenced this pull request Mar 18, 2025
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...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0