-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Handle native python modules #1475
Comments
This might be related depended on #146 |
I've gotten this to work by building the extension as a cc_binary shared object (linkstatic = 1, linkshared = 1), and adding it in the 'data' section of py_library rules that depend on it. |
How does using |
AFAIK, the exact output of Have you tried making a wrapper py_library wrapper in the same package? Something like this:
You could make a macro to make it less awkward. |
The problem arises as soon as you no longer have |
Sure -- that's why I suggested using the wrapper |
@ioctl0 Thanks that works fine for me.
and unless I add the |
Are you building libboost_filesystem as a bazel target, or including it in your build as a binary in your source tree? If the former, you could put it in '''deps''', in which case bazel will autmatically statically link it into your .so, so long as you specified '''linkstatic'''. If the latter, you can probably remove it from '''srcs'''. |
@ioctl0 The latter. |
I think that kind of config is going to cause all kinds of trouble -- you might do better if you can include a static library built with -fPIC? |
@ioctl0 It does. And |
Some notes, since I happened to look at this bug report:
|
Already slowly converting. Maybe this should be made more clear in the docs.
The argument against that for me is that I have multiple targets (
We are aware ;)
|
If a |
Possible dup with #701. In any case marking P3 since this isn't happening this quarter. |
Closing in favor of #701. |
Currently when trying to build native python modules it seems to be a one way street.
One can create the native module quite easily via:
but when trying to set it as a dependency it of course is missing the
py
provider:Sadly I also cannot add the
cc_library
assrcs
of apy_library
.Now my question is how would one express the dependency?
For
py_test
to work properly you would want the:foo
directory to be added toimports
.Sadly
imports
is currently not a Provider but a simple String list. A possibility would be to introduce aPyImportsProvider
. Looking atAttribute.Builder
it only works with one Type. So adding the ability to have another Type would perhaps mean to extendAttribute.Builder
to work on a tuple of Types.Should
imports
be reworked?So does
py_library
have to be extended?Is a new
py_native_library
needed?The text was updated successfully, but these errors were encountered: