distutils-r1 handles that 'from inside' right now. Would be useful to make it public instead.
It's already there for a while.