go-acme / lego

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

build fails on machines with 1 GB RAM #1505

Closed krasin closed 3 years ago

krasin commented 3 years ago

Welcome

What did you expect to see?

I'm building go-acme/lego from sources on a Digital Ocean instance with 1 GB RAM, which is their entry offering. I am using Go1.17.2 (the latest at the time of filing this issue)

I have checked out dfa0a6da68c36dd3ac65e2bdf75fe7711e03303b (aka v.4.5.3) and started to build the lego binary:

$ git clone https://github.com/go-acme/lego
$ make build

After waiting a bit, the build failed with an OOM issue while it tries to compile github.com/softlayer/softlayer-go@v1.0.3/services:

$ make build
BIN_OUTPUT: dist/lego
rm -rf dist/ builds/ cover.out
Version: dfa0a6da68c36dd3ac65e2bdf75fe7711e03303b
go build -v -trimpath -ldflags '-X "main.version=dfa0a6da68c36dd3ac65e2bdf75fe7711e03303b"' -o  dist/lego ./cmd/lego/
github.com/softlayer/softlayer-go/services
go build github.com/softlayer/softlayer-go/services: /home/krasin/go/pkg/tool/linux_amd64/compile: signal: killed
make: *** [Makefile:23: build] Error 1

This is very consistently reproducible whenever I retry.

What did you see instead?

Build failing due to OOM issue (1 GB is not enough to compile github.com/softlayer/softlayer-go@v1.0.3/services)

How do you use lego?

Other

Reproduction steps

  1. Log into a Ubuntu 20.04 machine with 1 GB RAM
  2. Checkout and build lego:
$ git clone https://github.com/go-acme/lego
$ make build

Version of lego

dfa0a6da68c36dd3ac65e2bdf75fe7711e03303b (aka v.4.5.3) -- sources

Logs

$ make build
BIN_OUTPUT: dist/lego
rm -rf dist/ builds/ cover.out
Version: dfa0a6da68c36dd3ac65e2bdf75fe7711e03303b
go build -v -trimpath -ldflags '-X "main.version=dfa0a6da68c36dd3ac65e2bdf75fe7711e03303b"' -o  dist/lego ./cmd/lego/
github.com/softlayer/softlayer-go/services
go build github.com/softlayer/softlayer-go/services: /home/krasin/go/pkg/tool/linux_amd64/compile: signal: killed
make: *** [Makefile:23: build] Error 1

Go environment (if applicable)

go version go1.17.2 linux/amd64

ldez commented 3 years ago

Hello,

Building binaries can be CPU, disk and memory-intensive, it's expected and we cannot change that.

I recommend using pre-build binary instead of trying to build the binary by yourself.

We provide the binaries (and their checksums)for all kinds of arch: https://github.com/go-acme/lego/releases/tag/v4.5.3

https://go-acme.github.io/lego/installation/