-
Notifications
You must be signed in to change notification settings - Fork 167
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
proper_transformer
has unfavorable behavior for fine-grained compile dependencies
#288
Comments
proper_transformer
has unfavorable behavior for fine-grained dependenciesproper_transformer
has unfavorable behavior for fine-grained compile dependencies
I do not understand the issue at all, let alone why it is important or a problem in some particular context. In my mind, at least, a parse transform is, as its name implies, by definition something that happens at compile time. What does it mean that a parse transform should be lazy? What does it mean to not do parse transform stuff at compile time? What sort of build system carefully tracking compile dependencies are you referring to? Confused... |
A The problem with the way PropEr handles external types is that it's essentially not possible to determine compile time dependencies correctly with it (at least not without encoding specifics of Let's look at an example:
Just looking at the file, I know that I need to essentially compile proper before to build this file. But that's not the entirety that I need to build. Because Since this all happens while executing the For completeness, there is also a path, where this information is tried to be extracted, by compiling the sources, but that path is more "best effort" and easily fails due to missing compiler options, that the build system would provide. When I mentioned lazy here, I meant, that PropEr should do this lookup during runtime only, not compile time. Because we can assume that during runtime all code that we care about has been built and is in path. |
Note that what is being discussed/requested in this issue is not PropEr-specific in any way. You are effectively asking for the functionality of Erlang's Even if PropEr is the only code base doing weird things with a In my opinion, proper(TM) build systems for Erlang should take this into account and not (arbitrarily?) constrain what it is possible to express currently. Anyway, these are my thoughts on this. If you (or anybody else) are interested in fixing this issue, you are welcome to submit a PR that changes the current way PropEr currently disambiguates whether a call |
In the general case, this is not possible for the build system to decide though. Think about the case where the The way how build systems solve this is to put it on the user to provide this information. I'm planning on making a PR, and am happy to chat about the issue more :-) |
Problem
When applying the
parse_transform
, PropEr accesses the abstract code of referenced modules, to determine if calls lead to exported types or not (and branches based on that decision).This creates additional build dependencies on modules using
proper_transformer
. Typically, calls don't need to be considered when building beams, as they are resolved dynamically during run time.Proposed Solution
PropEr should be lazy here when accessing the abstract code of referenced modules.
Why is this important?
With a build system that carefully tracks compile dependencies per-file, it is important to have a robust and quick way to determine these dependencies, and to keep dependencies as flat as possible.
Unfortunately,
parse_transforms
can dynamically pull in additional dependencies during compile time.The text was updated successfully, but these errors were encountered: