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

Commits on Jun 22, 2022

  1. runfiles: port phst/runfiles to rules_go

    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 committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    c9320d0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9970126 View commit details
    Browse the repository at this point in the history