bazel-contrib / bazel-contrib/rules_go

Go 1.18 BuildInfo support

Open
#3,090 20 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.5k
Forks
762
Avg merge
1d 11h
Merged PRs (30d)
12

Description

What version of rules_go are you using?

v0.30.0

What version of gazelle are you using?

6bbfc47f1b0a27ee1efeddcc6671f3e4e03235dc

What version of Bazel are you using?
Build label: 5.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Jan 19 14:08:54 2022 (1642601334)
Build timestamp: 1642601334
Build timestamp as int: 1642601334
Does this issue reproduce with the latest releases of all the above?

Yes.

What operating system and processor architecture are you using?
% uname -sm
Linux x86_64

and

% uname -sm
Darwin arm64
What did you do?

Wrote a program that tries to access build information via runtime/debug.ReadBuildInfo and built it inside a Git repository.

package main

import (
	"fmt"
	"runtime/debug"
)

func main() {
	info, ok := debug.ReadBuildInfo()
	fmt.Println(info, ok)
}
What did you expect to see?

Information about the build environment.

What did you see instead?
<nil> false

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported Go program using runtime/debug.ReadBuildInfo while building inside a Git repository. Trace how rules_go and Bazel provide Go build metadata, then verify that the program reports build information instead of nil and false on the listed Linux and macOS environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.