Join GitHub today
Workaround: distutils sdist fails on some filesystems (like VirtualBox shared filesystem) #56
This is not a PyBuilder bug, but I thought this work around might be useful to other PyBuilder users. There is a long standing distutils bug that prevents distutils from working in certain environments. Basically, distutils assumes that all mounted filesystems support hardlinks if
Here is a gist of a workaround that I use: file-sdist_hack-py
If you are encountering "error: Operation not permitted" errors in VirtualBox on the shared filesystem, including the gist's code in
It's admittedly a hack as it monkey patches the distutil_plugin using too much knowledge of the distutil_plugin's internals. Then the monkey patched code generates a
Yeah, I was almost too embarrassed to post this because it's so crude, but I decided it might help someone in a similar position. Since the distutils maintainer is promising to fix this "soon", I didn't try to get too clever. This was meant as a temporary hack that people could put in
That said, it could be useful as part of the default template in
I think it's interesting and useful. I wasn't even aware of this particular issue with distutils.
But it does not only prevent you from publishing locally. You're also unable to install a PyPI package if the aforementioned workaround is not used in
Auric also mentions that
so while I think it's worth considering a property like you proposed, I'm wondering if maybe it should be done by default. Of course I don't like monkey patching
I did not know there were implications on the installation as well, if so I would be more inclined to include it by default. Since distutils explicitly survives a missing
Maybe include it in the template via variable expansion and a property that defaults to true just in case someone wants to disable it?
I did some spelunking through distutils implementation in the sources for Python 2.7.6 and Python 3.3.4.
The only use of
All other invocations of
So while not pretty, I think it is a fairly safe “hack." I did not find a code path in install that would invoke