Commit 44faa493 authored by Kirill Smelkov's avatar Kirill Smelkov

neotest: Rework to use Go modules

GOPATH is going to go away in Go 1.17 and most of in-tree SlapOS things are
already built using modules - including upcoming wendelin.core 2 that also
builds/uses NEO/go. This way maintaining GOPATH-based approach becomes just
unneccesary burden (modulo development, where it is still needed sometime
unfortunately https://github.com/golang/go/issues/37755#issuecomment-771927771)
parent 9fdabc46
# Code generated by gowork-snapshot; DO NOT EDIT.
# list of go git repositories to fetch
[gowork.goinstall]
depends_gitfetch =
${go_crawshaw.io_sqlite:recipe}
${go_github.com_DataDog_czlib:recipe}
${go_github.com_cznic_strutil:recipe}
${go_github.com_davecgh_go-spew:recipe}
${go_github.com_fsnotify_fsnotify:recipe}
${go_github.com_golang_glog:recipe}
${go_github.com_gwenn_gosqlite:recipe}
${go_github.com_gwenn_yacr:recipe}
${go_github.com_kisielk_og-rek:recipe}
${go_github.com_kylelemons_godebug:recipe}
${go_github.com_philhofer_fwd:recipe}
${go_github.com_pkg_errors:recipe}
${go_github.com_pkg_profile:recipe}
${go_github.com_pmezard_go-difflib:recipe}
${go_github.com_shamaton_msgpack:recipe}
${go_github.com_soheilhy_cmux:recipe}
${go_github.com_someonegg_gocontainer:recipe}
${go_github.com_someonegg_gox:recipe}
${go_github.com_stretchr_testify:recipe}
${go_github.com_tinylib_msgp:recipe}
${go_github.com_ttacon_chalk:recipe}
${go_golang.org_x_crypto:recipe}
${go_golang.org_x_mod:recipe}
${go_golang.org_x_net:recipe}
${go_golang.org_x_perf:recipe}
${go_golang.org_x_sync:recipe}
${go_golang.org_x_sys:recipe}
${go_golang.org_x_text:recipe}
${go_golang.org_x_tools:recipe}
${go_golang.org_x_xerrors:recipe}
${go_gopkg.in_yaml.v3:recipe}
${go_lab.nexedi.com_kirr_go123:recipe}
${go_lab.nexedi.com_kirr_neo:recipe}
[go_crawshaw.io_sqlite]
<= go-git-package
go.importpath = crawshaw.io/sqlite
repository = https://github.com/crawshaw/sqlite
revision = v0.3.2-7-gc582b9de4f
[go_github.com_DataDog_czlib]
<= go-git-package
go.importpath = github.com/DataDog/czlib
repository = https://github.com/DataDog/czlib
revision = 4bc9a24e37
[go_github.com_cznic_strutil]
<= go-git-package
go.importpath = github.com/cznic/strutil
repository = https://github.com/cznic/strutil
revision = 529a34b1c1
[go_github.com_davecgh_go-spew]
<= go-git-package
go.importpath = github.com/davecgh/go-spew
repository = https://github.com/davecgh/go-spew
revision = v1.1.1-1-gd8f796af33
[go_github.com_fsnotify_fsnotify]
<= go-git-package
go.importpath = github.com/fsnotify/fsnotify
repository = https://github.com/fsnotify/fsnotify
revision = 7f4cf4dd2b
[go_github.com_golang_glog]
<= go-git-package
go.importpath = github.com/golang/glog
repository = https://github.com/golang/glog
revision = 23def4e6c1
[go_github.com_gwenn_gosqlite]
<= go-git-package
go.importpath = github.com/gwenn/gosqlite
repository = https://github.com/gwenn/gosqlite
revision = 24878be1a2
[go_github.com_gwenn_yacr]
<= go-git-package
go.importpath = github.com/gwenn/yacr
repository = https://github.com/gwenn/yacr
revision = bbe82c1f4d
[go_github.com_kisielk_og-rek]
<= go-git-package
go.importpath = github.com/kisielk/og-rek
repository = https://github.com/kisielk/og-rek
revision = 24bb08c22e
[go_github.com_kylelemons_godebug]
<= go-git-package
go.importpath = github.com/kylelemons/godebug
repository = https://github.com/kylelemons/godebug
revision = fa7b53cdfc
[go_github.com_philhofer_fwd]
<= go-git-package
go.importpath = github.com/philhofer/fwd
repository = https://github.com/philhofer/fwd
revision = 414ae1bb9e
[go_github.com_pkg_errors]
<= go-git-package
go.importpath = github.com/pkg/errors
repository = https://github.com/pkg/errors
revision = v0.8.1-31-g614d223910
[go_github.com_pkg_profile]
<= go-git-package
go.importpath = github.com/pkg/profile
repository = https://github.com/pkg/profile
revision = v1.5.0-1-g3704c8d233
[go_github.com_pmezard_go-difflib]
<= go-git-package
go.importpath = github.com/pmezard/go-difflib
repository = https://github.com/pmezard/go-difflib
revision = v1.0.0-4-g5d4384ee4f
[go_github.com_shamaton_msgpack]
<= go-git-package
go.importpath = github.com/shamaton/msgpack
repository = https://github.com/shamaton/msgpack
revision = 29a4ba0bb9
[go_github.com_soheilhy_cmux]
<= go-git-package
go.importpath = github.com/soheilhy/cmux
repository = https://github.com/soheilhy/cmux
revision = 8a8ea3c539
[go_github.com_someonegg_gocontainer]
<= go-git-package
go.importpath = github.com/someonegg/gocontainer
repository = https://github.com/someonegg/gocontainer
revision = 24fb283ab9
[go_github.com_someonegg_gox]
<= go-git-package
go.importpath = github.com/someonegg/gox
repository = https://github.com/someonegg/gox
revision = c9bfdf8eb4
[go_github.com_stretchr_testify]
<= go-git-package
go.importpath = github.com/stretchr/testify
repository = https://github.com/stretchr/testify
revision = v1.2.2-210-g54d05a4e18
[go_github.com_tinylib_msgp]
<= go-git-package
go.importpath = github.com/tinylib/msgp
repository = https://github.com/tinylib/msgp
revision = 87c1ec45d5
[go_github.com_ttacon_chalk]
<= go-git-package
go.importpath = github.com/ttacon/chalk
repository = https://github.com/ttacon/chalk
revision = v0.1-3-g22c06c80ed
[go_golang.org_x_crypto]
<= go-git-package
go.importpath = golang.org/x/crypto
repository = https://go.googlesource.com/crypto
revision = 5c72a88397
[go_golang.org_x_mod]
<= go-git-package
go.importpath = golang.org/x/mod
repository = https://go.googlesource.com/mod
revision = ce943fd024
[go_golang.org_x_net]
<= go-git-package
go.importpath = golang.org/x/net
repository = https://go.googlesource.com/net
revision = 62affa334b
[go_golang.org_x_perf]
<= go-git-package
go.importpath = golang.org/x/perf
repository = https://go.googlesource.com/perf
revision = d949658356
[go_golang.org_x_sync]
<= go-git-package
go.importpath = golang.org/x/sync
repository = https://go.googlesource.com/sync
revision = 6e8e738ad2
[go_golang.org_x_sys]
<= go-git-package
go.importpath = golang.org/x/sys
repository = https://go.googlesource.com/sys
revision = aee5d888a8
[go_golang.org_x_text]
<= go-git-package
go.importpath = golang.org/x/text
repository = https://go.googlesource.com/text
revision = v0.3.3-2-ga8b4671254
[go_golang.org_x_tools]
<= go-git-package
go.importpath = golang.org/x/tools
repository = https://go.googlesource.com/tools
revision = ba800b16d8
[go_golang.org_x_xerrors]
<= go-git-package
go.importpath = golang.org/x/xerrors
repository = https://go.googlesource.com/xerrors
revision = 5ec99f83af
[go_gopkg.in_yaml.v3]
<= go-git-package
go.importpath = gopkg.in/yaml.v3
repository = https://gopkg.in/yaml.v3
revision = v2.1.1-97-geeeca48fe7
[go_lab.nexedi.com_kirr_go123]
<= go-git-package
go.importpath = lab.nexedi.com/kirr/go123
repository = https://lab.nexedi.com/kirr/go123.git
revision = c8d9907ef7
[go_lab.nexedi.com_kirr_neo]
<= go-git-package
go.importpath = lab.nexedi.com/kirr/neo
repository = https://lab.nexedi.com/kirr/neo.git
revision = v1.12-2791-gf3effa6c53
......@@ -2,12 +2,7 @@
[buildout]
extends = software.cfg
[go_lab.nexedi.com_kirr_go123]
branch = master
revision=
[go_lab.nexedi.com_kirr_neo]
[neo]
branch = t
revision=
......
......@@ -8,7 +8,6 @@ extends =
../../stack/slapos.cfg
../neoppod/software-common.cfg
../../component/golang/buildout.cfg
gowork.cfg
../../component/sqlite3/buildout.cfg
../../component/zlib/buildout.cfg
../../component/wendelin.core/buildout.cfg
......@@ -49,12 +48,23 @@ parts =
instance.cfg
# go packages to install (+ automatically their dependencies)
[neo]
<= go-git-package
go.importpath = lab.nexedi.com/kirr/neo
repository = https://lab.nexedi.com/kirr/neo.git
revision = v1.12-3107-gf278d611
[goperf]
<= go-git-package
go.importpath = golang.org/x/perf
repository = https://lab.nexedi.com/kirr/go.perf.git
revision = e8bebf9314da
# go programs to install
[gowork]
install =
lab.nexedi.com/kirr/neo/go/...
github.com/pkg/profile
golang.org/x/perf/cmd/benchstat
${neo:location}/go:./...
${goperf:location}:./cmd/benchstat
cpkgpath =
${sqlite3:location}/lib/pkgconfig
......@@ -62,7 +72,7 @@ cpkgpath =
# dev-install neo from go checkout
[neoppod-develop]
setup = ${go_lab.nexedi.com_kirr_neo:location}
setup = ${neo:location}
# neotest-env.sh + neotest wrapper
......@@ -99,7 +109,7 @@ template = inline:
[tnxdtest]
recipe = plone.recipe.command
stop-on-error = yes
command = ln -s -t $${directory:t} ${gowork:src}/lab.nexedi.com/kirr/neo/go/neo/t/.nxdtest
command = ln -s -t $${directory:t} ${neo:location}/go/neo/t/.nxdtest
......
  • @jerome, @alain.takoudjou, FYI, if I'm not mistaken, now gitlab remains the only software-release that uses Go in GOPATH mode. Please don't hesitate to contact if you need advice on how to convert gitlab as well. Writing just in case - there is no pressure with that. Also for the reference - I've just added module support to git-backup in kirr/git-backup@3c804105.

    Kirill

  • @alain.takoudjou, @jerome, for the reference, contrary to what they have been saying, support for GOPATH is still present in Go 1.22 and they say that the core of it will stay supported forever.

  • This way there are still two options: either continue to use GOPATH based approach to build git-backup, or to switch to module-based build. I think the first option is easier even if module-based builds are more preferrable in the long term.

  • Thank you @kirr but if I want to switch to latest git-backup I will need to use module-based it seems.

    for now I'm trying to understand how I can convert this: https://lab.nexedi.com/nexedi/slapos/-/blob/master/software/gitlab/software.cfg#L225

    There is this error to build latest git-backup :

    # pkg-config --cflags --static -- /srv/slapgrid/slappart74/srv/runner/software/60c2ddef4a92979269ccdf7dc6fb1a39/go.work/pkg/mod/github.com/libgit2/git2go/v31@v31.4.12/static-build/install/lib/pkgconfig/libgit2.pc
    2024-04-10 17:52:48 slapos[2906094] INFO Failed to open '/srv/slapgrid/slappart74/srv/runner/software/60c2ddef4a92979269ccdf7dc6fb1a39/go.work/pkg/mod/github.com/libgit2/git2go/v31@v31.4.12/static-build/install/lib/pkgconfig/libgit2.pc': No such file or directory

    While libgit2.pc is installed here: /srv/slapgrid/slappart74/srv/runner/software/60c2ddef4a92979269ccdf7dc6fb1a39/go.work/src/github.com/libgit2/git2go/static-build/install/lib/pkgconfig/

    Is there possible to build latest git-backup without module-based ? Last time I tried, there was error with some dependecies (golang.org/x/crypto)

  • Hello @alain.takoudjou. First of all I'm sorry it took me long to come back to you.

    It is still possible to do the build in GOPATH mode. For this one needs to clone git2go the usual way, and to manually add v31 -> . symlink inside its tree, so that new git2go imports with version ("github.com/libgit2/git2go/v31") could be resolved correctly in GOPATH mode as well.

    Then on needs to go to git2go tree and follow https://github.com/libgit2/git2go?tab=readme-ov-file#main-branch-or-vendored-static-linking to make libgit2+git2go build.

    Then inside git-backup, go build -tags static works ok.

    I've just checked myself that it can be done with Go 1.22 .

    Hope it helps a bit,
    Kirill

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment