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

Test runfiles port (do not merge) #3209

Closed

Conversation

sluongng
Copy link
Contributor

A copy of #3205 for me to test against window CI while not sending notifications to other maintainers

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

(1): https://docs.google.com/document/d/e/2PACX-1vSDIrFnFvEYhKsCMdGdD40wZRBX3m3aZ5HhVj4CtHPmiXKDCxioTUbYsDydjKtFDAzER5eg7OjJWs3V/pub
(2): phst/runfiles#3 (comment)
@sluongng sluongng force-pushed the sluongng/runfile-port-test branch 21 times, most recently from 469c499 to 3de00a6 Compare June 22, 2022 13:46
@fmeum fmeum closed this Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants