-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
subclass distutils UnixCCompiler for more control over building native extensions in setup.py invocation #5661
Comments
Thinking about implementing this -- was struck that it might be useful to spin this off into its own package on pypi that doesn't depend on the pants package (something like |
Discussed with @stuhood offline and decided that decoupling this from its usage in Pants would make this harder than necessary at first, but I definitely think that makes sense after we hammer it out here. |
…tensions in setup.py (#7126) ### Problem Resolves #7016 (see [mirrored `pants-devel` post](https://groups.google.com/forum/#!topic/pants-devel/Y37d0tf4bKo)). This unblocks #6855 and #7046, as well as further work on #7122. Closes #5661, closes #6841. I also made a long, long-overdue [github project for native code](https://github.com/pantsbuild/pants/projects/11). ### Solution - Use the host environment to invoke compilers and linkers as desired in distutils, don't try to inject our own toolchain. See #5661 and #7016 for why this is extremely difficult to maintain. ### Result Further native backend iteration is unblocked.
It's really hard to invoke a setup.py and have it "just work" when providing a toolchain as in #5490. See this FIXME -- it looks like I may have restarted all the failing builds that spawned this comment, so the gist is that setup.py will fail because it cannot be told not to use
x86_64-linux-gnu-gcc
to link native extensions (even withCC=clang
, which makes compilation to object files succeed). The FIXME describes subclassingdistutils
'sUnixCCompiler
(also see parentCCompiler
) to control the compiler that is invoked.The implementation of this would be simple: just compile all the files and link into shared libraries. You can see that's just what
UnixCCompiler
is doing in the link above. This would need to be provided to a setup.py subject of apython_dist()
target, and we should probably try to make it so the setup.py doesn't have to be modified.The text was updated successfully, but these errors were encountered: