zopencommunity / wharf

A container registry
Apache License 2.0
6 stars 4 forks source link

internal/goexperiment: default tags break wharf #7

Closed MacMalainey closed 1 year ago

MacMalainey commented 1 year ago

The GOROOT package internal/goexperiment contains multiple build tags relating to different experiments. These experiments can be enabled by setting the environment variable GOEXPERIMENT.

However as of Go 1.20 some experiments are on by default and therefore will automatically get compiled. Wharf has built in checks to catch when its own parsing of build tags don't match up with what go list outputs. And when the check finds a mismatched file, Wharf will panic (see #5). The way the experiments are handled breaks Wharf.

MacMalainey commented 1 year ago

Potential methods of handling this:

  1. Don't parse tags when building GOROOT packages. This is probably the best solution currently, however it means that we might miss other new tagging situations that we are unaware of. It might be good to implement a test that runs through most of the compiler with wharf to verify tags are built as expected if this is implemented
  2. Skip over only the internal/goexperiments package.
  3. Copy the automatic config from the internal/goexperiments package. This is doable however might not be the most maintainable / might break across future builds
MacMalainey commented 1 year ago

Fixed in #18