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

Missing dependency declaration with path mapping #23681

Open
fmeum opened this issue Sep 19, 2024 · 2 comments · May be fixed by #23690
Open

Missing dependency declaration with path mapping #23681

fmeum opened this issue Sep 19, 2024 · 2 comments · May be fixed by #23690
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Configurability platforms, toolchains, cquery, select(), config transitions team-Rules-CPP Issues for C++ rules type: bug

Comments

@fmeum
Copy link
Collaborator

fmeum commented Sep 19, 2024

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)

@fmeum fmeum self-assigned this Sep 19, 2024
@fmeum fmeum added type: bug P1 I'll work on this now. (Assignee required) team-Configurability platforms, toolchains, cquery, select(), config transitions team-Rules-CPP Issues for C++ rules labels Sep 19, 2024
@fmeum
Copy link
Collaborator Author

fmeum commented Sep 19, 2024

@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?

@keith
Copy link
Member

keith commented Sep 19, 2024

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

repro.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Configurability platforms, toolchains, cquery, select(), config transitions team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@keith @fmeum and others