Skip to content

Missing dependency declaration with path mapping #23681

Closed

Description

@fmeum

I was testing this out with #23630 applied, I got pretty far but I hit this issue:

ERROR: AsyncRT/BUILD.bazel:138:23: Compiling AsyncRT/lib/Runtime/Globals/Globals.cpp failed: undeclared inclusion(s) in rule '//AsyncRT:RuntimeGlobals.static':
this rule is missing dependency declarations for the following files included by 'AsyncRT/lib/Runtime/Globals/Globals.cpp':
  'bazel-out/cfg/bin/external/gperftools/tcmalloc/include/gperftools/tcmalloc.h'

Where the header here is from a rules_foreign_cc target:

configure_make(
    name = "tcmalloc",
    autogen = True,
    configure_in_place = True,
    configure_options = [
        "--enable-shared=no",
    ],
    copts = [
        "-fPIC",
        "-w",
        "-fexceptions",  # Needed for tests, which ideally we wouldn't build
        "-Wno-register",
    ],
    lib_source = ":all_srcs",
    out_static_libs = ["libtcmalloc_minimal.a"],
    target_compatible_with = select({
        "@platforms//os:linux": [],
        "//conditions:default": ["@platforms//:incompatible"],
    }),
    visibility = ["//visibility:public"],
)

It might be relevant that I access it through an alias (although removing that doesn't help):

alias(
    name = "tcmalloc",
    actual = select({
        "@platforms//os:macos": "@gperftools-macos//:tcmalloc",
        "@platforms//os:linux": "@gperftools//:tcmalloc",
    }),
)

Are you tracking this one?

Originally posted by @keith in #22658 (comment)

Activity

  1. self-assigned this
    on Sep 19, 2024
  2. added
    P1I'll work on this now. (Assignee required)
    team-Configurabilityplatforms, toolchains, cquery, select(), config transitions
    on Sep 19, 2024
  3. fmeum commented on Sep 19, 2024

    @fmeum
    CollaboratorAuthor

    @keith I added integration test coverage for headers from an external repo, but everything works there. Could you try to build a reproducer for me?

  4. keith commented on Sep 19, 2024

    @keith
    Member

    Here's a repro, I didn't try to isolate more than using this rules_foreign_cc target

    repro.zip

  5. nikhilkalige commented on Sep 24, 2024

    @nikhilkalige
    Contributor

    This may be of help #21718 (comment)

  6. added a commit that references this issue on Sep 24, 2024
    9cfffdf
  7. added a commit that references this issue on Sep 24, 2024
    714e888
  8. added a commit that references this issue on Sep 26, 2024
    4f0b439
  9. iancha1992 commented on Oct 11, 2024

    @iancha1992
    Member

    A fix for this issue has been included in Bazel 7.4.0 RC1. Please test out the release candidate and report any issues as soon as possible.
    If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=7.4.0rc1. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionsteam-Rules-CPPIssues for C++ rulestype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions