Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazel-contrib/rules_go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.54.1
Choose a base ref
...
head repository: bazel-contrib/rules_go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.55.0
Choose a head ref
  • 20 commits
  • 73 files changed
  • 13 contributors

Commits on Apr 19, 2025

  1. Checking test suite duration (#4323)

    **What type of PR is this?**
    Bug fix
    
    **What does this PR do? Why is it needed?**
    A test case/suite's duration can be nil in the test JSON. We should
    check it before dereference it.
    
    **Which issues(s) does this PR fix?**
    
    Fixes #4318
    
    **Other notes for review**
    linzhp authored Apr 19, 2025
    Configuration menu
    Copy the full SHA
    a67f6c1 View commit details
    Browse the repository at this point in the history
  2. Revert "Fail when expected files are not produced by protoc (#4287)" (#…

    …4324)
    
    **What type of PR is this?**
    Bug fix
    
    
    **What does this PR do? Why is it needed?**
    It's common for a `go_proto_library` to include proto files with and
    without service definitions at the same time. In this case, the gRPC
    plugins are needed, but some gRPC plugins don't generate the grpc.pb.go
    files if there is no service definition.
    
    Partially reverting #4287 to restore the previous behavior of creating
    an empty file
    
    **Which issues(s) does this PR fix?**
    
    Fixes #4317
    
    **Other notes for review**
    
    ---------
    
    Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
    linzhp and fmeum authored Apr 19, 2025
    Configuration menu
    Copy the full SHA
    66cd5f5 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2025

  1. Add imacros to absolutized cgo env list (#4325)

    **What type of PR is this?**
    > Bug fix
    
    **What does this PR do? Why is it needed?**
    This adds the -imacros flag to the set of cgo compiler flags that are
    transformed to absolute paths. Currently relative path values for
    -imacros will fail.
    
    **Which issues(s) does this PR fix?**
    No existing issue, just seems to be a missed flag.
    
    **Other notes for review**
    I have been able to successfully test this locally using my existing cc
    toolchain.
    LaurenceTews authored Apr 22, 2025
    Configuration menu
    Copy the full SHA
    38244a1 View commit details
    Browse the repository at this point in the history
  2. go_cross: allow transition on compilation_mode (#4320)

    <!-- Thanks for sending a PR! Before submitting:
    
    1. If this is your first PR, please read CONTRIBUTING.md and sign the
    CLA
       first. We cannot review code without a signed CLA.
    2. Please file an issue *first*. All features and most bug fixes should
    have
    an associated issue with a design discussed and decided upon. Small bug
       fixes and documentation improvements don't need issues.
    3. New features and bug fixes must have tests. Documentation may need to
    be updated. If you're unsure what to update, send the PR, and we'll
    discuss
       in review.
    4. Note that PRs updating dependencies and new Go versions are not
    accepted.
       Please file an issue instead.
    -->
    
    **What type of PR is this?**
    
    Feature
    
    **What does this PR do? Why is it needed?**
    
    Let user change the compilation mode with go_cross_binary.
    This is useful to force a opt mode for a deployment or packaging
    purposes.
    
    **Which issues(s) does this PR fix?**
    
    **Other notes for review**
    sluongng authored Apr 22, 2025
    Configuration menu
    Copy the full SHA
    185ecb7 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2025

  1. Pass config to subanalyzers (#4330)

    **What type of PR is this?**
    
    Bug fix
    
    **What does this PR do? Why is it needed?**
    
    Some analyzers require their subanalyzers to be configured. For instance
    nilaway has dedicated nilaway_config subanalyzer.
    
    **Which issues(s) does this PR fix?**
    
    Fixes #4329 
    
    **Other notes for review**
    
    ---------
    
    Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
    grzegorzsn and fmeum authored Apr 26, 2025
    Configuration menu
    Copy the full SHA
    b403a37 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2025

  1. Update BCR presumit matrix (#4331)

    **What type of PR is this?**
    Other
    
    **What does this PR do? Why is it needed?**
    * Adding coverage on Linux arm64 and Bazel 8
    * Upgrading Debian version
    * Dropping coverage on macOS amd64. Those machines are very old now.
    
    **Other notes for review**
    linzhp authored Apr 27, 2025
    Configuration menu
    Copy the full SHA
    1dd62f4 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2025

  1. Configuration menu
    Copy the full SHA
    f0d3aa7 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2025

  1. Export new location of support files needed for using Go's WASM outpu…

    …t. (#4322)
    
    **What type of PR is this?**
    
    
    Bug fix
    
    **What does this PR do? Why is it needed?**
    
    In order to run code with GOOS=js GOARCH=wasm in the browser, you need
    to copy a `.js` file from the toolchain.
    This file location was changed in Go 1.24, which is now also exported in
    this PR.
    
    **Which issues(s) does this PR fix?**
    
    n/a
    
    **Other notes for review**
    
    See also this info from the Go wiki:
    
    > For Go 1.23 and earlier, the wasm support files needed in this article
    are located in misc/wasm, and the path should be replaced when
    performing operations with files such as lib/wasm/wasm_exec.js.
    
    [source](https://go.dev/wiki/WebAssembly)
    malt3 authored May 2, 2025
    Configuration menu
    Copy the full SHA
    187ba67 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2025

  1. Fix incompatibility with --incompatible_auto_exec_groups (#4141)

    **What type of PR is this?**
    
    Incompatible change
    
    **What does this PR do? Why is it needed?**
    
    This requires setting the `toolchain` on actions and updating protobuf.
    
    **Which issues(s) does this PR fix?**
    
    Fix #4139
    
    **Other notes for review**
    fmeum authored May 6, 2025
    Configuration menu
    Copy the full SHA
    b17435b View commit details
    Browse the repository at this point in the history

Commits on May 7, 2025

  1. Re-spawned test binary should not break PWD (#4336)

    **What type of PR is this?**
    
    Bug fix
    
    **What does this PR do? Why is it needed?**
    
    This PR adds a test to reproduce the issue described in #4335,
    and proposes one possible fix for it:
    leveraging an environment variable to help the subprocess determine
    whether it was invoked by Bazel or directly.
    
    The test fails without the proposed fix,
    but it succeeds fine with `go test`.
    
    **Which issues(s) does this PR fix?**
    
    Fixes #4335
    
    **Other notes for review**
    
    The proposed fix is one possible way of doing this.
    I welcome feedback from maintainers on other approaches here.
    abhinav authored May 7, 2025
    Configuration menu
    Copy the full SHA
    608bd43 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2025

  1. Only emit patch file if nogo has fixes (#4269)

    **What type of PR is this?**
    
    Feature
    
    **What does this PR do? Why is it needed?**
    
    This makes it easier to download all relevant patches with
    `--remote_download_regex` without creating a bunch of empty patch files.
    
    
    **Which issues(s) does this PR fix?**
    
    **Other notes for review**
    fmeum authored May 13, 2025
    Configuration menu
    Copy the full SHA
    fb90c46 View commit details
    Browse the repository at this point in the history
  2. Rename out to out_diagnostics (#4341)

    **What type of PR is this?**
    
    Refactor
    
    **What does this PR do? Why is it needed?**
    
    Follow-up to #4269
    
    **Which issues(s) does this PR fix?**
    
    **Other notes for review**
    fmeum authored May 13, 2025
    Configuration menu
    Copy the full SHA
    5fe82a7 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2025

  1. Remove rules_proto (#4339)

    **What type of PR is this?**
    
    > Cleanup
    
    **What does this PR do? Why is it needed?**
    
    Replaces rules_proto uses with com_google_protobuf. The former is
    deprecated.
    comius authored May 15, 2025
    Configuration menu
    Copy the full SHA
    cd29704 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2025

  1. Remove shadow analyzer from TOOLS_NOGO (#4344)

    **What type of PR is this?**
    
    Other
    
    **What does this PR do? Why is it needed?**
    
    The shadow analyzer issues many false positives which are not in keeping
    with Go best practices. Even the upstream documentation for this
    analyzer admits this and claims that it is experimental. It should not
    be included in the default list of analyzers provided by nogo (users can
    still opt-in to it if they want it).
    
    
    **Which issues(s) does this PR fix?**
    
    Fixes #4340
    
    **Other notes for review**
    gpanders authored May 16, 2025
    Configuration menu
    Copy the full SHA
    30a2a1c View commit details
    Browse the repository at this point in the history
  2. Disable pkgfact analyzer (#4349)

    It's just a demo analyzer that serves as an example of the facts
    mechanism.
    
    Context:
    https://bazelbuild.slack.com/archives/CDBP88Z0D/p1747334404309089?thread_ts=1747334404.309089&cid=CDBP88Z0D
    fmeum authored May 16, 2025
    Configuration menu
    Copy the full SHA
    b79f6d7 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2025

  1. Discourage references to the default SDK (#4351)

    The repo contains a host-compatible SDK and thus doesn't behave
    correctly in multi-platform builds.
    
    Fixes #4342
    fmeum authored May 19, 2025
    Configuration menu
    Copy the full SHA
    99bb9af View commit details
    Browse the repository at this point in the history
  2. go/tools/gopackagesdriver: Adding Cgo support (#4338)

    go/tools/gopackagesdriver: Filter cgo sources and add cgo processed
    files
        
    The gopackagesdriver today fails to load Go programs
    with cgo dependencies.
    ```
    go-code/bazel-pkgdrv/external/com_github_mattn_go_sqlite3/backup.go:16:8: could not import C (no metadata for C)
    ```
    
    These errors come from two sources:
    - First, the gopackagesdriver includes cgo sources files in the
      CompiledGoFiles response.
    - Second, the gopackagesdriver response and CompiledGoFiles do not
      contain cgo processed Go sources necessary to compile the program.
    
    This change addresses both error points by
    - Exposing the location of cgo generated artifacts in the rules_go
    archive object.
    - Filtering out cgo source files from the CompiledGoFiles response, by
    checking if the files import "C".
    - Adding cgo processed files to the CompiledGoFiles response by
    exploiting
    knowledge of how rules_go compiles cgo files.
    
    I am not sure if there is a better solution to leaking build system
    details to the gopackagesdriver as even 'go list' leaks where
    the go build cache stores cgo processed files. Though in the case of 'go
    list'
    the conventions for cgo processed files are a bit different, they don't
    seem to have a file extension.
    
    For example,
    ```
    $ go list -json=ImportPath,CgoFiles,GoFiles,CompiledGoFiles -compiled -find github.com/mattn/go-sqlite3
     "CompiledGoFiles": [
                    "convert.go",
                    "doc.go",
                    "sqlite3_func_crypt.go",
                    "sqlite3_go18.go",
                    "sqlite3_opt_preupdate.go",
                    "sqlite3_opt_preupdate_omit.go",
                    "/Users/rhang/Library/Caches/go-build/8f/8f8bfe0b75fcceeb093e990af3eaa4f05147147b13db050b2f706cb563280415-d",
                    "/Users/rhang/Library/Caches/go-build/9c/9c0b42e0a548721eb17f0fe5cfc2b6f1c0f0f7fcfb0f0caf526229723b9d4927-d",
                    "/Users/rhang/Library/Caches/go-build/f7/f7e25424abcdc8442dbe22670456cab79a881268995c4ed43715e6d56930bff6-d",
    ...
    ```
    
    This PR resolves #4337
    additional
    details are provided in the issue.
    r-hang authored May 19, 2025
    1 Configuration menu
    Copy the full SHA
    11c6145 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2025

  1. Pass headers along as transitive dependencies (#4298)

    This fixes github.com/cloudflare/circl relative imports by making those
    headers available at compile time.
    
    **What type of PR is this?**
    
    Feature
    
    **What does this PR do? Why is it needed?**
    
    Expose headers in GoArchive so that compilepkg can make them visible.
    This will make it possible for relative imports to find header files.
    
    **Which issues(s) does this PR fix?**
    
    Fixes #4154 
    
    **Other notes for review**
    patrickmscott authored May 22, 2025
    Configuration menu
    Copy the full SHA
    393faea View commit details
    Browse the repository at this point in the history

Commits on May 28, 2025

  1. Allowing a go_proto_compiler to indicate whether it always generate f…

    …iles (#4364)
    
    **What type of PR is this?**
    Feature
    
    **What does this PR do? Why is it needed?**
    This PR allows a `go_proto_compiler` to indicate whether it always
    generate files, if so, we can apply more strict check to the output of
    the proto compiler.
    
    **Which issues(s) does this PR fix?**
    
    This is an alternative way to fix #3949
    
    **Other notes for review**
    linzhp authored May 28, 2025
    Configuration menu
    Copy the full SHA
    fc0cf79 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2025

  1. fix: merge '-Wl,' with next value when (#4367)

    **What type of PR is this?**
    
    > Bug fix
    
    **What does this PR do? Why is it needed?**
    
    Previously if we pass `-extldflags,-Wl,--thread` into command line, it
    will only recognizes `-Wl` and ignores `--thread`.
    
    **Which issues(s) does this PR fix?**
    #3921 
    
    Fixes #
    
    If we see `-Wl`, we can merge with next value in the list.
    
    **Other notes for review**
    
    Co-authored-by: zhanning.lu <zhanning.lu@bytedance.com>
    luzhanning and zhanning.lu authored Jun 1, 2025
    Configuration menu
    Copy the full SHA
    8e7d9cd View commit details
    Browse the repository at this point in the history
Loading