Skip to content

'data' attribute ignored in cc_import targets #18844

@nnmm

Description

@nnmm

Description of the bug:

The 'data' attribute of cc_import appears to have no effect. It's does not even throw an error when pointed to a nonexistent file.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Create precompiled library:

echo "int getRandomNumber() { return 4; }" | gcc -x c - -fPIC -shared -o libxkcd.so

main.c

int getRandomNumber(void);

int main() {
  return getRandomNumber() - 4;
}

BUILD.bazel

cc_import(
	name = "xkcd_rand",
	shared_library = "libxkcd.so",
	data = ["some_nonsense_file.doc.exe.psd"],
)

cc_binary(
	name = "exe",
	srcs = ["main.c"],
	deps = [":xkcd_rand"],
)

Which operating system are you running Bazel on?

Ubuntu 20.04

What is the output of bazel info release?

release 6.2.1

Metadata

Metadata

Labels

P2We'll consider working on this in future. (Assignee optional)team-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