go-acme / lego

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

Cannot build package #946

Closed vkhramtsov closed 5 years ago

vkhramtsov commented 5 years ago

Hello,

I'm trying to install lego via command go get -u github.com/go-acme/lego/cmd/lego but after waiting some time I see message like:

package github.com/sacloud/libsacloud/api: cannot find package "github.com/sacloud/libsacloud/api" in any of:
        /usr/lib/go-1.12/src/github.com/sacloud/libsacloud/api (from $GOROOT)
        .../go/src/github.com/sacloud/libsacloud/api (from $GOPATH)

It looks like new version of lates version of sacloud/libsacloud (https://github.com/sacloud/libsacloud/tree/master) does not have api directory. It looks like lego require version 1.26.1 of this library, but unfortunately it downloads master version .

Please assist.

Thank you in advance

ldez commented 5 years ago

hello,

lego uses go modules then you need to enable the support:

export GO111MODULE=on

I recommend to use our binaries:

vkhramtsov commented 5 years ago

@ldez I'm not so familiar with go, but it looks like manual about installing go from sources does not work, I checked it here https://go-acme.github.io/lego/installation/#from-sources. Would you be so kind to fix it? Thank you

vkhramtsov commented 5 years ago

Also I would like to reopen this issue, because I don't want to create new one

ldez commented 5 years ago

I fixed the problem https://github.com/go-acme/lego/pull/945/commits/1cc8ec138017e47a4bde8576263bacb1c90ee024

fidonet commented 2 years ago

This is not fixed and "use our binaries" is not an acceptable get out

The SakuraCloud module is at v2 but is also deprecated, lego is using v1 which is no longer accessible on github

The only real fix it seems would be to remove support for the deprecated SakuraCloud DNS module so that these modules will once again build for users who need to build their own modules

build github.com/go-acme/lego/v4/cmd/lego: cannot load github.com/sacloud/libsacloud/api: module github.com/sacloud/libsacloud@latest found (v2.32.2+incompatible), but does not contain package github.com/sacloud/libsacloud/api

image

ldez commented 2 years ago

"use our binaries" is an acceptable answer if the user doesn't know enough Go.

The only real fix it seems would be to remove support for the deprecated SakuraCloud DNS module

No, it's not "the only real fix".

The Go proxies are here to keep dependencies.

https://pkg.go.dev/github.com/sacloud/libsacloud

https://proxy.golang.org/

GOPROXY=https://proxy.golang.org,direct

I'm not your friend, so I recommend changing your tone.

fidonet commented 2 years ago

Thanks for the prompt response. (and apologies if you read my tone as hostile, that wasn't the intention)

If the intention is to continue to support deprecated libraries, then that's fine .. I don't see this very often with other projects .. but kudos for trying.

I think the actual issue is the docs which are still referencing Go v1.15 when since Go v1.17 "go get" is deprecated and yet the docs at https://go-acme.github.io/lego/installation/ still state this is the way to install / build from the sources ...

https://go.dev/doc/go-get-install-deprecation

This is where anyone new to Lego will end up when they first search as this seems to be Google's top-rated page. Not everyone is a seasoned veteran with Go, however, a lot of people are used to having to build from scratch (plus the links to the binaries are nowhere near as obvious as the build instructions to a first time visitor) :(

Anyway, hopefully anyone Googling that error will now have the benefit of this additional documentation / dialog and realise that they need to either use Go v1.15-1.16 following the current docs, or if they're using 1.17+ the should use "go install" and ensure they have the environment variables set (checked with "go env")

Lastly, let me just say thank you for writing and releasing this library ... it is an amazing piece of work! - Thank You!