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

Data dependencies make reference to workspace #22162

Open
lgalfaso opened this issue Apr 27, 2024 · 0 comments
Open

Data dependencies make reference to workspace #22162

lgalfaso opened this issue Apr 27, 2024 · 0 comments
Labels
team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: documentation (cleanup) untriaged

Comments

@lgalfaso
Copy link

Page link:

https://bazel.build/concepts/dependencies#data-dependencies

Problem description (include actual vs expected text, if applicable):

The page in the link reads

These files are available using the relative path path/to/data/file. In tests, you can refer to these files by joining the paths of the test's source directory and the workspace-relative path, for example, ${TEST_SRCDIR}/workspace/path/to/data/file

The reference to workspace in this link would make you believe that you can make a reference to any workspace, including the workspace for any dependency.

Eg. Say you have a dependency foo. This dependency has a BUILD file at the root that reads

filegroup(
    name = "bar",
    srcs = glob(["man/**/*.txt"]),
)

Say that @foo//:bar contains 1000s of files.

Then you have a cc_test that you would like to use the files from @foo//:bar.

cc_test(
    name = "some_test",
    srcs = ["some_test.cpp"],
    data = ["@foo//:bar"],
)

then following the doc, I would expect for ${TEST_SRCDIR}/foo/man to be reference to the man directory in @foo//:bar (for completeness, say that the workspace name of @foo is "foo").

This is not the case (and my understanding is that this is not the expected behaviour).

Where do you see this issue? (include link to specific section of the page, if applicable)

No response

Any other information you'd like to share?

No response

@lgalfaso lgalfaso added team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup) untriaged labels Apr 27, 2024
@sgowroji sgowroji added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: documentation (cleanup) untriaged
Projects
None yet
Development

No branches or pull requests

4 participants