Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cython magic fail if cache dir is deleted while in session #3010

Closed
juliantaylor opened this issue Mar 10, 2013 · 3 comments · Fixed by #3540
Closed

cython magic fail if cache dir is deleted while in session #3010

juliantaylor opened this issue Mar 10, 2013 · 3 comments · Fixed by #3540
Labels
Milestone

Comments

@juliantaylor
Copy link
Contributor

In [1]: %load_ext cythonmagic

In [2]: %%cython
cimport cython
   ...: 

In [3]: rm -rf /home/jtaylor/.config/ipython/cython/

In [4]: %%cython                                    
cimport cython

CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

the command issued is:

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7 -c /home/jtaylor/.config/ipython/cython/_cython_magic_d37c0b24f28dfb69270e82105a4c2e8e.c -o /home/jtaylor/.config/ipython/cython/home/jtaylor/.config/ipython/cython/_cython_magic_d37c0b24f28dfb69270e82105a4c2e8e.o
Fatal error: can't create /home/jtaylor/.config/ipython/cython/home/jtaylor/.config/ipython/cython/_cython_magic_d37c0b24f28dfb69270e82105a4c2e8e.o: No such file or directory

the problematic part is this long path which is not recreated before trying to compile into it:

/home/jtaylor/.config/ipython/cython/home/jtaylor/.config/ipython/cython/
@minrk
Copy link
Member

minrk commented Jul 4, 2013

closed by e945888

@minrk minrk closed this as completed Jul 4, 2013
@juliantaylor
Copy link
Contributor Author

I can still reproduce it with current git head, note that with that commit you have to delete ~/.cache/ipython/cython/

@juliantaylor juliantaylor reopened this Jul 4, 2013
@minrk
Copy link
Member

minrk commented Jul 4, 2013

Gotcha, I must have done something wrong in testing. Thanks for checking.

I tracked this down to a bug in distutils, where its mkpath utility will only ever create a particular path once,
and assume that it still exists forever after for the lifetime of the process. I can make a workaround, but it might be gross.

minrk added a commit to minrk/ipython that referenced this issue Jul 4, 2013
workaround by clearing the distutils mkpath cache,
which prevents it from ever creating a given path more than once.

closes ipython#3010
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
workaround by clearing the distutils mkpath cache,
which prevents it from ever creating a given path more than once.

closes ipython#3010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants