Skip to content

State changes from provider hooks are ignored #2914

Open
@filmor

Description

The functions to call provider hooks don't return the state.

My use-case is my work on protocol consolidation in https://github.com/filmor/exerl/blob/main/src/exerl_prv_consolidate.erl. The process is essentially:

  • Discover all protocol implementations in the code path of all project apps and deps
  • Consolidate and place in some app's ebin (currently just the first project app)

The original protocol module and the consolidated "dispatch" module have the same name.

This works, so far. However, now I would like to add "seamless" release support. relx checks for duplicates (which errors on the protocol modules) but can be convinced to exclude modules. This requires an explicit configuration in the relx section of the rebar.config or a separate relx.config.

While I can modify the State in my provider, this has no effect if it's used as a hook: https://github.com/erlang/rebar3/blob/main/apps/rebar/src/rebar_hooks.erl#L20

Would you be open to a PR that adjusts this behaviour or is there a better way to achieve what I'm trying to do?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions