When I try to upload an app with symlinks generated by pip, I get:
$ af update flask-example
different prefix: "" and "/Users/joe/Work/flask-example"
But, then when I "cp -r" the directory into a brand new one copying the contents of the symlinked directories into the new one, it uploads fine.
you're right, it doesn't play well with symlinks. I believe this is by design.
/cc @jvoorhis @lhitchon can you confirm?
Yes, that's right.
It does not allow symlinks that point outside of the project directory.
And the 'cp -r' copies the contents of the files instead of making new symlinks, so the new directory you created should work.
I see. Then, since virtualenv uses symlinks, should we not recommend using it, or should I look for a way to tell virtualenv to not use symlinks?
I don't know much about virtualenv.
But symlinks are okay as long as they don't point outside the project root directory.
It's 'external' links that af will not allow
Ok, this is expected behavior. Current workaround: create a separate directory outside of the app directory for virtualenv, and activate it. Thanks @lhitchon !
Just ran into this myself with a virtualenv. This kind of directory structure is very typical for Django apps::
/env <--- virtualenv directory
But if you use this with AppFog then it blows up with the rather vague different prefix error since the virtualenv has lots of symlinks (to the system Python libraries in it).
Is there a way to have files in your app directory which af will just ignore? Alternatively, might it be useful to special case the virtualenv case? It is fairly easy to divine that a directory is a virtualenv by its contents. (/bin subdir with activate and deactivate scripts ought to be fairly foolproof)
Any interest in such a patch? Or alternatively an .afignore file?
@nyaruka there already is an .afignore file - http://docs.appfog.com/getting-started/af-cli#afignore
I don's use any symlink, but I still have the same error. Can somebody tell me how to solve this?