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

when bazel running a cc_binary in Windows, the C++ app can't find its data dependencies #4215

Closed
thinlizzy opened this issue Dec 3, 2017 · 2 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) platform: windows type: bug

Comments

@thinlizzy
Copy link

thinlizzy commented Dec 3, 2017

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

I have a cc_binary rule with a single .cpp file and one data dependency. I have no means to tell the application where to find the data.

If possible, provide a minimal example to reproduce the problem:

BUILD file in engine_test/demos directory relative to the WORKSPACE directory

cc_binary(
	name = "test",
	srcs = [
		"Test.cpp",
	],
	data = ["//engine_test/images"],
)

BUILD file in engine_test/images directory. same deal

filegroup(
    name = "images",
    srcs = glob([
        "*.png",
    ]),
)

Test.cpp

#include <fstream>

int main()
{
  std::fstream fs("engine_test/images/test.png");  // can't find the file
  // fs.fail() == true   :(
}

Environment info

  • Operating System: Windows
  • Bazel version (output of bazel info release): release 0.5.4

Have you found anything relevant by searching the web?

#3881 seems to be related, but I also tried to use ($location //engine_test/images) without success.

Anything else, information or logs or outputs that would be helpful?

my current workaround to open the files is:
std::fstream fs("../../../../../../engine_test/images/test.png");

@iirina
Copy link
Contributor

iirina commented Dec 4, 2017

CC: @laszlocsomor Do you know why this doesn't work on Windows?

@iirina iirina added P2 We'll consider working on this in future. (Assignee optional) type: bug platform: windows category: rules > C++ labels Dec 4, 2017
@laszlocsomor
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) platform: windows type: bug
Projects
None yet
Development

No branches or pull requests

3 participants