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

Add support for env_inherit #3256

Merged
merged 14 commits into from
Jan 22, 2023
Merged

Add support for env_inherit #3256

merged 14 commits into from
Jan 22, 2023

Conversation

ttpathan
Copy link
Contributor

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Adds support for env_inherit attribute in go_test.
This is useful for us for integration tests, where we pass database info in CI as environment variables.
env_inherit is supported for native Bazel rules.

Which issues(s) does this PR fix?

Closes #3241

Other notes for review

Inherited environment requires Bazel 5.2.0+. We only pass inherited_environment if env_inherit has been explicitly specified, so that rules_go still remains compatible with its minimum supported Bazel version.

I wasn't quite sure on how to add a test for this. I need to be able to pass in an environment variable from the shell env, but there didn't seem like anything existing set up to do this - it just runs test targets directly, with no wrapper(?). Would appreciate advice on how to approach that, thanks!

@fmeum
Copy link
Collaborator

fmeum commented Jul 28, 2022

Thanks for the contribution, I will take a look.

You can create proper integration tests using go_bazel_test, see https://github.com/bazelbuild/rules_go/blob/master/tests/core/go_binary/non_executable_test.go for an example. In this way, you can set environment variables, then execute Bazel and make assertions about the outcome.

@@ -184,7 +185,7 @@ def _go_test_impl(ctx):
dependency_attributes = ["deps", "embed"],
extensions = ["go"],
),
testing.TestEnvironment(env),
testing.TestEnvironment(env, inherited_environment) if inherited_environment else testing.TestEnvironment(env),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achew22 Are you ultimately fine with this approach or would you prefer an explicit Bazel version check with a more descriptive error message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to be so slow on response to this one. I would definitely prefer the explicit check. My bias on these checks is to see if the property or attribute exists on the object. If that's not possible because it's something like an argument to a function, then a version check is sufficient. Also, please include a comment indicating why the version check is there and a link so that later we can reevaluate if the check is still necessary.

Again, sorry to be so slow!

@ttpathan
Copy link
Contributor Author

@fmeum
Copy link
Collaborator

fmeum commented Aug 20, 2022

@achew22 What do you think, could we temporarily include this without test coverage until we raise the minimum to 5.3.0?

@ttpathan
Copy link
Contributor Author

No worries at all for the delay.

I tried adding an explicit version check, assuming native.bazel_version would work, but turns out this is only available for workspace macros? bazelbuild/bazel#8305. Is there a better way to check this?

What do you think, could we temporarily include this without test coverage until we raise the minimum to 5.3.0?

Its only the "ubuntu1804_bazel400" job which fails, the rest are fine (because I assume they use latest Bazel?). Maybe I should just ignore the test case in that specific CI job?

test_targets:
- "//..."

@fmeum
Copy link
Collaborator

fmeum commented Aug 22, 2022

I tried adding an explicit version check, assuming native.bazel_version would work, but turns out this is only available for workspace macros? bazelbuild/bazel#8305. Is there a better way to check this?

No, unfortunately not. We have to add a repository rule exposing the version as a Starlark constant and can then use the bazel-skylib helper functions to assert the minimum in the rule.

@ttpathan
Copy link
Contributor Author

Sorry, this is all very new to me, unsure if I've done it correctly - let me know if anything needs changing.
Not entirely sure on how to resolve the BCR test module job, I assume I need some sort of use_repo somewhere.
The error that is shown is visible in https://storage.googleapis.com/bazel-untrusted-buildkite-artifacts/0182f3a1-6e90-414c-8853-7c1947b8097f/tests/core/go_test/env_inherit_test/test.log. I can also go ahead and remove the target from testing in ubuntu1804_bazel400

@fmeum
Copy link
Collaborator

fmeum commented Sep 15, 2022

@linzhp Now that we are on 5.1.0, do you think we can go up to 5.2.0 in the next release? That would greatly simplify this PR.

@linzhp
Copy link
Contributor

linzhp commented Sep 15, 2022

I am OK with that

@fmeum
Copy link
Collaborator

fmeum commented Sep 15, 2022

@ttpathan Sorry for the back and forth (and delay), but we are finally ready to update to 5.2.0. Instead of the version check, you can just use inherited_environment unconditionally and write a simple test.

@fmeum
Copy link
Collaborator

fmeum commented Dec 20, 2022

@ttpathan With Bazel 6 out, there is really nothing preventing us from updating to 5.2.0 unconditionally now. Are you still interested in getting this merged? We could now do so without the version check.

@fmeum
Copy link
Collaborator

fmeum commented Jan 22, 2023

@ttpathan I pushed a new commit that enables the feature unconditionally and increases the minimum required Bazel version. I kept you as the author. Thanks for the contribution and sorry for the long delay!

@fmeum fmeum merged commit 5412c01 into bazelbuild:master Jan 22, 2023
renovate bot added a commit to cgrindel/bazel-starlib that referenced this pull request Jan 24, 2023
[![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.37.0` -> `v0.38.0` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go</summary>

###
[`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.

#### 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
[@&#8203;motiejus](https://togithub.com/motiejus) in
[bazelbuild/rules_go#3389
- Adapt `lcov_coverage_test` to `exec.Command` change by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3392
- explicitly build relative path for Tool command in lcov_coverage_test
by [@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3399
- Add support for building with boringcrypto by
[@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3398
- Generalize `boringcrypto` to `GOEXPERIMENT` support by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3401
- Replace `cfg = "host"` with `cfg = "exec"` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3404
- always produce .a files at the beginning of a build by
[@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3385
- Mark `nogo` targets as `manual` to keep top-level symlinks by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3410
- Refactoring the extld related logic by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3400
- Fix incompatible flags not applied to integration tests by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3415
- chore: remove experimental warning from bzlmod module by
[@&#8203;alexeagle](https://togithub.com/alexeagle) in
[bazelbuild/rules_go#3418
- Add a clarifying error about dependency cycle found for internal tests
by [@&#8203;yushan26](https://togithub.com/yushan26) in
[bazelbuild/rules_go#3422
- Do not use exec paths for rundir by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3414
- Upgrade org_golang_x_tools to 0.5.0 by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3356
- fix: Relative path of embedsrc by
[@&#8203;bakjos](https://togithub.com/bakjos) in
[bazelbuild/rules_go#3407
- Add support for env_inherit by
[@&#8203;ttpathan](https://togithub.com/ttpathan) in
[bazelbuild/rules_go#3256
- Update stardoc to 0.5.3 by [@&#8203;fmeum](https://togithub.com/fmeum)
in
[bazelbuild/rules_go#3427
- Add `env` attribute to `go_binary` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3428

#### New Contributors

- [@&#8203;matloob](https://togithub.com/matloob) made their first
contribution in
[bazelbuild/rules_go#3399
- [@&#8203;yushan26](https://togithub.com/yushan26) made their first
contribution in
[bazelbuild/rules_go#3422
- [@&#8203;bakjos](https://togithub.com/bakjos) made their first
contribution in
[bazelbuild/rules_go#3407
- [@&#8203;ttpathan](https://togithub.com/ttpathan) made their first
contribution in
[bazelbuild/rules_go#3256

**Full Changelog**:
bazelbuild/rules_go@v0.37.0...v0.38.0

</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:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTEuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExMS4xIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
kreempuff added a commit to kreempuff/rules_unreal_engine that referenced this pull request Jan 31, 2023
[![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
([#&#8203;3432](https://togithub.com/bazelbuild/rules_go/issues/3432))
for now to make rules_go upgrades easier.

#### `WORKSPACE` code

load("@&#8203;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("@&#8203;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**:
bazelbuild/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
[@&#8203;motiejus](https://togithub.com/motiejus) in
[bazelbuild/rules_go#3389
- Adapt `lcov_coverage_test` to `exec.Command` change by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3392
- explicitly build relative path for Tool command in lcov_coverage_test
by [@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3399
- Add support for building with boringcrypto by
[@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3398
- Generalize `boringcrypto` to `GOEXPERIMENT` support by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3401
- Replace `cfg = "host"` with `cfg = "exec"` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3404
- always produce .a files at the beginning of a build by
[@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3385
- Mark `nogo` targets as `manual` to keep top-level symlinks by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3410
- Refactoring the extld related logic by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3400
- Fix incompatible flags not applied to integration tests by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3415
- chore: remove experimental warning from bzlmod module by
[@&#8203;alexeagle](https://togithub.com/alexeagle) in
[bazelbuild/rules_go#3418
- Add a clarifying error about dependency cycle found for internal tests
by [@&#8203;yushan26](https://togithub.com/yushan26) in
[bazelbuild/rules_go#3422
- Do not use exec paths for rundir by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3414
- Upgrade org_golang_x_tools to 0.5.0 by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3356
- fix: Relative path of embedsrc by
[@&#8203;bakjos](https://togithub.com/bakjos) in
[bazelbuild/rules_go#3407
- Add support for env_inherit by
[@&#8203;ttpathan](https://togithub.com/ttpathan) in
[bazelbuild/rules_go#3256
- Update stardoc to 0.5.3 by [@&#8203;fmeum](https://togithub.com/fmeum)
in
[bazelbuild/rules_go#3427
- Add `env` attribute to `go_binary` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3428

#### New Contributors

- [@&#8203;matloob](https://togithub.com/matloob) made their first
contribution in
[bazelbuild/rules_go#3399
- [@&#8203;yushan26](https://togithub.com/yushan26) made their first
contribution in
[bazelbuild/rules_go#3422
- [@&#8203;bakjos](https://togithub.com/bakjos) made their first
contribution in
[bazelbuild/rules_go#3407
- [@&#8203;ttpathan](https://togithub.com/ttpathan) made their first
contribution in
[bazelbuild/rules_go#3256

**Full Changelog**:
bazelbuild/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
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3359
- Declare toolchains in a separate repository by
[@&#8203;jfirebaugh](https://togithub.com/jfirebaugh) in
[bazelbuild/rules_go#3348
- Delete legacy actions API by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3173
- go_path: support go:embed of generated files by
[@&#8203;S-Chan](https://togithub.com/S-Chan) in
[bazelbuild/rules_go#3285
- Properly deprecate `bindata`, `go_embed_data`, and
`go_embed_data_deps` by [@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3362
- link.bzl: ignore duplicate dep on coverdata by
[@&#8203;robfig](https://togithub.com/robfig) in
[bazelbuild/rules_go#3032
- feat(pkg-drv): add support for generated files by
[@&#8203;JamyDev](https://togithub.com/JamyDev) in
[bazelbuild/rules_go#3354
- Remove unused variables in link action by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3367
- Reduce number of declared files in `emit_stdlib` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3366
- Update docs regarding vendored proto files by
[@&#8203;garymm](https://togithub.com/garymm) in
[bazelbuild/rules_go#3360
- go link: use external linker when in race mode by
[@&#8203;motiejus](https://togithub.com/motiejus) in
[bazelbuild/rules_go#3370
- Adding first example by
[@&#8203;chrislovecnm](https://togithub.com/chrislovecnm) in
[bazelbuild/rules_go#3317
- fix(packagesdriver): bazelFlags should prefix the command by
[@&#8203;JamyDev](https://togithub.com/JamyDev) in
[bazelbuild/rules_go#3371
- chore(gpd): export aspect utils for reusability by
[@&#8203;JamyDev](https://togithub.com/JamyDev) in
[bazelbuild/rules_go#3373
- nogo: Add a \_base key to be a default config for all Analyzers. by
[@&#8203;DolceTriade](https://togithub.com/DolceTriade) in
[bazelbuild/rules_go#3351
- Document that `Rlocation` can return relative paths by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3377
- Fix normalization check for `Rlocation` path by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3378
- fix(gpd): Write large target patterns to file by
[@&#8203;JamyDev](https://togithub.com/JamyDev) in
[bazelbuild/rules_go#3372
- Make Go runfiles library repo mapping aware by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3347

#### New Contributors

- [@&#8203;jfirebaugh](https://togithub.com/jfirebaugh) made their first
contribution in
[bazelbuild/rules_go#3348
- [@&#8203;S-Chan](https://togithub.com/S-Chan) made their first
contribution in
[bazelbuild/rules_go#3285
- [@&#8203;garymm](https://togithub.com/garymm) made their first
contribution in
[bazelbuild/rules_go#3360
- [@&#8203;motiejus](https://togithub.com/motiejus) made their first
contribution in
[bazelbuild/rules_go#3370
- [@&#8203;chrislovecnm](https://togithub.com/chrislovecnm) made their
first contribution in
[bazelbuild/rules_go#3317
- [@&#8203;DolceTriade](https://togithub.com/DolceTriade) made their
first contribution in
[bazelbuild/rules_go#3351

**Full Changelog**:
bazelbuild/rules_go@v0.36.0...v0.37.0

#### `WORKSPACE` code

load("@&#8203;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("@&#8203;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
[@&#8203;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
`--@&#8203;io_bazel_rules_go//go/config:gc_goopts` and
`--@&#8203;io_bazel_rules_go//go/config:gc_linkopts` to accept
additional compiler and linker flags.

#### What's Changed

- bzlmod: Use register_toolchains by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3290
- Remove unused env_execute by
[@&#8203;kmicklas](https://togithub.com/kmicklas) in
[bazelbuild/rules_go#3276
- Correctly forward InstrumentedFilesInfo from dependencies by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3294
- Parse Go SDK version out of `go version` instead of `VERSION` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3296
- also write test stderr to json (xml) output file by
[@&#8203;rickystewart](https://togithub.com/rickystewart) in
[bazelbuild/rules_go#3300
- Bzlmod: Pin Bazel version in CI by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3301
- Allow to select Go SDK version from declared SDKs by
[@&#8203;ash2k](https://togithub.com/ash2k) in
[bazelbuild/rules_go#3303
- Use top level VERSION file when it exists by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3309
- synchronize when writing to the JSON converter by
[@&#8203;rickystewart](https://togithub.com/rickystewart) in
[bazelbuild/rules_go#3311
- update version manifest URL by
[@&#8203;benjaminp](https://togithub.com/benjaminp) in
[bazelbuild/rules_go#3314
- Symlink "misc" into repository for local_sdk. by
[@&#8203;adam-azarchs](https://togithub.com/adam-azarchs) in
[bazelbuild/rules_go#3313
- Ensure compatibility with incompatible flags close to flipping by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3319
- Add additional bzlmod requirements to allow grpc protobufs to work by
[@&#8203;shs96c](https://togithub.com/shs96c) in
[bazelbuild/rules_go#3320
- bzlmod: Update pinned Bazel version by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3321
- bzlmod: Set up automated BCR releases by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3324
- bzlmod: Add support for gogo proto compiler by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3323
- gopackagesdriver: move non-Go files to OtherFiles (Fixes
[#&#8203;3326](https://togithub.com/bazelbuild/rules_go/issues/3326)) by
[@&#8203;michaelarusso](https://togithub.com/michaelarusso) in
[bazelbuild/rules_go#3327
- bzlmod: Allow yanked versions in CI by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3329
- feat(pkg-drv): allow setting custom aspect and kinds by
[@&#8203;JamyDev](https://togithub.com/JamyDev) in
[bazelbuild/rules_go#3328
- fix(packages-driver): allow defining additional aspects instead by
[@&#8203;JamyDev](https://togithub.com/JamyDev) in
[bazelbuild/rules_go#3330
- Add support for parsing Go development versions by
[@&#8203;zakcutner](https://togithub.com/zakcutner) in
[bazelbuild/rules_go#3333
- Match GOARCH ppc64 to @&#8203;platforms//cpu:ppc as well. by
[@&#8203;mahiuchun](https://togithub.com/mahiuchun) in
[bazelbuild/rules_go#3336
- bzlmod: Update Publish to BCR app config by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3337
- gopackagesdriver: default to NotHandled:true for package queries by
[@&#8203;ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) in
[bazelbuild/rules_go#3338
- fix(packagesdrv): resolve third party go packages by
[@&#8203;JamyDev](https://togithub.com/JamyDev) in
[bazelbuild/rules_go#3332
- runfiles: port phst/runfiles to rules_go by
[@&#8203;sluongng](https://togithub.com/sluongng) in
[bazelbuild/rules_go#3205
- Adding gc_linopts to command line flag by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3342
- Move new runfiles library to `//go/runfiles` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3341
- Rename `Path` to `Rlocation` in runfiles library by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3346
- Add 'gc_goopts' flag to command line to allow gc_goopts to propagate
by [@&#8203;LWarrens](https://togithub.com/LWarrens) in
[bazelbuild/rules_go#3340

#### New Contributors

- [@&#8203;kmicklas](https://togithub.com/kmicklas) made their first
contribution in
[bazelbuild/rules_go#3276
- [@&#8203;adam-azarchs](https://togithub.com/adam-azarchs) made their
first contribution in
[bazelbuild/rules_go#3313
- [@&#8203;shs96c](https://togithub.com/shs96c) made their first
contribution in
[bazelbuild/rules_go#3320
- [@&#8203;michaelarusso](https://togithub.com/michaelarusso) made their
first contribution in
[bazelbuild/rules_go#3327
- [@&#8203;zakcutner](https://togithub.com/zakcutner) made their first
contribution in
[bazelbuild/rules_go#3333
- [@&#8203;mahiuchun](https://togithub.com/mahiuchun) made their first
contribution in
[bazelbuild/rules_go#3336
- [@&#8203;LWarrens](https://togithub.com/LWarrens) made their first
contribution in
[bazelbuild/rules_go#3340

**Full Changelog**:
bazelbuild/rules_go@v0.35.0...v0.36.0

#### `WORKSPACE` code

load("@&#8203;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("@&#8203;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=-->
healthy-pod pushed a commit to cockroachdb/rules_go that referenced this pull request Feb 18, 2023
* Add support for env_inherit

* Keep compat with < 5.2

* Add skeleton test

This will most likely fail CI - not sure how to pass through an env var

* Add integration test

* Update docs

* Explicitly check Bazel version

* Fix lib import

* Import and visibility

* revert changes

* Fix dep

* Create bazel_version repo rule and check version

* fix deps

* export file

* Unconditionally set inherited_environment

Requires increasing the minimum Bazel version to 5.2.0.

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
healthy-pod pushed a commit to cockroachdb/rules_go that referenced this pull request Feb 22, 2023
* Add support for env_inherit

* Keep compat with < 5.2

* Add skeleton test

This will most likely fail CI - not sure how to pass through an env var

* Add integration test

* Update docs

* Explicitly check Bazel version

* Fix lib import

* Import and visibility

* revert changes

* Fix dep

* Create bazel_version repo rule and check version

* fix deps

* export file

* Unconditionally set inherited_environment

Requires increasing the minimum Bazel version to 5.2.0.

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
tingilee pushed a commit to tingilee/rules_go that referenced this pull request Jul 19, 2023
* Add support for env_inherit

* Keep compat with < 5.2

* Add skeleton test

This will most likely fail CI - not sure how to pass through an env var

* Add integration test

* Update docs

* Explicitly check Bazel version

* Fix lib import

* Import and visibility

* revert changes

* Fix dep

* Create bazel_version repo rule and check version

* fix deps

* export file

* Unconditionally set inherited_environment

Requires increasing the minimum Bazel version to 5.2.0.

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
f0rmiga added a commit to aspect-build/talkie that referenced this pull request Aug 11, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/bazelbuild/buildtools](https://togithub.com/bazelbuild/buildtools)
| require | digest | `180a94a` -> `bf454e7` |
|
[github.com/bazelbuild/rules_go](https://togithub.com/bazelbuild/rules_go)
| require | minor | `v0.37.0` -> `v0.38.0` |
| [github.com/onsi/gomega](https://togithub.com/onsi/gomega) | require |
minor | `v1.25.0` -> `v1.26.0` |
| [golang.org/x/exp](https://togithub.com/golang/exp) | require | digest
| `a68e582` -> `b3c2aaf` |
|
[google.golang.org/genproto](https://togithub.com/googleapis/go-genproto)
| require | digest | `9d59e20` -> `dcaf20b` |
| [google.golang.org/grpc](https://togithub.com/grpc/grpc-go) | require
| patch | `v1.52.0` -> `v1.52.3` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>bazelbuild/rules_go</summary>

###
[`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
[@&#8203;motiejus](https://togithub.com/motiejus) in
[bazelbuild/rules_go#3389
- Adapt `lcov_coverage_test` to `exec.Command` change by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3392
- explicitly build relative path for Tool command in lcov_coverage_test
by [@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3399
- Add support for building with boringcrypto by
[@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3398
- Generalize `boringcrypto` to `GOEXPERIMENT` support by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3401
- Replace `cfg = "host"` with `cfg = "exec"` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3404
- always produce .a files at the beginning of a build by
[@&#8203;matloob](https://togithub.com/matloob) in
[bazelbuild/rules_go#3385
- Mark `nogo` targets as `manual` to keep top-level symlinks by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3410
- Refactoring the extld related logic by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3400
- Fix incompatible flags not applied to integration tests by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3415
- chore: remove experimental warning from bzlmod module by
[@&#8203;alexeagle](https://togithub.com/alexeagle) in
[bazelbuild/rules_go#3418
- Add a clarifying error about dependency cycle found for internal tests
by [@&#8203;yushan26](https://togithub.com/yushan26) in
[bazelbuild/rules_go#3422
- Do not use exec paths for rundir by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3414
- Upgrade org_golang_x_tools to 0.5.0 by
[@&#8203;linzhp](https://togithub.com/linzhp) in
[bazelbuild/rules_go#3356
- fix: Relative path of embedsrc by
[@&#8203;bakjos](https://togithub.com/bakjos) in
[bazelbuild/rules_go#3407
- Add support for env_inherit by
[@&#8203;ttpathan](https://togithub.com/ttpathan) in
[bazelbuild/rules_go#3256
- Update stardoc to 0.5.3 by [@&#8203;fmeum](https://togithub.com/fmeum)
in
[bazelbuild/rules_go#3427
- Add `env` attribute to `go_binary` by
[@&#8203;fmeum](https://togithub.com/fmeum) in
[bazelbuild/rules_go#3428

#### New Contributors

- [@&#8203;matloob](https://togithub.com/matloob) made their first
contribution in
[bazelbuild/rules_go#3399
- [@&#8203;yushan26](https://togithub.com/yushan26) made their first
contribution in
[bazelbuild/rules_go#3422
- [@&#8203;bakjos](https://togithub.com/bakjos) made their first
contribution in
[bazelbuild/rules_go#3407
- [@&#8203;ttpathan](https://togithub.com/ttpathan) made their first
contribution in
[bazelbuild/rules_go#3256

**Full Changelog**:
bazelbuild/rules_go@v0.37.0...v0.38.0

</details>

<details>
<summary>onsi/gomega</summary>

### [`v1.26.0`](https://togithub.com/onsi/gomega/releases/tag/v1.26.0)

[Compare
Source](https://togithub.com/onsi/gomega/compare/v1.25.0...v1.26.0)

#### 1.26.0

##### Features

- When a polled function returns an error, keep track of the actual and
report on the matcher state of the last non-errored actual
\[[`21f3090`](https://togithub.com/onsi/gomega/commit/21f3090)]
- improve eventually failure message output
\[[`c530fb3`](https://togithub.com/onsi/gomega/commit/c530fb3)]

##### Fixes

- fix several documentation spelling issues
\[[`e2eff1f`](https://togithub.com/onsi/gomega/commit/e2eff1f)]

</details>

<details>
<summary>grpc/grpc-go</summary>

### [`v1.52.3`](https://togithub.com/grpc/grpc-go/releases/tag/v1.52.3):
Release 1.52.3

[Compare
Source](https://togithub.com/grpc/grpc-go/compare/v1.52.1...v1.52.3)

### Bug Fixes

-   Fix user-agent version

### [`v1.52.1`](https://togithub.com/grpc/grpc-go/releases/tag/v1.52.1):
Release 1.52.1

[Compare
Source](https://togithub.com/grpc/grpc-go/compare/v1.52.0...v1.52.1)

### Bug Fixes

- grpclb: rename grpclbstate package back to state
([#&#8203;5963](https://togithub.com/grpc/grpc-go/issues/5963))

</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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- 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/aspect-build/silo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDkuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExMS4xIn0=-->

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
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.

Support env_inherit for go_test
4 participants