bazelbuild / bazelbuild/remote-apis

*:go_default_library should be alias of *:xyz_go_proto

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
445
Forks
141
PR merge metrics
No merged PRs in 30d

Description

I'm seeing the following error when building a go binary that depends on `semver.proto` and `remote_execution.proto`:

```
$ bazel build //:test
INFO: Invocation ID: 5938ca3c-1dae-404a-833e-20b364aed4bb
INFO: Analyzed target //:test (1 packages loaded, 2 targets configured).
INFO: Found 1 target...
INFO: From GoLink darwin_amd64_stripped/test:
link: warning: package "github.com/bazelbuild/remote-apis/build/bazel/semver" is provided by more than one rule:
//build/bazel/semver:semver_go_proto
//build/bazel/semver:go_default_library
Set "importmap" to different paths in each library.
This will be an error in the future.
Target //:test up-to-date:
bazel-bin/darwin_amd64_stripped/test
INFO: Elapsed time: 2.112s, Critical Path: 1.76s
INFO: 2 processes: 2 darwin-sandbox.
INFO: Build completed successfully, 3 total actions
```

BUILD:
```starlark
go_binary(
name = "test",
srcs = [
"test.go",
],
deps = [
"//build/bazel/remote/execution/v2:go_default_library",
"//build/bazel/semver:semver_go_proto",
],
)
```

test.go:
```go
package main

import ()

func main() {
}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the BUILD definitions for //build/bazel/semver:semver_go_proto, //build/bazel/semver:go_default_library, and the remote execution Go target. Reproduce the warning with the shown bazel build //:test command; done means the default Go library resolves as an alias of the proto target without duplicate package providers.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.