Skip to content
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

C/C++ dependencies are completely ignored in "perl_xs" targets. #24

Open
PiotrSikora opened this issue Mar 24, 2021 · 2 comments
Open

Comments

@PiotrSikora
Copy link
Contributor

I expect those BUILD rules to work:

perl_xs(
    name = "CacheMemcachedFastXS",
    srcs = ["Fast.xs"],
    defines = [
        "VERSION=\"0.26\"",
        "XS_VERSION=\"0.26\"",
    ],
    output_loc = "arch/auto/Cache/Memcached/Fast/Fast.so",
    textual_hdrs = ["ppport.h"],
    typemaps = ["typemap"],
    deps = [":libclient"],
)

cc_library(
    name = "libclient",
    srcs = [
        "src/array.c",
        "src/array.h",
        "src/client.c",
        "src/compute_crc32.c",
        "src/compute_crc32.h",
        "src/connect.c",
        "src/connect.h",
        "src/dispatch_key.c",
        "src/dispatch_key.h",
        "src/parse_keyword.c",
        "src/parse_keyword.h",
        "src/socket_posix.c",
        "src/socket_posix.h",
    ],
    hdrs = [
        "src/client.h",
    ],
    copts = ["-I."],
    defines = [
        "HAVE_POLL_H",
    ],
    includes = [
        ".",
        "src",
    ],
)

(The complete example is available here: cache_memcached_fast.BUILD)

However, the :libclient dependency is completely ignored, and produced Fast.so is failing at runtime due to missing symbols. I'm not sure why Bazel doesn't pick up this dependency, since CcInfos are merged in perl.bzl.

I've spent more time looking into this that I'm willing to admit, but I couldn't make it work. Any ideas, @skeletonkey?

I can workaround this issue by pulling :libclient sources into :CacheMemcachedFastXS using #23 (see: diff), but that's literally a workaround and not a proper solution.

@skeletonkey
Copy link
Collaborator

Just want to let you know that I'm looking at this. This is a crazy week for me so I hope I can put some real time into this weekend.

@PiotrSikora
Copy link
Contributor Author

@skeletonkey friendly ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants