<div dir="ltr"><div dir="ltr">On Fri, Apr 15, 2022 at 6:53 PM Gary Mills <<a href="mailto:gary_mills@fastmail.fm">gary_mills@fastmail.fm</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm attempting to build a "zrepl" package for OI. Zrepl is a "go"<br>
application. It it even possible to package go applications for OI?<br>
<br>
On build, I'm getting this error:<br>
<br>
make[1]: Entering directory<br>
'.../oi-userland-gh/components/sysutils/zrepl/build/amd64'<br>
$GOPATH/go.mod exists but should not<br>
...<br>
$GOPATH/go.mod exists but should not<br>
GO111MODULE=on go build -mod=readonly -ldflags \<br>
"-X <a href="http://github.com/zrepl/zrepl/version.zreplVersion=oi-20200504-2370-gd402c2588" rel="noreferrer" target="_blank">github.com/zrepl/zrepl/version.zreplVersion=oi-20200504-2370-gd402c2588</a>" \<br>
-o "artifacts/zrepl-illumos-"<br>
$GOPATH/go.mod exists but should not<br>
make[1]: *** [Makefile:228: zrepl-bin] Error 1<br>
make[1]: Leaving directory<br>
'.../oi-userland-gh/components/sysutils/zrepl/build/amd64'<br>
<br>
What causes this error, and how can I prevent it?<br></blockquote><div><br></div><div>The environment variable GOPATH is set to the root of the zrepl source.<br></div><div>Any other value will work. If unset, then ~/go, but that's not always ideal.<br>The common pattern in oi-userland (see eg components/sysutils/chezmoi/Makefile)<br></div><div>is<br><br>COMPONENT_BUILD_ENV += GOPATH="$(SOURCE_DIR)/gopath"<br>COMPONENT_INSTALL_ENV += GOPATH="$(SOURCE_DIR)/gopath"<br></div><div> </div></div>-- <br><div dir="ltr" class="gmail_signature">-Peter Tribble<br><a href="http://www.petertribble.co.uk/" target="_blank">http://www.petertribble.co.uk/</a> - <a href="http://ptribble.blogspot.com/" target="_blank">http://ptribble.blogspot.com/</a></div></div>