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

deprecate using GOPRIVATE in favor of GOGARBLE #427

Merged
merged 1 commit into from
Dec 4, 2021

Conversation

mvdan
Copy link
Member

@mvdan mvdan commented Dec 3, 2021

(see commit message)

@mvdan mvdan requested review from lu4p and capnspacehook December 3, 2021 16:16
Piggybacking off of GOPRIVATE is great for a number of reasons:

* People tend to obfuscate private code, whose package paths will
  generally be in GOPRIVATE already

* Its meaning and syntax are well understood

* It allows all the flexibility we need without adding our own env var
  or config option

However, using GOPRIVATE directly has one main drawback.
It's fairly common to also want to obfuscate public dependencies,
to make the code in private packages even harder to follow.
However, using "GOPRIVATE=*" will result in two main downsides:

* GONOPROXY defaults to GOPRIVATE, so the proxy would be entirely disabled.
  Downloading modules, such as when adding or updating dependencies,
  or when the local cache is cold, can be less reliable.

* GONOSUMDB defaults to GOPRIVATE, so the sumdb would be entirely disabled.
  Adding entries to go.sum, such as when adding or updating dependencies,
  can be less secure.

We will continue to consume GOPRIVATE as a fallback,
but we now expect users to set GOGARBLE instead.
The new logic is documented in the README.

While here, rewrite some uses of "private" with "to obfuscate",
to make the code easier to follow and harder to misunderstand.

Fixes burrowers#276.
@lu4p
Copy link
Member

lu4p commented Dec 3, 2021

I think while at it we should also change the default to obfuscate everything instead of only the current module.

@mvdan
Copy link
Member Author

mvdan commented Dec 3, 2021

Hmm. I'd say it's too early for that - bugs like #410 are still relatively common.

I think a requirement for that is to first implement #240, to have a very wide corpus of Go code that we know we can obfuscate at all times.

I'd also prefer to do incremental steps. This is an incremental step to decouple "what packages to obfuscate" from "what packages are private". Swapping the default to be "obfuscate as many packages as possible" can be another incremental step in the future.

@lu4p lu4p merged commit fceb19f into burrowers:master Dec 4, 2021
@mvdan mvdan deleted the gogarble branch December 5, 2021 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants