Open decoda opened 1 year ago
Generally the hooks can be run more than once to account for app-specific hooks and project-wide hooks. See https://rebar3.org/docs/configuration/configuration/#hookable-points-in-providers for details.
Looking at the logs, there are two message variations:
Running hooks for clean in app test_nif ...
Running hooks for clean with configuration ...
I believe what you are seeing is the hook running first for the app itself, and then for the project as a whole.
I'm not sure why the All
flag being set suddenly skips running it against the app though. It appears that -a
makes it run only on deps rather than on apps+deps.
Yes, the clean command with option -a
or --apps
, it's shell hooks on apps are not working correctly. it seems to be an issue.
Environment
Current behaviour
I am learning to build a nif project follow the tutorial(http://rebar3.org/docs/tutorials/building_c_cpp/). It adds the shell hooks in rebar.config.
When i run rebar clean, the hook shell command runs twice.
But when i run the command with option
-a
, it only runs once.I think both of these commands run clean on all apps, with or without options. Why would their behavior be inconsistent? I tried to check the code and found that the parameters passed in these two places are different. https://github.com/erlang/rebar3/blob/69a5898969adac08b30564801ea1d4cd407ffa5b/apps/rebar/src/rebar_prv_clean.erl#L53-L56 the parameters
AllApps
andProjectApps
have differentapp_info_t
content.And i found only the clean hook is being run twice, the compile hook runs once.
I would expect the clean shell post hook to only be once with default option.
Look forward to your help, thanks in advance.