-
Notifications
You must be signed in to change notification settings - Fork 512
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
REBAR_SRC_DIRS
not available in hook
#2869
Comments
The gotcha here is that while the The I don't think that it would hurt at this point to just pass in the defaults in |
I also think so. I see What I'd also like to have is to respect I'll make a PR when I find some time EDIT: Almost every variable can change after plugin compilation, so values actually depend on when you call it. I'll include a note on that in the docs |
The recursive options are likely going to be a bit of a mess, because they change between the |
I wonder if this is the BaseDir which we want in both cases. IMO, both REBAR_APP_DIRS and REBAR_SRC_DIRS should point to either original app/src dirs or to the built ones. REBAR_APP_DIRS points to the built app directories which is totally fine, but if we resolve "src" with "_build/default" as the base dir, we'll get nonexisting path. If we want REBAR_SRC_DIRS to point to the built src directories we need to resolve it with Considering |
For the The whole recursive aspect is an incredible pitfall (see root dir extra source paths for example. I think we are somewhat painted in a corner -- which may not be surprising since the recursion settings were turned on accidentally early on and then when we noticed people already depended on it. The rules are inconsistently applied depending on the context to optimize for breaking the fewest things possible. I don't know we'll have a great solution out of it either way. If I recall properly, the src_dirs are recursive, but the extra_src_dirs are not by default, but that can be overridden too. So based on how the options are passed and which directory is being analyzed for the hooks, you may actually get funny results there that are not widely consistent. One thing to note is that we search for files recursively within the src_dirs (by default) but we don't necessarily consider all the subdirectories to be source files, it really depends on what they contain. I'm saying this because it's possible that people have src_dirs like src/ with many languages in them (erl, ex, js) and so marking the recursively should return all directories and subdirectories in there, which may be more than desired for deep structures. Anyway, as a tl;dr:
|
Based on #2847 , I've found that
REBAR_SRC_DIRS
is empty. All other variables are actually exposed, but that one is set to""
.To reproduce, simply put this into config:
and then run
rebar3 compile
and see it outputs empty stringWanted behavior: have a
:
separated list of source directories (including extra ones).I'm trying to finish docs about those env variables and this one is problematic.
The text was updated successfully, but these errors were encountered: