rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Add a full `fs.FS` implementation to `runfiles`

Open fmeum opened this issue 1 year ago • 3 comments

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

fmeum avatar Jun 21 '24 15:06 fmeum

cc @sluongng

fmeum avatar Jun 24 '24 14:06 fmeum

Thanks, I addressed your comments and am debugging the remaining test failure on Windows.

fmeum avatar Jun 25 '24 08:06 fmeum

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.

fmeum avatar Jun 25 '24 08:06 fmeum

@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 avatar Jul 09 '24 12:07 fmeum

@fmeum Yes, please check https://github.com/bazelbuild/continuous-integration/issues/1981#issuecomment-2217609837

meteorcloudy avatar Jul 09 '24 12:07 meteorcloudy

@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 avatar Jul 10 '24 10:07 meteorcloudy

@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.

fmeum avatar Jul 10 '24 10:07 fmeum

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=true in /private/etc/bazel.bazelrc on the Mac VMs.
  • But it only affected the outer Bazel, inner Bazel running in the test has --nosystem_rc specified.
  • 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

meteorcloudy avatar Jul 10 '24 12:07 meteorcloudy