-
-
Notifications
You must be signed in to change notification settings - Fork 83
Description
I've been using xgo
for a while now to build cross-platform binaries for my application. Currently, I'm on techknowlogick/xgo:go-1.19.x
.
Starting today, builds would start failing with the following error message:
> [compiler 10/12] RUN chmod +x ./compile.sh && ./compile.sh && rm ./compile.sh:
#77 0.388 Cross compiling github.com/offen/offen/server/cmd/offen...
#77 0.431 Go modules are enabled but go.mod was not found in the source folder.
#77 0.431 2022/11/24 10:03:14 Failed to cross compile package: exit status 10.
The command from compile.sh
looks like this:
xgo \
--targets=$TARGETS \
--tags 'osusergo netgo static_build sqlite_omit_load_extension' \
--ldflags="-linkmode external -extldflags '$LDFLAGS' -s -w -X github.com/offen/offen/server/config.Revision=$GIT_REVISION" \
github.com/offen/offen/server/cmd/offen
When this error is raised, there is a go.mod
file in github.com/offen/offen/server/go.mod
.
I assume this behavior was introduced in the recent go-1.19.3
release as downgrading to go-1.19.2
makes the build pass again.
Am I doing something wrong when building my binaries or does go-1.19.3
contain a regression somehow?
This is how assets are copied into building image:
FROM techknowlogick/xgo:go-1.19.x as compiler
ARG rev
ENV GIT_REVISION=$rev
ARG targets
ENV TARGETS=$targets
COPY ./server /go/src/github.com/offen/offen/server
ENV GOPATH /go
WORKDIR /build
COPY ./build/compile.sh .
RUN chmod +x ./compile.sh && ./compile.sh && rm ./compile.sh
Metadata
Metadata
Assignees
Labels
No labels