go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
7.58k stars 994 forks source link

Installation from source using `go install` does not work #2002

Closed praneetloke closed 11 months ago

praneetloke commented 11 months ago

Welcome

What did you expect to see?

Installing from source go install github.com/go-acme/lego/v4/cmd/lego@latest should install the lego binary successfully.

What did you see instead?

This is on a GitHub Actions hosted runner using their latest Ubuntu image. I have a scheduled workflow that runs every night and as part of that I install Lego. Two days ago, it started failing with the following error during installation:

go: github.com/go-acme/lego/v4/cmd/lego@latest (in github.com/go-acme/lego/v4@v4.14.0):
    The go.mod file for the module providing named packages contains one or
    more exclude directives. It must not contain directives that would cause
    it to be interpreted differently than if it were the main module.
Error: Process completed with exit code 1.

This could be related to the upgrade to Go 1.20 from #1993.

How do you use lego?

Binary

Reproduction steps

  1. Install Go 1.20+
  2. Run go install github.com/go-acme/lego/v4/cmd/lego@latest

Version of lego

N/A

Logs

```console go: github.com/go-acme/lego/v4/cmd/lego@latest (in github.com/go-acme/lego/v4@v4.14.0): The go.mod file for the module providing named packages contains one or more exclude directives. It must not contain directives that would cause it to be interpreted differently than if it were the main module. Error: Process completed with exit code 1. ```

Go environment (if applicable)

```console $ go version && go env go1.21.0 linux/amd64 GO111MODULE='' GOARCH='amd64' GOBIN='' GOCACHE='/home/runner/.cache/go-build' GOENV='/home/runner/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/runner/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/runner/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org/,direct' GOROOT='/opt/hostedtoolcache/go/1.21.0/x64' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/opt/hostedtoolcache/go/1.21.0/x64/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.21.0' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' CGO_ENABLED='1' GOMOD='/dev/null' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build868993813=/tmp/go-build -gno-record-gcc-switches' ```
ldez commented 11 months ago

Hello,

it's not related to go1.20 but to this PR #1985

praneetloke commented 11 months ago

@ldez ah yes, indeed. I overlooked the fact that #1985 was released in v4.14.0 and not in a previous release.

ldez commented 11 months ago

I think I will have to revert this PR because Go doesn't offer a way to bypass that, I'm sad :cry: