dmgk / modules2tuple

Generate GH_TUPLE/GL_TUPLE from modules.txt
BSD 2-Clause "Simplified" License
15 stars 2 forks source link

Try prepending path to a tag before trying as-is #19

Closed forquare closed 2 years ago

forquare commented 2 years ago

If a repo (like https://github.com/aws/aws-sdk-go-v2) has too many tags, doing a lookup of all tags results in a 502.

In a number of cases I found that the path is actually part of the tag, so we can try that to see if we can find the tag and reduce the number of times we might try getting all tags.

forquare commented 2 years ago

I've been using this method for a few www/gohugo releases and have found it to work well. I haven't tried this on any other Go based ports, so it hasn't been truly battle-tested!

forquare commented 2 years ago

Looks like an issue with the M2T_GITHUB secret is causing CI to fail 😞

dmgk commented 2 years ago

Hi,

Thanks for the PR. Unfortunately, it breaks tests e.g.

--- FAIL: TestGithubLookupTag (0.84s)
    github_test.go:46: expected tag v1.3.4, got /v1.3.4 (example 0)
    github_test.go:46: expected tag v1.1.7, got /v1.1.7 (example 3)

also there are some e2e test failures later that I haven't looked at yet.

forquare commented 2 years ago

🤦 I am very sorry! I completely forgot to run the tests!. I'll look myself and I'll try to find some time to sort them out

dmgk commented 2 years ago

Hi Ben,

I looked at what modules2tuple generates for www/gohugo and how it is different from the actual GH_TUPLE, and it seems that there's a fair amount of manual work involved with each gohugo update.

Why not just switch to the GO_MODULE? Here's my take on it, it's shorter and needs only DISTVERSION bump for the update.

www/gohugo/Makefile ``` PORTNAME= hugo DISTVERSIONPREFIX= v DISTVERSION= 0.101.0 CATEGORIES= www PKGNAMEPREFIX= go DIST_SUBDIR= ${PKGNAMEPREFIX}${PORTNAME} MAINTAINER= ben@lavery-griffiths.com COMMENT= Fast and Flexible Static Site Generator built with love in GoLang LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= cpe go:modules CPE_VENDOR= gohugo GO_MODULE= github.com/gohugoio/hugo GO_BUILDFLAGS= -ldflags="\ -s -w \ -X github.com/gohugoio/hugo/common/hugo.vendorInfo=freebsd" \ ${BUILD_TAGS} CONFLICTS_INSTALL= hugo # bin/hugo OPTIONS_DEFINE= MANPAGES EXTENDED OPTIONS_DEFAULT= MANPAGES EXTENDED OPTIONS_SUB= yes EXTENDED_DESC= Enable SCSS/SASS support EXTENDED_LIB_DEPENDS= libsass.so:textproc/libsass \ libwebp.so:graphics/webp EXTENDED_VARS= CGO_ENABLED=1 \ CGO_CFLAGS="-DLIBWEBP_NO_SRC -DUSE_LIBSASS_SRC" \ CGO_LDFLAGS="-lm -lwebp -lsass" \ BUILD_TAGS="-tags extended" EXTENDED_VARS_OFF= CGO_ENABLED=0 PORTMANS= hugo-completion-bash.1 hugo-completion-fish.1 hugo-completion-powershell.1 \ hugo-completion-zsh.1 hugo-completion.1 hugo-config-mounts.1 \ hugo-config.1 hugo-convert-toJSON.1 hugo-convert-toTOML.1 hugo-convert-toYAML.1 \ hugo-convert.1 hugo-deploy.1 hugo-env.1 hugo-gen-chromastyles.1 hugo-gen-doc.1 \ hugo-gen-man.1 hugo-gen.1 hugo-import-jekyll.1 hugo-import.1 hugo-list-all.1 \ hugo-list-drafts.1 hugo-list-expired.1 hugo-list-future.1 hugo-list.1 \ hugo-mod-clean.1 hugo-mod-get.1 hugo-mod-graph.1 hugo-mod-init.1 \ hugo-mod-npm-pack.1 hugo-mod-npm.1 hugo-mod-tidy.1 hugo-mod-vendor.1 \ hugo-mod-verify.1 hugo-mod.1 hugo-new-site.1 hugo-new-theme.1 hugo-new.1 \ hugo-server.1 hugo-version.1 hugo.1 # needed to get DISTINFO_FILE in scope for the shell command evaluation by go.mk .include do-build-MANPAGES-on: @cd ${GO_WRKSRC} && ${GO_WRKDIR_BIN}/${PORTNAME} gen man --dir man/man1/ do-install-MANPAGES-on: .for i in ${PORTMANS} ${INSTALL_MAN} ${WRKSRC}/man/man1/$i ${STAGEDIR}/${PREFIX}/man/man1 .endfor .include ```

Edit: vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go also needs hardcoded cgo flags patched out, I can submit the complete diff to Bugzilla if you'd like.

forquare commented 2 years ago

Hey Dmitri,

I had tried using GO_MODULE but hit upon the libsass issue and wasn't sure how to solve it. If you would be able to submit a diff to Bugzilla that would be awesome - it will certainly reduce the effort of bumping this port!

dmgk commented 2 years ago

Sure, will do that shortly.

forquare commented 2 years ago

Closing this PR as we've solved my particular issue by moving to GO_MODULE.