#685 File naming bug?

james_earl Fri 24 Jul 2009

First off: hey guys, great language, I've been using it for about 2 weeks now, loving every minute of it. Thanks for your hard work!

I've run into an issue with the latest build (1.0.45) with regards to file names. It appears that fan source files in seperate directories in the same pod are causing build errors. For example:

myPod/
  build.fan
  pod.fan
  fan/
    a/
      fileName.fan
    b/
      fileName.fan

Note that although the file names are the same, the class names are not. When I attempt to build, I got the following error:

compile [myPod]
 Compile [myPod]
   FindSourceFiles [29 files]
   WritePod [file:/C:/../rel/lib/fan/myPod.pod]
C:\..\rel\lib\fan\myPod.pod: Cannot write resource file 'src/fileName.fan'
BUILD FAILED [332ms]!

This is code that would successfully build using version 1.0.44.

To resolve the issue, I renamed one of the files to something unique to the myPod/fan/ directory.

brian Fri 24 Jul 2009

Promoted to ticket #685 and assigned to brian

a ton of stuff got changed around in this build, so I am not surprised

seems like we should support dup names in the different dirs, so I will fix that

brian Wed 4 Nov 2009

Ticket resolved in 1.0.47

I took a look into this issue. The problem is that if you are doing a full compile, the compiler will attempt to copy the source files into into the pod. Source files are always normalized in the zip file as "src/{filename}.fan". So I think it should be compiler error to have duplicate names, otherwise it is ambiguous how to map a given type's "sourceFile".

So what I did was add a real check with more helpful error message.

Login or Signup to reply.