Add a full `fs.FS` implementation to `runfiles`
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Runfiles instances now implement fs.FS in a platform-agnostic way, regardless of whether they are manifest- or directory-based. This is meant to finally provide a full replacement for runfiles functionality offered by the legacy bazel package.
Which issues(s) does this PR fix?
Fixes #3375 Fixes #3830
Other notes for review
cc @sluongng
Thanks, I addressed your comments and am debugging the remaining test failure on Windows.
The remaining test failure is a very reasonable one: The logic fails to account for runfiles that are linked under a basename that differs from that of the underlying file. This will require some more tweaks.
@meteorcloudy The new macOS machines frequently run into timeouts: https://buildkite.com/bazel/rules-go-golang/builds/6622#01908e0d-57ff-4850-8b3c-cb9fe2fff52f
Are we perhaps lacking any settings?
@fmeum Yes, please check https://github.com/bazelbuild/continuous-integration/issues/1981#issuecomment-2217609837
@fmeum To unblock this, you can also temporarily switch back to the old Mac fleet by using macos_legacy or macos_arm64_legacy.
The timeout looks weird, does it look like some network issue? One major difference is that the new Mac fleet is ipv6 only, not sure if it's relevant.
@meteorcloudy Thanks, I'll go with this workaround for now until I can properly investigate this (limited to GitHub web UI right now).
The failing test downloads a few old Go releases from the official download page, I don't know why this would cause issues. The relevant tests are tagged local.
One major difference is that the new Mac fleet is ipv6 only, not sure if it's relevant.
Indeed it's caused by the ipv6-only network.
- We are setting
--host_jvm_args=-Djava.net.preferIPv6Addresses=truein/private/etc/bazel.bazelrcon the Mac VMs. - But it only affected the outer Bazel, inner Bazel running in the test has
--nosystem_rcspecified. - I can confirm after adding this flag in the go code, the three timeout tests are passing. Also on
macos_arm64.
I'll let you decide how to inject this for macos ci, here is an example for Bazel's integration test https://github.com/bazelbuild/bazel/commit/2c51a0c8590e73c88d6a678f1b0583c6aee313c3