Annoying issue when compiling mibs
mihai at hates.ms
Tue Nov 30 23:20:48 EST 2010
On Nov 24, 2010, at 12:02 AM, David Smith wrote:
> On Tue, Nov 23, 2010 at 4:33 PM, Mihai Balea <mihai at hates.ms> wrote:
>> I believe this is a slightly incorrect behavior. At a very minimum, the compile process should fail with an error message when an explicitly specified source file is not found. However, an even better approach would be to validate the mib_first_files list and prepend "mibs/" if needed. Also, the same first files logic applies to other file types as well. I have not looked into whether this is an issue but I suspect that these other situations could benefit from a simple source file presence check as well.
> Yes, I agree that it should fail if it can't find a specific source
> file...I feel like it did at one time, but maybe that is just my
> The prepending mibs/ seems less clear to me; it would break the
> semantics of other file references (in rebar.config) where you must
> provide a fully-qualified file name.
> A patch to do the file existence check would be wonderful. :)
I was trying to hack up a patch to do that when I ran into a bigger issue. Apparently when rebar recurses through dependency directories, the configuration environment is inherited from the parent directory. Since the root is the top level app directory, the *_first_files (mibs, xrl, yrl) entries in the config list are applied when processing dependencies, including system-wide installed libs. Obviously, the the files will probably not be present in every dependency directory, but at the moment, missing first_files are silently ignored.
I've committed a fix to my fork on github at https://github.com/sbalea/rebar. Please feel free to take a look. It gets first_files definitions from local instead of inherited config and checks if the files are present before attempting to process them. This solves the problem for me, but i am not familiar enough with the code base to guarantee that it won't break something else.
More information about the rebar