Closed hiBlunt closed 1 year ago
$ make
mkdir -p _output
go build -tags "sqlite_foreign_keys release" -ldflags="-linkmode 'external' -extldflags '-static' -s -w -X 'main.Version=2.4' -X 'main.GitHash=7ecbbff1'" -o _output/yarr src/main.go
# command-line-arguments
/home/nkanaev/.dev/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lm: No such file or directory
/usr/bin/ld: cannot find -lc: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [makefile:11: build_default] Error 2
on Fedora 38
I am not familiar with fedora and only tested this pr on debian11 and the image of golang:alpine. After search on google, maybe you can try to run sudo dnf install glibc-static libstdc++-static -y
before make.
Hmm.
I'd say the changes are disruptive to the building process. Is there a way to provide libc in the container itself rather than enforcing it in the project?
Yarr in the container does not lack libc, because both the compilation environment and the running environment are alpine. But the yarr binaries in realse are built using fedora and run on other distributions, including different kernels, different libc versions, so I recommend using static compilation to build the binaries.
But the yarr binaries in realse are built using fedora The release binaries are created by Github Actions (Ubuntu 22.04), but I get the idea.
Sorry, after some consideration I've decided to reject the idea. Reasons are:
If you're stuck using Debian, please consider either:
I'm happy to accept documentation changes and a new build instruction (say, make build_linux_static
), as long as it doesn't interfere with the current process.
Don't worry. Hopefully our conversation will help other users with the same problem
The impact isn’t limited to Debian 11, it also extends to all systems based on RHEL 8.
I value the simplicity of yarr, but it does necessitate some effort from me. Given that I need to update my systems now, if I’m going to invest time and energy into my RSS reader, I might as well use a containerized solution for the future.
I have modified values of CGO_ENABLE and GO_LDFLAGS to solve issue 155. now running
ldd yarr
shows it don`t have any dependencies.