[oi-dev] Error building a zrepl package for OI

Peter Tribble peter.tribble at gmail.com
Fri Apr 15 18:16:02 UTC 2022


On Fri, Apr 15, 2022 at 6:53 PM Gary Mills <gary_mills at fastmail.fm> wrote:

> I'm attempting to build a "zrepl" package for OI.  Zrepl is a "go"
> application.  It it even possible to package go applications for OI?
>
> On build, I'm getting this error:
>
>     make[1]: Entering directory
>     '.../oi-userland-gh/components/sysutils/zrepl/build/amd64'
>     $GOPATH/go.mod exists but should not
>     ...
>     $GOPATH/go.mod exists but should not
>     GO111MODULE=on go build -mod=readonly  -ldflags \
>     "-X
> github.com/zrepl/zrepl/version.zreplVersion=oi-20200504-2370-gd402c2588" \
>     -o "artifacts/zrepl-illumos-"
>     $GOPATH/go.mod exists but should not
>     make[1]: *** [Makefile:228: zrepl-bin] Error 1
>     make[1]: Leaving directory
>     '.../oi-userland-gh/components/sysutils/zrepl/build/amd64'
>
> What causes this error, and how can I prevent it?
>

The environment variable GOPATH is set to the root of the zrepl source.
Any other value will work. If unset, then ~/go, but that's not always ideal.
The common pattern in oi-userland (see eg
components/sysutils/chezmoi/Makefile)
is

COMPONENT_BUILD_ENV += GOPATH="$(SOURCE_DIR)/gopath"
COMPONENT_INSTALL_ENV += GOPATH="$(SOURCE_DIR)/gopath"

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openindiana.org/pipermail/oi-dev/attachments/20220415/ea228fc5/attachment.html>


More information about the oi-dev mailing list