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

[epic] Remove GOPATH for go modules formula #47627

Open
chenrui333 opened this issue Dec 8, 2019 · 37 comments
Open

[epic] Remove GOPATH for go modules formula #47627

chenrui333 opened this issue Dec 8, 2019 · 37 comments

Comments

@chenrui333
Copy link
Member

@chenrui333 chenrui333 commented Dec 8, 2019

Historically, golang builds need to happen under the GOPATH, as more and more formula has moved to go-modules, we can deprecate the GOPATH usage.

@jonchang
Copy link
Member

@jonchang jonchang commented Dec 8, 2019

Looks like there are 291 formula that still use GOPATH.

  • acmetool
  • ahoy
  • akamai
  • algernon
  • aliyun-cli
  • alp
  • amazon-ecs-cli
  • annie
  • antibody
  • anycable-go
  • apache-brooklyn-cli
  • apm-server
  • aptly
  • armor
  • assh
  • atlantis
  • auditbeat
  • aurora
  • aws-es-proxy
  • aws-iam-authenticator
  • aws-okta
  • benthos
  • bettercap
  • bitrise
  • borg
  • buildkit
  • c14-cli
  • calicoctl
  • carina
  • cayley
  • certstrap
  • cf-tool
  • cfssl
  • chamber
  • charm
  • chronograf
  • cig
  • circleci
  • cli53
  • clipper
  • cointop
  • collector-sidecar
  • consul-backinator
  • consul-template
  • consul
  • container-diff
  • convox
  • corectl
  • cql
  • ctop
  • cwlogs
  • dashing
  • dcos-cli
  • dehydrated
  • deis
  • deisctl
  • dep
  • devd
  • devspace
  • direnv
  • dive
  • dlite
  • dnscontrol
  • dnscrypt-proxy
  • docker-credential-helper-ecr
  • docker-credential-helper
  • docker-gen
  • docker-ls
  • docker-machine-driver-hyperkit
  • docker-machine-driver-vmware
  • docker-machine-driver-vultr
  • docker-machine-parallels
  • docker-machine
  • docker-swarm
  • docker
  • docker2aci
  • dockerize
  • dockviz
  • dockward
  • doctl
  • drone-cli
  • dvm
  • elvish
  • emp
  • envconsul
  • etcd
  • exercism
  • faas-cli
  • fabio
  • filebeat
  • fleetctl
  • flint-checker
  • fluxctl
  • fn
  • forego
  • fork-cleaner
  • fortio
  • frpc
  • frps
  • frugal
  • fsql
  • gauge
  • gdm
  • gdrive
  • geoipupdate
  • ghr
  • git-appraise
  • git-sizer
  • git-town
  • github-markdown-toc
  • github-release
  • gitlab-runner
  • glide
  • glooctl
  • go-bindata
  • go-jira
  • go-md2man
  • go
  • go@1.10
  • go@1.11
  • go@1.12
  • go@1.9
  • goad
  • gobuster
  • gocryptfs
  • godep
  • gofabric8
  • gollum
  • gomplate
  • goose
  • gopass
  • gor
  • goreman
  • gost
  • gotags
  • govendor
  • gowsdl
  • gox
  • grafana
  • gron
  • grv
  • gx-go
  • gx
  • heartbeat
  • helm
  • helm@2
  • helmsman
  • hey
  • hivemind
  • hostess
  • hub
  • iamy
  • immortal
  • influxdb
  • infrakit
  • inlets
  • ipfs
  • iron-functions
  • ironcli
  • istioctl
  • jabba
  • jd
  • jfrog-cli-go
  • jid
  • jp
  • juju
  • jump
  • jvgrep
  • k3d
  • k6
  • kapacitor
  • karn
  • kedge
  • kompose
  • kops
  • kube-aws
  • kubeaudit
  • kubebuilder
  • kubeless
  • kubeprod
  • kubernetes-cli
  • kubernetes-service-catalog-client
  • kyma-cli
  • landscaper
  • lean-cli
  • leaps
  • lego
  • lf
  • linkerd
  • lxc
  • mage
  • mailhog
  • massren
  • megacmd
  • metricbeat
  • micro
  • minio-mc
  • minio
  • mmark
  • modd
  • mpdviz
  • nats-server
  • nats-streaming-server
  • node_exporter
  • nomad
  • nsq
  • oauth2_proxy
  • octant
  • opa
  • openshift-cli
  • operator-sdk
  • overmind
  • packer
  • path-extractor
  • peco
  • perkeep
  • pgweb
  • piknik
  • pilosa
  • prest
  • protoc-gen-go
  • prototool
  • pulumi
  • pumba
  • pup
  • qpm
  • rack
  • rancher-cli
  • rancher-compose
  • rke
  • s-search
  • scc
  • scw
  • serve
  • shellz
  • shfmt
  • ship
  • sift
  • skaffold
  • skopeo
  • slackcat
  • slacknimate
  • smimesign
  • snag
  • snap-telemetry
  • sonobuoy
  • spaceinvaders-go
  • srclib
  • ssh-vault
  • ssllabs-scan
  • step
  • stolon
  • stout
  • syncthing-inotify
  • syncthing
  • td
  • teleconsole
  • telegraf
  • teleport
  • termshare
  • terraform-docs
  • terraform-inventory
  • terraform-provisioner-ansible
  • terraform
  • terraform@0.11
  • terraformer
  • terragrunt
  • terrahelp
  • textql
  • the_platinum_searcher
  • tj
  • traefik
  • traefik@1
  • triangle
  • ultralist
  • uru
  • vault
  • vegeta
  • velero
  • vert
  • virgil
  • virustotal-cli
  • vultr
  • warp
  • websocketd
  • wego
  • wellington
  • wsk
  • wskdeploy
  • wu
  • yq

@alebcay alebcay mentioned this issue Dec 9, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 9, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 9, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 9, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 9, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 9, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 9, 2019
5 tasks
@alebcay
Copy link
Member

@alebcay alebcay commented Dec 9, 2019

While we're here - would it be worth standardizing some of the flags that we use for building Go formulae? Specifically, I would advocate for always including

  • -ldflags "-s -w", unless it breaks build
  • -trimpath: "remove all file system paths from the resulting executable. Instead of absolute file system paths, the recorded file names will begin with either "go" (for the standard library), or a module path@version (when using modules), or a plain import path (when using GOPATH)."

@jonchang
Copy link
Member

@jonchang jonchang commented Dec 9, 2019

It looks like Debian sets -trimpath but doesn't strip binaries with -s -w. Would it be useful to add something like std_go_args (like we have for CMake builds)?

@alebcay
Copy link
Member

@alebcay alebcay commented Dec 9, 2019

Would it be useful to add something like std_go_args (like we have for CMake builds)?

I think it would be useful. I've already seen some formulae floating around with stripped binaries, which is why I've brought this up. From my limited testing with the PRs above, there's a reduction of 15-20% in total formula size. I personally don't think it would be a bad idea to strip binaries, seeing as Go binaries are all statically linked.

@alebcay alebcay changed the title [epic] Remove GOAPTH for go modules formula [epic] Remove GOPATH for go modules formula Dec 9, 2019
@SMillerDev
Copy link
Member

@SMillerDev SMillerDev commented Dec 9, 2019

Maybe you want to wait @chenrui333 and do gopath at the same time as the go_std_args?

@chenrui333
Copy link
Member Author

@chenrui333 chenrui333 commented Dec 10, 2019

Would it be useful to add something like std_go_args (like we have for CMake builds)?

+1 for std_go_args idea.

We can definitely pipeline the work between std_go_args and gopath removal though.
After that we can refine our template for easy bootstrap golang formula.

@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
@alebcay alebcay mentioned this issue Dec 10, 2019
5 tasks
chenrui333 pushed a commit that referenced this issue Feb 22, 2021
This will allow this package to build with Go 1.16.

Upstream: shyiko/jabba#771
Epic: #47627
@roopakv
Copy link
Contributor

@roopakv roopakv commented Feb 22, 2021

All right! we are all done ( i think). We have PRs for all the tools listed in @carlocab's comment.

While we have filed issues with a LOT of the tools there I doubt that many of them will actually upgrade to go modules by the time go1.17 is out. Would the idea be to deprecate them or disable them or add a go1.16 formula when that time comes?

@Bo98
Copy link
Member

@Bo98 Bo98 commented Feb 22, 2021

Possibly both - we could deprecate as "unmaintained" if there is no response, but we'll let them depend on go@1.16 for that deprecation period.

I'm very likely going to start tests with 1.17 RC1 when that lands rather than the final version so that we're better prepared.

For 1.16: we just now need to double check a couple of the other failures but they should be easy to prove they are pre-existing or not and then we can rebase on master (with the bootstrap change we agreed on in #71370 (comment)).

@carlocab
Copy link
Member

@carlocab carlocab commented Feb 22, 2021

Thanks very much for all the help, @roopakv. There are still a handful of formulae that don't use GOPATH but nevertheless did failed with go1.16: #71289 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Homebrew TODO
  
Work In Progress
Linked pull requests

Successfully merging a pull request may close this issue.

None yet