#1069 Problem with build's outDir && FAN_ENV_PATH

bryanheadley Thu 8 Apr 2010

If I specify an outDir in my build.fan (say, to out/), fan will build my pod file and put it into that directory, relative to my project.

Now, so I want to run the pod file. And I go and set environment variables,

export FAN_ENV=util::PathEnv export FAN_ENV_PATH=/home/bheadley/NB/ThirdTest/out

(which is the absolute path of out/)

When I try to run said pod, I get an UnknownPodErr.

Why? Because PathEnv.findAllPodNames() presumes that all pods are in relative directory lib/fan/, relative to the directory(s) in FAN_ENV_PATH. And indeed, if I make such a directory, the pod is found & run.

But, then, either outDir in build.fan is wrong for not appending lib/fan to the specified value, or PathEnv is wrong for assuming lib/fan/ for all specified paths.

So the semantics of one mechanism is wrong versus the other.

Bryan

andy Thu 8 Apr 2010

I don't think there should be any special rules with outDir. I suppose you could make it more repo-based - but I think its probably right the way it is.

It is a gotcha though if you are unaware of how Fantom loads pods - so maybe some documentation is warranted somewhere.

bryanheadley Thu 8 Apr 2010

It's slightly inconsistent in that its not the directory of a repository, but an absolute directory, and the environment variable is assuming paths of repositories.

I can take care of the issue from the IDE side, remembering to make sure outDir always has lib/fan at the end of its specified path, but then knows to set the FAN_ENV_PATH right when running/debugging the built pod.

Thanks.

brian Sat 10 Apr 2010

I think as a general rule you should never use outDir unless you have some special tool. Rather the preferred mechanism is to let it fallback to Env.workDir + "lib/fan".

Login or Signup to reply.