[erlang-bugs] possible bug in package loading
Eric Merritt
ericbmerritt@REDACTED
Mon Jun 4 01:45:12 CEST 2012
On Sun, Jun 3, 2012 at 3:32 PM, Beads Land-Trujillo
<beads.d.land@REDACTED> wrote:
> Hi Eric,
>
> Would be interested in some clarification as to what you're thinking might
> be handled "better" here? Unless I'm mistaken, this is per spec.
It could be per spec. It just seams like a poor user experience. I
would probably just wander up the directory chain to see if the module
name matches the current structure. That said I suspect there are a
couple of unintended consequences to that.
>
> One can argue with the elegance of the spec (I'm actually working on some
> hacks for using packages to get around this design), which is why I'm
> interested in the question.
>
> Is your contention that the compiler should generate some other sort of
> message when finding a module declaration that doesn't match the directory
> structure as mapped to a package path?
I would say that it shouldn't actually be an error. Maybe an
informational message to get folks to fix their paths but that it. The
module is good and in the path after all.
That said its not a big deal. I have only run across this once and it
was pretty easy to figure out the issue and get it resolved.
>
> - Beads
>
> http://tanglelabs.com/
>
>
> -----Original Message-----
> From: erlang-bugs-bounces@REDACTED [mailto:erlang-bugs-bounces@REDACTED]
> On Behalf Of Eric Merritt
> Sent: Saturday, June 02, 2012 11:23 AM
> To: erlang-bugs@REDACTED
> Subject: [erlang-bugs] possible bug in package loading
>
> I realize that packages are not technically supported. However, I ran across
> a rather ugly (possible) bug that, as long as packages are in the language,
> should probably be resolved.
>
> The bug is this. Lets say you have a bin dir at
> /some/directory/structure/ebin and you have packages under this, say package
> foo.shell. If you accidentally set your package to
> some/directory/structure/ebin/foo the code loader dies saying
>
> =ERROR REPORT==== 2-Jun-2012::10:17:17 ===
> beam/beam_load.c(1250): Error loading module shell:
> module name in object code is foo.shell
>
> Technically I can see why this is an issue. However, I suspect it can be
> handled better then it currently is.
>
> Eric
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
More information about the erlang-bugs
mailing list