-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
runfiles: port phst/runfiles to rules_go #3205
Conversation
Ah window 🙃 |
f4352e7
to
4a6e442
Compare
Tried some cheap trick but it does not seems to work. I will have to re-visit this later 🤔 |
Thanks for working on this, let me know if I can help. Just one comment for now: It would be great if we could make the runfiles library available at the canonical location as per https://docs.bazel.build/versions/main/skylark/deploying.html#runfiles-library, even if only via an alias. |
Yeah I think alias would be the way to do it. That might be 2-3 PR into the future though. As I noted in the description, I plan to visit how the current API work after this and refactor / deprecate things where possible. |
worth to note that I do not have a window machine available to dev... so it would take me a bit of time to iterate on this. I will create a draft PR to test it against window CI of this repo to avoid notifications to others🤔 |
4a6e442
to
0c822ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small updates:
After several iteration in #3209 I could not figure out how to make this windows compatible. I don't have a local window environment to work with. In addition to that, some of the window behaviors was not clearly defined in java/python runfiles and the related test suites, which I was using as references for this Go's implementation.
https://github.com/bazelbuild/bazel/blob/884156ffc35eccb9ab56c849817cbf045986c968/tools/java/runfiles/testing/RunfilesTest.java#L246-L263
I would appreciated if somebody could help me test and potentially fix to make this work on windows. 🙏
Here are the changes from my latest iterations:
-
Adjusted how 'canonical' path is evaluated. This could potentially deviate from the litterature in the GDoc proposal, but make things more consistent vs the native runfiles libs in @bazel_tools. Most notable change is that
..
and.
are accepted under current spec. -
Beefed up the test suite by including Bash's runfiles as the external data dependency. This should help highlighted how Windows's result could be quite inconsistent to work with.
-
Temporarily disabled TestFS on Window. Not yet sure what to do with
ExampleRunfiles
test. -
Replaced all usages of
path
APIs, which is unix specific, in favor ofpath/filepath
. -
Minor costmetic changes in hope that it helps improve readability
Thanks for digging into this! I should be able to take over and debug the Windows issues in the coming weeks. |
@fmeum Did you have a chance to review what is the expectations for runfiles lib on window? |
@sluongng Sorry for the long wait, Bzlmod ate up most of my "Bazel budget". Tests should be passing over at #3253 now. Feel free to take my two commits and squash them into yours. Having the runfiles library upstream will also make it easier to implement bazelbuild/bazel#16124 for Go, which I'm going to work on next. |
@sluongng If you are busy, would you be okay with me squashing my changes into your branch for this PR and merging? |
Yes please go ahead. I am a bit occupied for the next 2 months on non-bazel
stuffs 🙈
…On Tue, Nov 1, 2022, 9:55 AM Fabian Meumertzheim ***@***.***> wrote:
@sluongng <https://github.com/sluongng> If you are busy, would you be
okay with me squashing my changes into your branch for this PR and merging?
—
Reply to this email directly, view it on GitHub
<#3205 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGLSXGIM47JC5QSNXQUJDELWGDLJ3ANCNFSM5ZBRTYMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Today rules_go provide //go/tools/bazel as the canonical runfiles library for binaries to be executed with `bazel test` and `bazel run`. However, the current implementation pre-date the recent changes in Bazel's upstream. Since then, all of the native runfiles library of Bash, Java, CPP, Python have been refactored to follow a certain convention in locating files. (1) Although these are subjected to change with the incoming BzlMod feature, it would be easier to maintain if we can keep rules_go's runfiles library implementation aligned with native languages' implementation. Today, it seems like https://github.com/phst/runfiles implemented exactly that. So with @fmeum suggestion and @phst permission (2), let's port the newer, more accurate implementation to rules_go. Future refactoring will mark the current exported APIs in //go/tools/bazel as deprecated and/or swapping out the old implementation underneath to use this newer package. Changes in this PR included: - Copy paste repository over - Removal of .git and .gitignore and .githooks dir - Removal of repository specific files: README, WORKSPACE - Rename BUILD to BUILD.bazel - Rename import path for both go and BUILD files - Run gazelle over the packages - Adjusted test cases to reflect new package paths - Removed godoc related to installation instruction - Fixed test to handle window path separator - Updated canonical path criterias - Replaced usages of 'path' with 'path/filepath' Note that some issues with windows still remain unresolved. (1): https://docs.google.com/document/d/e/2PACX-1vSDIrFnFvEYhKsCMdGdD40wZRBX3m3aZ5HhVj4CtHPmiXKDCxioTUbYsDydjKtFDAzER5eg7OjJWs3V/pub (2): phst/runfiles#3 (comment)
0c822ef
to
3b1c1fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor suggestion. LGTM
go/tools/bazel/runfiles/runfiles.go
Outdated
// | ||
// See section “Library interface” in | ||
// https://docs.google.com/document/d/e/2PACX-1vSDIrFnFvEYhKsCMdGdD40wZRBX3m3aZ5HhVj4CtHPmiXKDCxioTUbYsDydjKtFDAzER5eg7OjJWs3V/pub. | ||
func (r *Runfiles) Path(s string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (r *Runfiles) Path(s string) (string, error) { | |
func (r *Runfiles) Path(relPath string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function allows absolute paths as well, so I am going to use path
instead and adding an example.
I also added a deprecation comment to the old runfiles function. It's package pro ides other functions for which we don't have full replacements yet, but that particular one can be fully replaced. |
Thanks again, @sluongng! |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.35.0` -> `v0.36.0` | --- ### Release Notes <details> <summary>bazelbuild/rules_go</summary> ### [`v0.36.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.36.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.35.0...v0.36.0) #### Major new features The Go runfiles library developed by [@​phst](https://togithub.com/phst) at https://github.com/phst/runfiles is now available as `github.com/bazelbuild/rules_go/go/runfiles` (target `@io_bazel_rules_go//go/runfiles`) and is now the official way to look up runfiles from Go. It will be made compatible with Bzlmod in a future release. **Note:** For improved consistency with runfiles libraries in other languages, the `Path` function present in https://github.com/phst/runfiles is called `Rlocation` in rules_go. #### What's Changed - bzlmod: Use register_toolchains by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3290](https://togithub.com/bazelbuild/rules_go/pull/3290) - Remove unused env_execute by [@​kmicklas](https://togithub.com/kmicklas) in [https://github.com/bazelbuild/rules_go/pull/3276](https://togithub.com/bazelbuild/rules_go/pull/3276) - Correctly forward InstrumentedFilesInfo from dependencies by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3294](https://togithub.com/bazelbuild/rules_go/pull/3294) - Parse Go SDK version out of `go version` instead of `VERSION` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3296](https://togithub.com/bazelbuild/rules_go/pull/3296) - also write test stderr to json (xml) output file by [@​rickystewart](https://togithub.com/rickystewart) in [https://github.com/bazelbuild/rules_go/pull/3300](https://togithub.com/bazelbuild/rules_go/pull/3300) - Bzlmod: Pin Bazel version in CI by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3301](https://togithub.com/bazelbuild/rules_go/pull/3301) - Allow to select Go SDK version from declared SDKs by [@​ash2k](https://togithub.com/ash2k) in [https://github.com/bazelbuild/rules_go/pull/3303](https://togithub.com/bazelbuild/rules_go/pull/3303) - Use top level VERSION file when it exists by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3309](https://togithub.com/bazelbuild/rules_go/pull/3309) - synchronize when writing to the JSON converter by [@​rickystewart](https://togithub.com/rickystewart) in [https://github.com/bazelbuild/rules_go/pull/3311](https://togithub.com/bazelbuild/rules_go/pull/3311) - update version manifest URL by [@​benjaminp](https://togithub.com/benjaminp) in [https://github.com/bazelbuild/rules_go/pull/3314](https://togithub.com/bazelbuild/rules_go/pull/3314) - Symlink "misc" into repository for local_sdk. by [@​adam-azarchs](https://togithub.com/adam-azarchs) in [https://github.com/bazelbuild/rules_go/pull/3313](https://togithub.com/bazelbuild/rules_go/pull/3313) - Ensure compatibility with incompatible flags close to flipping by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3319](https://togithub.com/bazelbuild/rules_go/pull/3319) - Add additional bzlmod requirements to allow grpc protobufs to work by [@​shs96c](https://togithub.com/shs96c) in [https://github.com/bazelbuild/rules_go/pull/3320](https://togithub.com/bazelbuild/rules_go/pull/3320) - bzlmod: Update pinned Bazel version by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3321](https://togithub.com/bazelbuild/rules_go/pull/3321) - bzlmod: Set up automated BCR releases by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3324](https://togithub.com/bazelbuild/rules_go/pull/3324) - bzlmod: Add support for gogo proto compiler by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3323](https://togithub.com/bazelbuild/rules_go/pull/3323) - gopackagesdriver: move non-Go files to OtherFiles (Fixes [#​3326](https://togithub.com/bazelbuild/rules_go/issues/3326)) by [@​michaelarusso](https://togithub.com/michaelarusso) in [https://github.com/bazelbuild/rules_go/pull/3327](https://togithub.com/bazelbuild/rules_go/pull/3327) - bzlmod: Allow yanked versions in CI by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3329](https://togithub.com/bazelbuild/rules_go/pull/3329) - feat(pkg-drv): allow setting custom aspect and kinds by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3328](https://togithub.com/bazelbuild/rules_go/pull/3328) - fix(packages-driver): allow defining additional aspects instead by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3330](https://togithub.com/bazelbuild/rules_go/pull/3330) - Add support for parsing Go development versions by [@​zakcutner](https://togithub.com/zakcutner) in [https://github.com/bazelbuild/rules_go/pull/3333](https://togithub.com/bazelbuild/rules_go/pull/3333) - Match GOARCH ppc64 to @​platforms//cpu:ppc as well. by [@​mahiuchun](https://togithub.com/mahiuchun) in [https://github.com/bazelbuild/rules_go/pull/3336](https://togithub.com/bazelbuild/rules_go/pull/3336) - bzlmod: Update Publish to BCR app config by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3337](https://togithub.com/bazelbuild/rules_go/pull/3337) - gopackagesdriver: default to NotHandled:true for package queries by [@​ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) in [https://github.com/bazelbuild/rules_go/pull/3338](https://togithub.com/bazelbuild/rules_go/pull/3338) - fix(packagesdrv): resolve third party go packages by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3332](https://togithub.com/bazelbuild/rules_go/pull/3332) - runfiles: port phst/runfiles to rules_go by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3205](https://togithub.com/bazelbuild/rules_go/pull/3205) - Adding gc_linopts to command line flag by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3342](https://togithub.com/bazelbuild/rules_go/pull/3342) - Move new runfiles library to `//go/runfiles` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3341](https://togithub.com/bazelbuild/rules_go/pull/3341) - Rename `Path` to `Rlocation` in runfiles library by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3346](https://togithub.com/bazelbuild/rules_go/pull/3346) - Add 'gc_goopts' flag to command line to allow gc_goopts to propagate by [@​LWarrens](https://togithub.com/LWarrens) in [https://github.com/bazelbuild/rules_go/pull/3340](https://togithub.com/bazelbuild/rules_go/pull/3340) #### New Contributors - [@​kmicklas](https://togithub.com/kmicklas) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3276](https://togithub.com/bazelbuild/rules_go/pull/3276) - [@​adam-azarchs](https://togithub.com/adam-azarchs) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3313](https://togithub.com/bazelbuild/rules_go/pull/3313) - [@​shs96c](https://togithub.com/shs96c) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3320](https://togithub.com/bazelbuild/rules_go/pull/3320) - [@​michaelarusso](https://togithub.com/michaelarusso) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3327](https://togithub.com/bazelbuild/rules_go/pull/3327) - [@​zakcutner](https://togithub.com/zakcutner) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3333](https://togithub.com/bazelbuild/rules_go/pull/3333) - [@​mahiuchun](https://togithub.com/mahiuchun) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3336](https://togithub.com/bazelbuild/rules_go/pull/3336) - [@​LWarrens](https://togithub.com/LWarrens) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3340](https://togithub.com/bazelbuild/rules_go/pull/3340) **Full Changelog**: bazel-contrib/rules_go@v0.35.0...v0.36.0 #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "ae013bf35bd23234d1dea46b079f1e05ba74ac0321423830119d3e787ec73483", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.19.3") </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/cgrindel/swift_bazel). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4zMC40IiwidXBkYXRlZEluVmVyIjoiMzQuMzAuNCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.35.0` -> `v0.36.0` | --- ### Release Notes <details> <summary>bazelbuild/rules_go</summary> ### [`v0.36.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.36.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.35.0...v0.36.0) #### Major new features The Go runfiles library developed by [@​phst](https://togithub.com/phst) at https://github.com/phst/runfiles is now available as `github.com/bazelbuild/rules_go/go/runfiles` (target `@io_bazel_rules_go//go/runfiles`) and is now the official way to look up runfiles from Go. It will be made compatible with Bzlmod in a future release. **Note:** For improved consistency with runfiles libraries in other languages, the `Path` function present in https://github.com/phst/runfiles is called `Rlocation` in rules_go. #### What's Changed - bzlmod: Use register_toolchains by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3290](https://togithub.com/bazelbuild/rules_go/pull/3290) - Remove unused env_execute by [@​kmicklas](https://togithub.com/kmicklas) in [https://github.com/bazelbuild/rules_go/pull/3276](https://togithub.com/bazelbuild/rules_go/pull/3276) - Correctly forward InstrumentedFilesInfo from dependencies by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3294](https://togithub.com/bazelbuild/rules_go/pull/3294) - Parse Go SDK version out of `go version` instead of `VERSION` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3296](https://togithub.com/bazelbuild/rules_go/pull/3296) - also write test stderr to json (xml) output file by [@​rickystewart](https://togithub.com/rickystewart) in [https://github.com/bazelbuild/rules_go/pull/3300](https://togithub.com/bazelbuild/rules_go/pull/3300) - Bzlmod: Pin Bazel version in CI by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3301](https://togithub.com/bazelbuild/rules_go/pull/3301) - Allow to select Go SDK version from declared SDKs by [@​ash2k](https://togithub.com/ash2k) in [https://github.com/bazelbuild/rules_go/pull/3303](https://togithub.com/bazelbuild/rules_go/pull/3303) - Use top level VERSION file when it exists by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3309](https://togithub.com/bazelbuild/rules_go/pull/3309) - synchronize when writing to the JSON converter by [@​rickystewart](https://togithub.com/rickystewart) in [https://github.com/bazelbuild/rules_go/pull/3311](https://togithub.com/bazelbuild/rules_go/pull/3311) - update version manifest URL by [@​benjaminp](https://togithub.com/benjaminp) in [https://github.com/bazelbuild/rules_go/pull/3314](https://togithub.com/bazelbuild/rules_go/pull/3314) - Symlink "misc" into repository for local_sdk. by [@​adam-azarchs](https://togithub.com/adam-azarchs) in [https://github.com/bazelbuild/rules_go/pull/3313](https://togithub.com/bazelbuild/rules_go/pull/3313) - Ensure compatibility with incompatible flags close to flipping by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3319](https://togithub.com/bazelbuild/rules_go/pull/3319) - Add additional bzlmod requirements to allow grpc protobufs to work by [@​shs96c](https://togithub.com/shs96c) in [https://github.com/bazelbuild/rules_go/pull/3320](https://togithub.com/bazelbuild/rules_go/pull/3320) - bzlmod: Update pinned Bazel version by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3321](https://togithub.com/bazelbuild/rules_go/pull/3321) - bzlmod: Set up automated BCR releases by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3324](https://togithub.com/bazelbuild/rules_go/pull/3324) - bzlmod: Add support for gogo proto compiler by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3323](https://togithub.com/bazelbuild/rules_go/pull/3323) - gopackagesdriver: move non-Go files to OtherFiles (Fixes [#​3326](https://togithub.com/bazelbuild/rules_go/issues/3326)) by [@​michaelarusso](https://togithub.com/michaelarusso) in [https://github.com/bazelbuild/rules_go/pull/3327](https://togithub.com/bazelbuild/rules_go/pull/3327) - bzlmod: Allow yanked versions in CI by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3329](https://togithub.com/bazelbuild/rules_go/pull/3329) - feat(pkg-drv): allow setting custom aspect and kinds by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3328](https://togithub.com/bazelbuild/rules_go/pull/3328) - fix(packages-driver): allow defining additional aspects instead by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3330](https://togithub.com/bazelbuild/rules_go/pull/3330) - Add support for parsing Go development versions by [@​zakcutner](https://togithub.com/zakcutner) in [https://github.com/bazelbuild/rules_go/pull/3333](https://togithub.com/bazelbuild/rules_go/pull/3333) - Match GOARCH ppc64 to @​platforms//cpu:ppc as well. by [@​mahiuchun](https://togithub.com/mahiuchun) in [https://github.com/bazelbuild/rules_go/pull/3336](https://togithub.com/bazelbuild/rules_go/pull/3336) - bzlmod: Update Publish to BCR app config by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3337](https://togithub.com/bazelbuild/rules_go/pull/3337) - gopackagesdriver: default to NotHandled:true for package queries by [@​ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) in [https://github.com/bazelbuild/rules_go/pull/3338](https://togithub.com/bazelbuild/rules_go/pull/3338) - fix(packagesdrv): resolve third party go packages by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3332](https://togithub.com/bazelbuild/rules_go/pull/3332) - runfiles: port phst/runfiles to rules_go by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3205](https://togithub.com/bazelbuild/rules_go/pull/3205) - Adding gc_linopts to command line flag by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3342](https://togithub.com/bazelbuild/rules_go/pull/3342) - Move new runfiles library to `//go/runfiles` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3341](https://togithub.com/bazelbuild/rules_go/pull/3341) - Rename `Path` to `Rlocation` in runfiles library by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3346](https://togithub.com/bazelbuild/rules_go/pull/3346) - Add 'gc_goopts' flag to command line to allow gc_goopts to propagate by [@​LWarrens](https://togithub.com/LWarrens) in [https://github.com/bazelbuild/rules_go/pull/3340](https://togithub.com/bazelbuild/rules_go/pull/3340) #### New Contributors - [@​kmicklas](https://togithub.com/kmicklas) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3276](https://togithub.com/bazelbuild/rules_go/pull/3276) - [@​adam-azarchs](https://togithub.com/adam-azarchs) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3313](https://togithub.com/bazelbuild/rules_go/pull/3313) - [@​shs96c](https://togithub.com/shs96c) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3320](https://togithub.com/bazelbuild/rules_go/pull/3320) - [@​michaelarusso](https://togithub.com/michaelarusso) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3327](https://togithub.com/bazelbuild/rules_go/pull/3327) - [@​zakcutner](https://togithub.com/zakcutner) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3333](https://togithub.com/bazelbuild/rules_go/pull/3333) - [@​mahiuchun](https://togithub.com/mahiuchun) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3336](https://togithub.com/bazelbuild/rules_go/pull/3336) - [@​LWarrens](https://togithub.com/LWarrens) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3340](https://togithub.com/bazelbuild/rules_go/pull/3340) **Full Changelog**: bazel-contrib/rules_go@v0.35.0...v0.36.0 #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "ae013bf35bd23234d1dea46b079f1e05ba74ac0321423830119d3e787ec73483", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.19.3") </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/cgrindel/bazel-starlib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4zMC40IiwidXBkYXRlZEluVmVyIjoiMzQuMzAuNCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.35.0` -> `v0.38.1` | --- ### Release Notes <details> <summary>bazelbuild/rules_go</summary> ### [`v0.38.1`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.38.1) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.38.0...v0.38.1) #### Bug fixes The go_googleapis upgrade in 0.38.0 is too disruptive. It changes the Go import paths of the proto packages, causing build failures in repos trying to upgrade to rules_go 0.38.0. Reverting the go_googleapis to the master of 2022-12-05 ([#​3432](https://togithub.com/bazelbuild/rules_go/issues/3432)) for now to make rules_go upgrades easier. #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.19.5") **Full Changelog**: bazel-contrib/rules_go@v0.38.0...v0.38.1 ### [`v0.38.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.38.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.37.0...v0.38.0) #### Breaking changes Starting this release, rules_go requires Bazel 5.3 and golang/x/tools at least 0.3.0. If you are using [stardoc](https://togithub.com/bazelbuild/stardoc), you also need to upgrade it to 0.5.3 to recognize `RunEnvironmentInfo`, which is used in this release. #### Major new features This is the first release to support Go 1.20. When on this version of Go, it is highly recommended to use Bazel 6 and set `--experimental_output_directory_naming_scheme=diff_against_baseline` to prevent certain unnecessary rebuilds. #### What's Changed - preserve intermediate files if `-work` is specified by [@​motiejus](https://togithub.com/motiejus) in [https://github.com/bazelbuild/rules_go/pull/3389](https://togithub.com/bazelbuild/rules_go/pull/3389) - Adapt `lcov_coverage_test` to `exec.Command` change by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3392](https://togithub.com/bazelbuild/rules_go/pull/3392) - explicitly build relative path for Tool command in lcov_coverage_test by [@​matloob](https://togithub.com/matloob) in [https://github.com/bazelbuild/rules_go/pull/3399](https://togithub.com/bazelbuild/rules_go/pull/3399) - Add support for building with boringcrypto by [@​matloob](https://togithub.com/matloob) in [https://github.com/bazelbuild/rules_go/pull/3398](https://togithub.com/bazelbuild/rules_go/pull/3398) - Generalize `boringcrypto` to `GOEXPERIMENT` support by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3401](https://togithub.com/bazelbuild/rules_go/pull/3401) - Replace `cfg = "host"` with `cfg = "exec"` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3404](https://togithub.com/bazelbuild/rules_go/pull/3404) - always produce .a files at the beginning of a build by [@​matloob](https://togithub.com/matloob) in [https://github.com/bazelbuild/rules_go/pull/3385](https://togithub.com/bazelbuild/rules_go/pull/3385) - Mark `nogo` targets as `manual` to keep top-level symlinks by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3410](https://togithub.com/bazelbuild/rules_go/pull/3410) - Refactoring the extld related logic by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3400](https://togithub.com/bazelbuild/rules_go/pull/3400) - Fix incompatible flags not applied to integration tests by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3415](https://togithub.com/bazelbuild/rules_go/pull/3415) - chore: remove experimental warning from bzlmod module by [@​alexeagle](https://togithub.com/alexeagle) in [https://github.com/bazelbuild/rules_go/pull/3418](https://togithub.com/bazelbuild/rules_go/pull/3418) - Add a clarifying error about dependency cycle found for internal tests by [@​yushan26](https://togithub.com/yushan26) in [https://github.com/bazelbuild/rules_go/pull/3422](https://togithub.com/bazelbuild/rules_go/pull/3422) - Do not use exec paths for rundir by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3414](https://togithub.com/bazelbuild/rules_go/pull/3414) - Upgrade org_golang_x_tools to 0.5.0 by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3356](https://togithub.com/bazelbuild/rules_go/pull/3356) - fix: Relative path of embedsrc by [@​bakjos](https://togithub.com/bakjos) in [https://github.com/bazelbuild/rules_go/pull/3407](https://togithub.com/bazelbuild/rules_go/pull/3407) - Add support for env_inherit by [@​ttpathan](https://togithub.com/ttpathan) in [https://github.com/bazelbuild/rules_go/pull/3256](https://togithub.com/bazelbuild/rules_go/pull/3256) - Update stardoc to 0.5.3 by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3427](https://togithub.com/bazelbuild/rules_go/pull/3427) - Add `env` attribute to `go_binary` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3428](https://togithub.com/bazelbuild/rules_go/pull/3428) #### New Contributors - [@​matloob](https://togithub.com/matloob) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3399](https://togithub.com/bazelbuild/rules_go/pull/3399) - [@​yushan26](https://togithub.com/yushan26) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3422](https://togithub.com/bazelbuild/rules_go/pull/3422) - [@​bakjos](https://togithub.com/bakjos) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3407](https://togithub.com/bazelbuild/rules_go/pull/3407) - [@​ttpathan](https://togithub.com/ttpathan) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3256](https://togithub.com/bazelbuild/rules_go/pull/3256) **Full Changelog**: bazel-contrib/rules_go@v0.37.0...v0.38.0 ### [`v0.37.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.37.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.36.0...v0.37.0) #### Major New Features - Support fetching packages for generated code in the Go Packages Driver #### What's Changed - bzlmod: Add missing `strip_prefix` field to `source.template.json` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3359](https://togithub.com/bazelbuild/rules_go/pull/3359) - Declare toolchains in a separate repository by [@​jfirebaugh](https://togithub.com/jfirebaugh) in [https://github.com/bazelbuild/rules_go/pull/3348](https://togithub.com/bazelbuild/rules_go/pull/3348) - Delete legacy actions API by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3173](https://togithub.com/bazelbuild/rules_go/pull/3173) - go_path: support go:embed of generated files by [@​S-Chan](https://togithub.com/S-Chan) in [https://github.com/bazelbuild/rules_go/pull/3285](https://togithub.com/bazelbuild/rules_go/pull/3285) - Properly deprecate `bindata`, `go_embed_data`, and `go_embed_data_deps` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3362](https://togithub.com/bazelbuild/rules_go/pull/3362) - link.bzl: ignore duplicate dep on coverdata by [@​robfig](https://togithub.com/robfig) in [https://github.com/bazelbuild/rules_go/pull/3032](https://togithub.com/bazelbuild/rules_go/pull/3032) - feat(pkg-drv): add support for generated files by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3354](https://togithub.com/bazelbuild/rules_go/pull/3354) - Remove unused variables in link action by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3367](https://togithub.com/bazelbuild/rules_go/pull/3367) - Reduce number of declared files in `emit_stdlib` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3366](https://togithub.com/bazelbuild/rules_go/pull/3366) - Update docs regarding vendored proto files by [@​garymm](https://togithub.com/garymm) in [https://github.com/bazelbuild/rules_go/pull/3360](https://togithub.com/bazelbuild/rules_go/pull/3360) - go link: use external linker when in race mode by [@​motiejus](https://togithub.com/motiejus) in [https://github.com/bazelbuild/rules_go/pull/3370](https://togithub.com/bazelbuild/rules_go/pull/3370) - Adding first example by [@​chrislovecnm](https://togithub.com/chrislovecnm) in [https://github.com/bazelbuild/rules_go/pull/3317](https://togithub.com/bazelbuild/rules_go/pull/3317) - fix(packagesdriver): bazelFlags should prefix the command by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3371](https://togithub.com/bazelbuild/rules_go/pull/3371) - chore(gpd): export aspect utils for reusability by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3373](https://togithub.com/bazelbuild/rules_go/pull/3373) - nogo: Add a \_base key to be a default config for all Analyzers. by [@​DolceTriade](https://togithub.com/DolceTriade) in [https://github.com/bazelbuild/rules_go/pull/3351](https://togithub.com/bazelbuild/rules_go/pull/3351) - Document that `Rlocation` can return relative paths by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3377](https://togithub.com/bazelbuild/rules_go/pull/3377) - Fix normalization check for `Rlocation` path by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3378](https://togithub.com/bazelbuild/rules_go/pull/3378) - fix(gpd): Write large target patterns to file by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3372](https://togithub.com/bazelbuild/rules_go/pull/3372) - Make Go runfiles library repo mapping aware by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3347](https://togithub.com/bazelbuild/rules_go/pull/3347) #### New Contributors - [@​jfirebaugh](https://togithub.com/jfirebaugh) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3348](https://togithub.com/bazelbuild/rules_go/pull/3348) - [@​S-Chan](https://togithub.com/S-Chan) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3285](https://togithub.com/bazelbuild/rules_go/pull/3285) - [@​garymm](https://togithub.com/garymm) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3360](https://togithub.com/bazelbuild/rules_go/pull/3360) - [@​motiejus](https://togithub.com/motiejus) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3370](https://togithub.com/bazelbuild/rules_go/pull/3370) - [@​chrislovecnm](https://togithub.com/chrislovecnm) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3317](https://togithub.com/bazelbuild/rules_go/pull/3317) - [@​DolceTriade](https://togithub.com/DolceTriade) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3351](https://togithub.com/bazelbuild/rules_go/pull/3351) **Full Changelog**: bazel-contrib/rules_go@v0.36.0...v0.37.0 #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "56d8c5a5c91e1af73eca71a6fab2ced959b67c86d12ba37feedb0a2dfea441a6", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.37.0/rules_go-v0.37.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.37.0/rules_go-v0.37.0.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.19.3") ### [`v0.36.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.36.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.35.0...v0.36.0) #### Major new features - The Go runfiles library developed by [@​phst](https://togithub.com/phst) at https://github.com/phst/runfiles is now available as `github.com/bazelbuild/rules_go/go/runfiles` (target `@io_bazel_rules_go//go/runfiles`) and is now the official way to look up runfiles from Go. It will be made compatible with Bzlmod in a future release. **Note:** For improved consistency with runfiles libraries in other languages, the `Path` function present in https://github.com/phst/runfiles is called `Rlocation` in rules_go. - Adding two new command line flags `--@​io_bazel_rules_go//go/config:gc_goopts` and `--@​io_bazel_rules_go//go/config:gc_linkopts` to accept additional compiler and linker flags. #### What's Changed - bzlmod: Use register_toolchains by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3290](https://togithub.com/bazelbuild/rules_go/pull/3290) - Remove unused env_execute by [@​kmicklas](https://togithub.com/kmicklas) in [https://github.com/bazelbuild/rules_go/pull/3276](https://togithub.com/bazelbuild/rules_go/pull/3276) - Correctly forward InstrumentedFilesInfo from dependencies by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3294](https://togithub.com/bazelbuild/rules_go/pull/3294) - Parse Go SDK version out of `go version` instead of `VERSION` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3296](https://togithub.com/bazelbuild/rules_go/pull/3296) - also write test stderr to json (xml) output file by [@​rickystewart](https://togithub.com/rickystewart) in [https://github.com/bazelbuild/rules_go/pull/3300](https://togithub.com/bazelbuild/rules_go/pull/3300) - Bzlmod: Pin Bazel version in CI by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3301](https://togithub.com/bazelbuild/rules_go/pull/3301) - Allow to select Go SDK version from declared SDKs by [@​ash2k](https://togithub.com/ash2k) in [https://github.com/bazelbuild/rules_go/pull/3303](https://togithub.com/bazelbuild/rules_go/pull/3303) - Use top level VERSION file when it exists by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3309](https://togithub.com/bazelbuild/rules_go/pull/3309) - synchronize when writing to the JSON converter by [@​rickystewart](https://togithub.com/rickystewart) in [https://github.com/bazelbuild/rules_go/pull/3311](https://togithub.com/bazelbuild/rules_go/pull/3311) - update version manifest URL by [@​benjaminp](https://togithub.com/benjaminp) in [https://github.com/bazelbuild/rules_go/pull/3314](https://togithub.com/bazelbuild/rules_go/pull/3314) - Symlink "misc" into repository for local_sdk. by [@​adam-azarchs](https://togithub.com/adam-azarchs) in [https://github.com/bazelbuild/rules_go/pull/3313](https://togithub.com/bazelbuild/rules_go/pull/3313) - Ensure compatibility with incompatible flags close to flipping by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3319](https://togithub.com/bazelbuild/rules_go/pull/3319) - Add additional bzlmod requirements to allow grpc protobufs to work by [@​shs96c](https://togithub.com/shs96c) in [https://github.com/bazelbuild/rules_go/pull/3320](https://togithub.com/bazelbuild/rules_go/pull/3320) - bzlmod: Update pinned Bazel version by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3321](https://togithub.com/bazelbuild/rules_go/pull/3321) - bzlmod: Set up automated BCR releases by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3324](https://togithub.com/bazelbuild/rules_go/pull/3324) - bzlmod: Add support for gogo proto compiler by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3323](https://togithub.com/bazelbuild/rules_go/pull/3323) - gopackagesdriver: move non-Go files to OtherFiles (Fixes [#​3326](https://togithub.com/bazelbuild/rules_go/issues/3326)) by [@​michaelarusso](https://togithub.com/michaelarusso) in [https://github.com/bazelbuild/rules_go/pull/3327](https://togithub.com/bazelbuild/rules_go/pull/3327) - bzlmod: Allow yanked versions in CI by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3329](https://togithub.com/bazelbuild/rules_go/pull/3329) - feat(pkg-drv): allow setting custom aspect and kinds by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3328](https://togithub.com/bazelbuild/rules_go/pull/3328) - fix(packages-driver): allow defining additional aspects instead by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3330](https://togithub.com/bazelbuild/rules_go/pull/3330) - Add support for parsing Go development versions by [@​zakcutner](https://togithub.com/zakcutner) in [https://github.com/bazelbuild/rules_go/pull/3333](https://togithub.com/bazelbuild/rules_go/pull/3333) - Match GOARCH ppc64 to @​platforms//cpu:ppc as well. by [@​mahiuchun](https://togithub.com/mahiuchun) in [https://github.com/bazelbuild/rules_go/pull/3336](https://togithub.com/bazelbuild/rules_go/pull/3336) - bzlmod: Update Publish to BCR app config by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3337](https://togithub.com/bazelbuild/rules_go/pull/3337) - gopackagesdriver: default to NotHandled:true for package queries by [@​ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) in [https://github.com/bazelbuild/rules_go/pull/3338](https://togithub.com/bazelbuild/rules_go/pull/3338) - fix(packagesdrv): resolve third party go packages by [@​JamyDev](https://togithub.com/JamyDev) in [https://github.com/bazelbuild/rules_go/pull/3332](https://togithub.com/bazelbuild/rules_go/pull/3332) - runfiles: port phst/runfiles to rules_go by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3205](https://togithub.com/bazelbuild/rules_go/pull/3205) - Adding gc_linopts to command line flag by [@​linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3342](https://togithub.com/bazelbuild/rules_go/pull/3342) - Move new runfiles library to `//go/runfiles` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3341](https://togithub.com/bazelbuild/rules_go/pull/3341) - Rename `Path` to `Rlocation` in runfiles library by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3346](https://togithub.com/bazelbuild/rules_go/pull/3346) - Add 'gc_goopts' flag to command line to allow gc_goopts to propagate by [@​LWarrens](https://togithub.com/LWarrens) in [https://github.com/bazelbuild/rules_go/pull/3340](https://togithub.com/bazelbuild/rules_go/pull/3340) #### New Contributors - [@​kmicklas](https://togithub.com/kmicklas) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3276](https://togithub.com/bazelbuild/rules_go/pull/3276) - [@​adam-azarchs](https://togithub.com/adam-azarchs) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3313](https://togithub.com/bazelbuild/rules_go/pull/3313) - [@​shs96c](https://togithub.com/shs96c) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3320](https://togithub.com/bazelbuild/rules_go/pull/3320) - [@​michaelarusso](https://togithub.com/michaelarusso) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3327](https://togithub.com/bazelbuild/rules_go/pull/3327) - [@​zakcutner](https://togithub.com/zakcutner) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3333](https://togithub.com/bazelbuild/rules_go/pull/3333) - [@​mahiuchun](https://togithub.com/mahiuchun) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3336](https://togithub.com/bazelbuild/rules_go/pull/3336) - [@​LWarrens](https://togithub.com/LWarrens) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3340](https://togithub.com/bazelbuild/rules_go/pull/3340) **Full Changelog**: bazel-contrib/rules_go@v0.35.0...v0.36.0 #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "ae013bf35bd23234d1dea46b079f1e05ba74ac0321423830119d3e787ec73483", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.19.3") </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/kreempuff/rules_unreal_engine). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTcuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExNy4xIn0=-->
Today rules_go provide //go/tools/bazel as the canonical runfiles
library for binaries to be executed with
bazel test
andbazel run
.However, the current implementation pre-date the recent changes in
Bazel's upstream. Since then, all of the native runfiles library of
Bash, Java, CPP, Python have been refactored to follow a certain
convention in locating files. (1)
Although these are subjected to change with the incoming BzlMod feature,
it would be easier to maintain if we can keep rules_go's runfiles
library implementation aligned with native languages' implementation.
Today, it seems like https://github.com/phst/runfiles implemented
exactly that. So with @fmeum suggestion and @phst permission (2), let's
port the newer, more accurate implementation to rules_go.
Future refactoring will mark the current exported APIs in
//go/tools/bazel as deprecated and/or swapping out the old implementation
underneath to use this newer package.
Changes in this PR included:
(1): https://docs.google.com/document/d/e/2PACX-1vSDIrFnFvEYhKsCMdGdD40wZRBX3m3aZ5HhVj4CtHPmiXKDCxioTUbYsDydjKtFDAzER5eg7OjJWs3V/pub
(2): phst/runfiles#3 (comment)
Close #3036
Close #2359
Close #2422
Close #2423