Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Why do we build using go build -a and have removed buildkit caching? #2730

Closed
randomvariable opened this issue Jun 23, 2022 · 2 comments · Fixed by #3972
Closed

Why do we build using go build -a and have removed buildkit caching? #2730

randomvariable opened this issue Jun 23, 2022 · 2 comments · Fixed by #3972
Labels
area/core-cli area/dx Related to developer experience kind/bug PR/Issue related to a bug

Comments

@randomvariable
Copy link
Contributor

randomvariable commented Jun 23, 2022

Bug description

It currently takes an hour to build tanzu framework to any reasonable state on a Ryzen 5900X with 64GB RAM.

Is there a particular reason to use go build -a when the golang compiler does reproducible builds when not using cgo?
Also, it seems we used to use buildkit caching going by some of the comments in the Dockerfiles, but that this was removed. Is there a reason for doing so?

Expected behavior
Builds take a lot less than 1 hour.

Steps to reproduce the bug

Version (include the SHA if the version is not obvious)

Environment where the bug was observed (cloud, OS, etc)

Relevant Debug Output (Logs, manifests, etc)

@randomvariable randomvariable added kind/bug PR/Issue related to a bug needs-triage Indicates an issue or PR needs to be triaged area/dx Related to developer experience labels Jun 23, 2022
@stmcginnis
Copy link
Contributor

I am not able to find a case of using go build -a. Can you specify what command you are running to see that? From our normal make targets we use the builder plugin to generate a consistent build command. I'm not seeing -a being used in that:

ℹ  🐶 - $ /usr/local/bin/go build \
  -o /Users/smcginnis/src/vmware-tanzu/tanzu-framework/artifacts-admin/linux/amd64/cli/codegen/v0.24.0-dev/tanzu-codegen-linux_amd64 \
  -ldflags -s -w -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/buildinfo.Date=2022-06-23' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/buildinfo.SHA=c5b09db1-dirty' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/buildinfo.Version=v0.24.0-dev' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/buildinfo.IsOfficialBuild=' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/config.DefaultStandaloneDiscoveryRepository=projects-stg.registry.vmware.com/tkg' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/cli/common.IsContextAwareDiscoveryEnabled=true' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/config.DefaultStandaloneDiscoveryImagePath=packages/standalone-plugins' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/config.DefaultStandaloneDiscoveryImageTag=v0.24.0-dev' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/config.DefaultStandaloneDiscoveryLocalPath=standalone' \
  -X 'github.com/vmware-tanzu/tanzu-framework/pkg/v1/config.DefaultStandaloneDiscoveryType=local' \
  -tags  ./cmd/cli/plugin-admin/codegen

@randomvariable
Copy link
Contributor Author

image

@yharish991 yharish991 removed the needs-triage Indicates an issue or PR needs to be triaged label Jul 2, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area/core-cli area/dx Related to developer experience kind/bug PR/Issue related to a bug
Projects
None yet
4 participants