-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
create a compiler and/linker compatibility argument like python interpreter constraints #7122
Comments
This ticket consists of:
In terms of testing, I would be fine if we added a couple targets to the ctypes testproject which use the new argument, and extended the current test which checks the info log to see which compiler was selected (it would be good if we could extend that to the linker as well if it's not already). #7046 would be great testing, but it is now blocked on #7016, so #7046 is probably going to land after this ticket. Some notes on
|
Last thing -- I think we should eventually enforce that all of the targets that we link together in
I don't think we should do this as part of the above, and would prefer to wait until we have ported the native backend to v2 rules. For now we can assume that compile outputs from clang and gcc are compatible, and stick to the above (it might be good to leave a comment about this, though). |
…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.
Closing as the native backend was initially removed from 2.0. |
We created an example of building TensorFlow custom operators in #7046. As described in the TensorFlow docs, g++ must be used to compile custom operators. We currently work around that by defaulting the the
toolchain_variant
tognu
, which tells pants to useg++
to compile C++ (andld
from binutils to link it).We should probably have some analogy of python interpreter constraints for compilers and linkers to overcome this hygienically, without having incompatible build products mixed around.
bazel seems to be trying to do this with toolchains (that page also has some good reasoning on how to do this in general), but I am under the impression that CROSSTOOL is still the main/only way to actually hook into compilers and linkers, as there is a lot of implementation behind the toolchains idea that bazel hasn't gotten around to yet. If it works, we may be able to steal the idea, but we should make sure that bazel toolchains are trying to solve the same problem we are.
The text was updated successfully, but these errors were encountered: