Hi all,
I hit an issue where my port is pulling wrong sources for a dependency and I am not sure at which level the bug is. It is either in the build system, or something wrong with how I specify the GH_TUPLES in the Makefile, or something else entirely, but I don't seem to figure it out right now.
A bit of background:
I made the net-p2p/hostd port. I initially made it the "easy" way, but that did not work because the easy way pulls modules from some proxy site (pkg.go.dev or something similar) which is not updated often enough. The hostd devs recommend to build from github anyway. So in order to get the latest release sources, I switched to using the "full" process using GH_TUPLES.
This seemed to work fine for the currently checked in version of the port, except that ports-mgmt/modules2tuple has a bug where it does not parse correctly github tags of the form such as "hostd/v2.1.0", in this case it produces a GH_TUPLES line like this
SiaFoundation:web:v0.61.0:siafoundation_web_1/vendor/go.sia.tech/web/hostd
instead of
SiaFoundation:web:hostd/v0.61.0:siafoundation_web_1/vendor/go.sia.tech/web/hostd
so I fixed it manually in the Makefile, and that works for the current port.
Now, there is a new release and I updated the port accordingly, see my patch file here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286691
However I noticed that it pulls and builds the wrong version of go.sia.tech/web/hostd.
hostd is a daemon, which has a web UI, that web UI is some javascript and other files, which are in the go.sia.tech/web/hostd module. All the UI files and everything is part of the static hostd executable.
First I verified that the issue is with the port build only, not the application itself. If I do a standalone build of the application, not within ports, everything is fine and it builds with the proper files and modules version and hostd UI is correct.
I verified the version pulled by the FreeBSD ports system is incorrect because :
- when connecting to hostd, the UI has wrong files and tries to connect to deprecated http endpoints. Discussion with the devs of hostd confirmed the UI appeared to use old version of the UI JS files.
- when doing "make extract" on my port, sources for all dependencies are fetched as tarballs from github, extracted and I end up with a directory tree like this:
with all dependencies's source code in their own directory.
Well, if I now compare the contents of work/web-hostd-v0.61.0/ with the contents of the github repo tagged hostd/v0.61.0
( can be seen here: https://github.com/SiaFoundation/web/tree/hostd/v0.61.0/hostd )
the contents do not match at all. The sources that the port pulled are NOT the correct version and are effectively very old. BTW, to makes things clear: tag hostd/v0.61.0 is correct and what we want, but not what the sources fetched actually are.
I made sure to delete all distfiles, delete work/, etc made sure my environment is clean (I build and test all this in a jail created with appJail BTW), I made the port fetch and extract sources several times and it always pulls some old version from github.
So, what am I doing wrong here ? am I specifying the GH_TUPLES incorrectly ? Is there some bug in the port build system that fetches wrong versions ? Is github giving incorrect tarballs ?
Kind of at a loss right now on what next to try, to fix this. I mean it should just pull the right tagged version but it does not.
If anyone could try updating their port tree from my bug report and building hostd, at least I would know if it's reproducible and not just some issue on my end.
Any help and hints, advice, very much appreciated.
Cheers
I hit an issue where my port is pulling wrong sources for a dependency and I am not sure at which level the bug is. It is either in the build system, or something wrong with how I specify the GH_TUPLES in the Makefile, or something else entirely, but I don't seem to figure it out right now.
A bit of background:
I made the net-p2p/hostd port. I initially made it the "easy" way, but that did not work because the easy way pulls modules from some proxy site (pkg.go.dev or something similar) which is not updated often enough. The hostd devs recommend to build from github anyway. So in order to get the latest release sources, I switched to using the "full" process using GH_TUPLES.
This seemed to work fine for the currently checked in version of the port, except that ports-mgmt/modules2tuple has a bug where it does not parse correctly github tags of the form such as "hostd/v2.1.0", in this case it produces a GH_TUPLES line like this
SiaFoundation:web:v0.61.0:siafoundation_web_1/vendor/go.sia.tech/web/hostd
instead of
SiaFoundation:web:hostd/v0.61.0:siafoundation_web_1/vendor/go.sia.tech/web/hostd
so I fixed it manually in the Makefile, and that works for the current port.
Now, there is a new release and I updated the port accordingly, see my patch file here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286691
However I noticed that it pulls and builds the wrong version of go.sia.tech/web/hostd.
hostd is a daemon, which has a web UI, that web UI is some javascript and other files, which are in the go.sia.tech/web/hostd module. All the UI files and everything is part of the static hostd executable.
First I verified that the issue is with the port build only, not the application itself. If I do a standalone build of the application, not within ports, everything is fine and it builds with the proper files and modules version and hostd UI is correct.
I verified the version pulled by the FreeBSD ports system is incorrect because :
- when connecting to hostd, the UI has wrong files and tries to connect to deprecated http endpoints. Discussion with the devs of hostd confirmed the UI appeared to use old version of the UI JS files.
- when doing "make extract" on my port, sources for all dependencies are fetched as tarballs from github, extracted and I end up with a directory tree like this:
Code:
/usr/ports/net-p2p/hostd $ ls work/
aws-sdk-go-1.55.7 go-jmespath-0.4.0 mod-0.24.0 time-0.11.0
bbolt-1.4.0 go-json-0.10.5 multierr-1.11.0 tools-0.32.0
bin go-querystring-1.1.0 mux-1.4.0 upnp-0.3.0
cloudflare-go-0.115.0 go-sqlite3-1.14.28 net-0.39.0 users-groups-deinstall.sh
core-0.12.0 golang-lru-2.0.7 pprof-407c9e7a662f users-groups-install.sh
coreutils-0.13.2 goleak-1.3.0 qpack-0.5.1 web-5611d44a533e
crypto-0.37.0 hostd quic-go-0.51.0 web-hostd-v0.61.0
decimal-1.4.0 hostd-2.1.0 slim-sprig-52ccab3ef572 webtransport-go-4ac2c9250e66
flagg-1.1.1 hostd.conf stage yaml-2.4.0
frand-1.5.1 hostd.yml sync-0.13.0 yaml-3.0.1
ginkgo-2.12.0 httprouter-1.3.0 sys-0.32.0 zap-1.27.0
go jape-0.13.1 term-0.31.0
go-internal-1.12.0 mock-0.5.0 text-0.24.0
Well, if I now compare the contents of work/web-hostd-v0.61.0/ with the contents of the github repo tagged hostd/v0.61.0
( can be seen here: https://github.com/SiaFoundation/web/tree/hostd/v0.61.0/hostd )
the contents do not match at all. The sources that the port pulled are NOT the correct version and are effectively very old. BTW, to makes things clear: tag hostd/v0.61.0 is correct and what we want, but not what the sources fetched actually are.
I made sure to delete all distfiles, delete work/, etc made sure my environment is clean (I build and test all this in a jail created with appJail BTW), I made the port fetch and extract sources several times and it always pulls some old version from github.
So, what am I doing wrong here ? am I specifying the GH_TUPLES incorrectly ? Is there some bug in the port build system that fetches wrong versions ? Is github giving incorrect tarballs ?
Kind of at a loss right now on what next to try, to fix this. I mean it should just pull the right tagged version but it does not.
If anyone could try updating their port tree from my bug report and building hostd, at least I would know if it's reproducible and not just some issue on my end.
Any help and hints, advice, very much appreciated.
Cheers
Last edited: