fix: modify the grafana dev build (#116872)

* ale/debug

* undo change and ignore local cert

* fix flag

* cleanup
This commit is contained in:
Alejandro 2026-01-27 17:14:33 -06:00 committed by GitHub
parent fda39b0c26
commit 86f6f7657a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 5 deletions

View file

@ -5,6 +5,7 @@
.vscode
bin
!bin/grafana-linux-k8s
!bin/grafana-linux-k8s-debug
data*
dist
docker

1
.gitignore vendored
View file

@ -264,3 +264,4 @@ public/mockServiceWorker.js
.hippo
coverage-summary.json
devenv/blocks/auth/signer/keys/ec_private_key.pem

View file

@ -102,7 +102,7 @@ func RunCmd() int {
}
case "build":
//clean()
// clean()
for _, binary := range binaries {
log.Println("building binaries", cmd)
// Can't use filepath.Join here because filepath.Join calls filepath.Clean, which removes the `./` from this path, which upsets `go build`
@ -154,6 +154,10 @@ func setup(goos string) {
}
func doBuild(binaryName, pkg string, opts BuildOpts) error {
if opts.binarySuffix != "" {
binaryName += "-" + opts.binarySuffix
}
log.Println("building", binaryName, pkg)
if err := setBuildEnv(opts); err != nil {
@ -166,7 +170,7 @@ func doBuild(binaryName, pkg string, opts BuildOpts) error {
}
binary := fmt.Sprintf("./bin/%s", binaryName)
//don't include os/arch/libc in output path in dev environment
// don't include os/arch/libc in output path in dev environment
if !opts.isDev {
binary = fmt.Sprintf("./bin/%s-%s%s/%s", opts.goos, opts.goarch, libcPart, binaryName)
}
@ -289,9 +293,8 @@ func setBuildEnv(opts BuildOpts) error {
}
}
if (opts.goos != GoOSLinux || opts.goarch != "amd64") &&
opts.goos != GoOSDarwin {
// needed for archs other than linux/amd64 and darwin/arm64 + darwin/amd64
if opts.goos != GoOSLinux && opts.goos != GoOSDarwin {
// needed for archs other than linux/amd64, linux/arm64, darwin/arm64 and darwin/amd64
opts.cgo = true
}

View file

@ -26,6 +26,7 @@ type BuildOpts struct {
skipRpmGen bool
skipDebGen bool
printGenVersion bool
binarySuffix string
}
// BuildOptsFromFlags reads the cmd args to assemble a BuildOpts object. This function calls flag.Parse()
@ -50,6 +51,7 @@ func BuildOptsFromFlags() BuildOpts {
flag.BoolVar(&opts.skipRpmGen, "skipRpm", false, "skip rpm package generation (default: false)")
flag.BoolVar(&opts.skipDebGen, "skipDeb", false, "skip deb package generation (default: false)")
flag.BoolVar(&opts.printGenVersion, "gen-version", false, "generate Grafana version and output (default: false)")
flag.StringVar(&opts.binarySuffix, "suffix", "", "suffix to append to binary name")
flag.Parse()
opts.buildID = shortenBuildID(buildIDRaw)