ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.17k stars 157 forks source link

Bridge v3 Go modules downloaded to $HOME/go #338

Open vmivanov opened 1 year ago

vmivanov commented 1 year ago

When building Bridge v3, the process downloads Go module dependencies into the default Go path, often $HOME/go.

This is not optimal as it creates a seemingly "random" additional directory under the current user's Home. One then needs to remove it manually after compilation which is not "easily" done as Go, by default, makes the module cache read-only and either the permissions need to be adjusted before deletion or it needs to be deleted via sudo or root.

While it makes sense to keep/cache the downloaded dependencies, it should not be done under the default $GOPATH.

Explicitly declaring GOPATH, e.g. GOPATH=$(pwd)/go make build-nogui, correctly downloads the dependencies to go/, a new directory within the bridge local repo.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce

  1. Make sure there the directory returned by $ go env GOPATH is empty or doesn't exist
  2. Checkout any Bridge v3
  3. Run $ make build-nogui
  4. Go dependencies downloaded to $GOPATH as returned by step 1
  5. Run $ make clean
  6. Downloaded dependencies remain in $GOPATH as returned by step 1

Version Information

Bridge v3.0.12, but also observed in earlier v3 releases.

vmivanov commented 1 year ago

Six months later, with several releases and many fixes, this nuisance is still a thing. How? Guys, this is a trivial fix it would take a proactive developer less than a minute to resolve.