-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
cc_test doesn't appear to copy data files correctly on windows #8843
Comments
This should be better documented, sorry it isn't. (#6402) This behavior is normal on Windows: data-dependencies on Linux/macOS create a tree of symlinks, but not on Windows, only the MANIFEST file as you noticed. If you use Windows 10 version 1703 or newer, and enabled Developer Mode, then you can use the Otherwise you can use one of the runfiles-libraries built into Bazel. For C++ see instructions here: bazel/tools/cpp/runfiles/runfiles_src.h Line 15 in ece92fb
|
I recommend using the runfiles library even if you use |
The downside of using the runfiles library is that its init code is rigid: you have to use std::string and cannot use std::wstring (so you must convert argv[0] if you use |
Yea it also prevents gluing bazel on-top of existing tests. If you don't mind expanding, what is the limitation on windows? It seems like plenty of other bazel symlink style shenanigans work perfectly fine on it. |
The working symlinks are in fact junctions -- a symlink [1] that can only point to directories. [1] Technically not a symlink, but it behaves like one. See https://superuser.com/a/343079 |
So then will |
Maybe, see #8704. Do you know where mainstream windows 10 is? |
@laszlocsomor I'm not sure I understand the question. I mean Windows 1703 (decoded as March 2017, though it launched in April) was over 2 years ago, and with the auto update behavior of windows 10 I sincerely doubt anyone is that far behind without being on an older OS entirely. |
Sorry about the confusion. You wrote:
I thought you implied Creators Update wasn't mainstream yet. Did I misunderstand? |
Oh my fault I didn't actually parse the version number in my head when I asked. |
… create the runfiles directory. This breaks cc_tests that use data. See: bazelbuild/bazel#8843 PiperOrigin-RevId: 371805839
…hould fix the test targets that use resources. See: bazelbuild/bazel#8843 PiperOrigin-RevId: 371809343
…hould fix the test targets that use resources. See: bazelbuild/bazel#8843 PiperOrigin-RevId: 371809343
…hould fix the test targets that use resources. See: bazelbuild/bazel#8843 PiperOrigin-RevId: 371809343
…hould fix the test targets that use resources. See: bazelbuild/bazel#8843 PiperOrigin-RevId: 371809343
…hould fix the test targets that use resources. See: bazelbuild/bazel#8843 PiperOrigin-RevId: 371819537
Description of the problem / feature request:
On windows I can't seem to get the
cc_test
rule to copy data files that my tests depend on. The.runfiles
folder has a MANIFEST with the links listed and an empty folder named after my WORKSPACE.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
The repo I found the bug on https://github.com/mason-bially/PEGTL
Run
bazel test ...
all of thefile_*.cpp
tests will fail on windows but succeed on another platform (there are some other tests I haven't finished setting up, notablycontrib_json.cpp
which are expected to fail).What operating system are you running Bazel on?
Windows
What's the output of
bazel info release
?release 0.27.1
Have you found anything relevant by searching the web?
It maybe related to my earlier issue: #8820
This issue appears to have been open for a while #4102
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: