On Wed, Apr 26, 2023 at 03:09:34PM +0200, Theo Buehler wrote: > We need some Go stuff as listed in ${WRKSRC}/go.mod to run tests. > This duplicates a bit of bsd.go.mk, but I'd rather not mess with > that. If there's a better way, please let me know.
Much simpler than reaching for MODULES += lang/go, but see inline. New diff at the end with all the comments, feel free to commit that right away or yours as is, then I'll mop up afterwards. The new diff works with PORTS_PRIVSEP=Yes and MAKE_JOBS=12, I see "All tests passed!" after a minute, then thoes X/Y/Z numbers for who know how long... The XXX comment can go now. > > Works for me. > > Index: Makefile > =================================================================== > RCS file: /cvs/ports/security/boringssl/Makefile,v > retrieving revision 1.1.1.1 > diff -u -p -r1.1.1.1 Makefile > --- Makefile 25 Apr 2023 19:16:30 -0000 1.1.1.1 > +++ Makefile 26 Apr 2023 13:06:42 -0000 > @@ -7,6 +7,20 @@ GH_PROJECT = boringssl > GH_COMMIT = de2d610a341f5a4b8c222425890537cb84c91400 > DISTNAME = boringssl-20230425 > > +MASTER_SITES0 = https://proxy.golang.org/ > + > +DISTFILES += ${GH_DISTFILE} This needs EXTRACT_ONLY to be set and you can *NOT* use GH_DISTFILE... > + > +BORING_GOMOD += golang.org/x/crypto v0.6.0 > +BORING_GOMOD += golang.org/x/net v0.7.0 > +BORING_GOMOD += golang.org/x/sys v0.5.0 > +BORING_GOMOD += golang.org/x/term v0.5.0 Do you want tab(s) after =? > + > +.for _modpath _modver in ${BORING_GOMOD} > +DISTFILES += go_modules/{}${_modpath}/@v/${_modver}.zip:0 > +DISTFILES += go_modules/{}${_modpath}/@v/${_modver}.mod:0 > +.endfor > + > CATEGORIES = security > > MAINTAINER = Bob Beck <b...@openbsd.org>, \ > @@ -27,5 +41,9 @@ CONFIGURE_ARGS += -DCMAKE_INSTALL_PREFIX > BUILD_DEPENDS = lang/go > > PORTHOME = ${WRKSRC} > + > +do-test: > + env HOME=${WRKSRC} GOPROXY=file://${DISTDIR}/go_modules \ > + ninja -C ${WRKBUILD} run_tests PORTHOME is set above and should be used; the regular goop does that (ALL_TEST_ENV contains MAKE_ENV contains PORTHOME): $ make -V MODCMAKE_TEST_TARGET cd ${WRKBUILD} && exec ${SETENV} ${ALL_TEST_ENV} ctest ${_MAKE_VERBOSE} -j ${MAKE_JOBS} So that could be: +TEST_ENV = GO_PROXY=file://${DISTDIR}/go_modules + +do-test: + ${SETENV} ${ALL_TEST_ENV} ninja -C ${WRKBUILD} -j ${MAKE_JOBS} run_tests > > .include <bsd.port.mk> > Index: distinfo > =================================================================== > RCS file: /cvs/ports/security/boringssl/distinfo,v > retrieving revision 1.1.1.1 > diff -u -p -r1.1.1.1 distinfo > --- distinfo 25 Apr 2023 19:16:30 -0000 1.1.1.1 > +++ distinfo 26 Apr 2023 13:01:36 -0000 > @@ -1,2 +1,18 @@ > SHA256 (boringssl-20230425-de2d610a.tar.gz) = > 2Bu5eOgBxqNUcTDevIpOjPGgJ/GBatu1ZtbVDTCDppQ= > +SHA256 (go_modules/golang.org/x/crypto/@v/v0.6.0.mod) = > G2poNFWjuIK2rFPyJ1KWDoe9kQQKlNbyxcthJh4jidg= > +SHA256 (go_modules/golang.org/x/crypto/@v/v0.6.0.zip) = > gcqIrzcc/1qERCuijiPY9CzME4fI/hUuVeh7pK+eGsc= > +SHA256 (go_modules/golang.org/x/net/@v/v0.7.0.mod) = > Qex26iFy8+4wMeOPmlNZOaWE1rs170gIVP3LjCAmcBs= > +SHA256 (go_modules/golang.org/x/net/@v/v0.7.0.zip) = > BgVSBkUmqQrJsL3OK6CrNFkt7MlCjRRBw8lyL4U80pA= > +SHA256 (go_modules/golang.org/x/sys/@v/v0.5.0.mod) = > 8DMzMJb+GY8xUd7tk/LeunTlC7/nc5E0BFvDt85KUCQ= > +SHA256 (go_modules/golang.org/x/sys/@v/v0.5.0.zip) = > z0czasG/Z1+m1t1axTmbAUPFE0BMRJ+j8zgKWBI8eQg= > +SHA256 (go_modules/golang.org/x/term/@v/v0.5.0.mod) = > DW9YIoqtwaZSjmdV2gGFFlZuOuXFIB963hdz9W+o2TQ= > +SHA256 (go_modules/golang.org/x/term/@v/v0.5.0.zip) = > fYnEmrQTBpUBKKD0t8Z/uOLS9jfs6OAk5s840XozGTs= > SIZE (boringssl-20230425-de2d610a.tar.gz) = 32281549 > +SIZE (go_modules/golang.org/x/crypto/@v/v0.6.0.mod) = 171 > +SIZE (go_modules/golang.org/x/crypto/@v/v0.6.0.zip) = 1761232 > +SIZE (go_modules/golang.org/x/net/@v/v0.7.0.mod) = 123 > +SIZE (go_modules/golang.org/x/net/@v/v0.7.0.zip) = 1559354 > +SIZE (go_modules/golang.org/x/sys/@v/v0.5.0.mod) = 33 > +SIZE (go_modules/golang.org/x/sys/@v/v0.5.0.zip) = 1886681 > +SIZE (go_modules/golang.org/x/term/@v/v0.5.0.mod) = 67 > +SIZE (go_modules/golang.org/x/term/@v/v0.5.0.zip) = 19924 > Index: Makefile =================================================================== RCS file: /cvs/ports/security/boringssl/Makefile,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Makefile --- Makefile 25 Apr 2023 19:16:30 -0000 1.1.1.1 +++ Makefile 26 Apr 2023 14:26:07 -0000 @@ -7,6 +7,23 @@ GH_PROJECT = boringssl GH_COMMIT = de2d610a341f5a4b8c222425890537cb84c91400 DISTNAME = boringssl-20230425 +MASTER_SITES0 = https://proxy.golang.org/ + +DISTFILES += ${GH_DISTFILE} +# can't use GH_DISTFILE because EXTRACT_ONLY does not understand DISTFILES {} +EXTRACT_ONLY = ${DISTNAME}-${GH_COMMIT:C/(........).*/\1/}${EXTRACT_SUFX} + + +BORING_GOMOD += golang.org/x/crypto v0.6.0 +BORING_GOMOD += golang.org/x/net v0.7.0 +BORING_GOMOD += golang.org/x/sys v0.5.0 +BORING_GOMOD += golang.org/x/term v0.5.0 + +.for _modpath _modver in ${BORING_GOMOD} +DISTFILES += go_modules/{}${_modpath}/@v/${_modver}.zip:0 +DISTFILES += go_modules/{}${_modpath}/@v/${_modver}.mod:0 +.endfor + CATEGORIES = security MAINTAINER = Bob Beck <b...@openbsd.org>, \ @@ -23,9 +40,12 @@ COMPILER = base-clang ports-gcc MODULES = devel/cmake CONFIGURE_ARGS += -DCMAKE_INSTALL_PREFIX=${PREFIX}/eboringssl -# XXX picked up for tests, needs more love BUILD_DEPENDS = lang/go PORTHOME = ${WRKSRC} +TEST_ENV = GOPROXY=file://${DISTDIR}/go_modules + +do-test: + ${SETENV} ${ALL_TEST_ENV} ninja -C ${WRKBUILD} -j ${MAKE_JOBS} run_tests .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/security/boringssl/distinfo,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 distinfo --- distinfo 25 Apr 2023 19:16:30 -0000 1.1.1.1 +++ distinfo 26 Apr 2023 14:16:47 -0000 @@ -1,2 +1,18 @@ SHA256 (boringssl-20230425-de2d610a.tar.gz) = 2Bu5eOgBxqNUcTDevIpOjPGgJ/GBatu1ZtbVDTCDppQ= +SHA256 (go_modules/golang.org/x/crypto/@v/v0.6.0.mod) = G2poNFWjuIK2rFPyJ1KWDoe9kQQKlNbyxcthJh4jidg= +SHA256 (go_modules/golang.org/x/crypto/@v/v0.6.0.zip) = gcqIrzcc/1qERCuijiPY9CzME4fI/hUuVeh7pK+eGsc= +SHA256 (go_modules/golang.org/x/net/@v/v0.7.0.mod) = Qex26iFy8+4wMeOPmlNZOaWE1rs170gIVP3LjCAmcBs= +SHA256 (go_modules/golang.org/x/net/@v/v0.7.0.zip) = BgVSBkUmqQrJsL3OK6CrNFkt7MlCjRRBw8lyL4U80pA= +SHA256 (go_modules/golang.org/x/sys/@v/v0.5.0.mod) = 8DMzMJb+GY8xUd7tk/LeunTlC7/nc5E0BFvDt85KUCQ= +SHA256 (go_modules/golang.org/x/sys/@v/v0.5.0.zip) = z0czasG/Z1+m1t1axTmbAUPFE0BMRJ+j8zgKWBI8eQg= +SHA256 (go_modules/golang.org/x/term/@v/v0.5.0.mod) = DW9YIoqtwaZSjmdV2gGFFlZuOuXFIB963hdz9W+o2TQ= +SHA256 (go_modules/golang.org/x/term/@v/v0.5.0.zip) = fYnEmrQTBpUBKKD0t8Z/uOLS9jfs6OAk5s840XozGTs= SIZE (boringssl-20230425-de2d610a.tar.gz) = 32281549 +SIZE (go_modules/golang.org/x/crypto/@v/v0.6.0.mod) = 171 +SIZE (go_modules/golang.org/x/crypto/@v/v0.6.0.zip) = 1761232 +SIZE (go_modules/golang.org/x/net/@v/v0.7.0.mod) = 123 +SIZE (go_modules/golang.org/x/net/@v/v0.7.0.zip) = 1559354 +SIZE (go_modules/golang.org/x/sys/@v/v0.5.0.mod) = 33 +SIZE (go_modules/golang.org/x/sys/@v/v0.5.0.zip) = 1886681 +SIZE (go_modules/golang.org/x/term/@v/v0.5.0.mod) = 67 +SIZE (go_modules/golang.org/x/term/@v/v0.5.0.zip) = 19924