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

Runfile port windows #3253

Closed
wants to merge 3 commits into from
Closed

Conversation

fmeum
Copy link
Member

@fmeum fmeum commented Jul 27, 2022

Trying to fix the tests in #3205

sluongng and others added 2 commits October 13, 2022 10:46
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)
@fmeum fmeum force-pushed the runfile-port-windows branch 5 times, most recently from d94c068 to 19ee5fd Compare October 13, 2022 09:22
@fmeum fmeum force-pushed the runfile-port-windows branch from 19ee5fd to 9cd8f8c Compare October 13, 2022 09:29
@fmeum fmeum closed this Nov 6, 2022
@fmeum fmeum deleted the runfile-port-windows branch November 6, 2022 18:57
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