The image's static relink linked glibc's getaddrinfo (Go's cgo DNS resolver) and dlopen (SQLite extension loading). A static binary still needs glibc's shared libraries for both at run time, and the Alpine runtime has none. Closes #525.
Makefile: a GO_TAGS variable, empty by default, which the build target passes to go build as -tags, beside GO_LDFLAGS. A plain make build builds as before.
Dockerfile: the static relink sets GO_TAGS=netgo,osusergo,sqlite_omit_load_extension. The comment above it now says why, and no longer claims the earlier make build already verified compilation: with different tags the relink compiles different files.
README.md: the builder stage description names the tags.
internal/versionscript: the Makefile and Dockerfile content tests now expect -tags '$(GO_TAGS)' and the new relink line.
What the diff does not show:
The test and lint stages build without these tags, so the tagged binary is compiled only by the image's relink.
In the image, GODEBUG=netdns=cgo no longer selects the cgo resolver: Go logs that it ignores the setting and uses its own.
The relink is one long line because the Dockerfile test matches it as a single string.
Model: opus-5-5
The image's static relink linked glibc's `getaddrinfo` (Go's cgo DNS resolver) and `dlopen` (SQLite extension loading). A static binary still needs glibc's shared libraries for both at run time, and the Alpine runtime has none. Closes https://git.eeqj.de/sneak/webhooker/issues/525.
- `Makefile`: a `GO_TAGS` variable, empty by default, which the build target passes to `go build` as `-tags`, beside `GO_LDFLAGS`. A plain `make build` builds as before.
- `Dockerfile`: the static relink sets `GO_TAGS=netgo,osusergo,sqlite_omit_load_extension`. The comment above it now says why, and no longer claims the earlier `make build` already verified compilation: with different tags the relink compiles different files.
- `README.md`: the builder stage description names the tags.
- `internal/versionscript`: the Makefile and Dockerfile content tests now expect `-tags '$(GO_TAGS)'` and the new relink line.
What the diff does not show:
- The test and lint stages build without these tags, so the tagged binary is compiled only by the image's relink.
- In the image, `GODEBUG=netdns=cgo` no longer selects the cgo resolver: Go logs that it ignores the setting and uses its own.
- The relink is one long line because the Dockerfile test matches it as a single string.
Model: opus-5-5
The image's static relink linked glibc's getaddrinfo (from Go's cgo DNS
resolver) and dlopen (from SQLite extension loading). A static binary
still needs glibc's shared libraries at run time for both, and the
Alpine runtime has none. The relink now passes the standard build tags
netgo, osusergo and sqlite_omit_load_extension through a GO_TAGS
variable, which the Makefile's build target hands to go build as -tags
next to GO_LDFLAGS, so the version stamp is composed as before.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The image's static relink linked glibc's
getaddrinfo(Go's cgo DNS resolver) anddlopen(SQLite extension loading). A static binary still needs glibc's shared libraries for both at run time, and the Alpine runtime has none. Closes #525.Makefile: aGO_TAGSvariable, empty by default, which the build target passes togo buildas-tags, besideGO_LDFLAGS. A plainmake buildbuilds as before.Dockerfile: the static relink setsGO_TAGS=netgo,osusergo,sqlite_omit_load_extension. The comment above it now says why, and no longer claims the earliermake buildalready verified compilation: with different tags the relink compiles different files.README.md: the builder stage description names the tags.internal/versionscript: the Makefile and Dockerfile content tests now expect-tags '$(GO_TAGS)'and the new relink line.What the diff does not show:
GODEBUG=netdns=cgono longer selects the cgo resolver: Go logs that it ignores the setting and uses its own.Model: opus-5-5
Review passed.
Model: opus-5-5