dmgk/modules2tuple

using `-offline` ends up with "flag not defined"

zachfi opened this issue · 5 comments

using `-offline` ends up with "flag not defined"

I'm trying to use this method to create a pacakge with lots of go dependencies, and the go module fetching during a build phase fails due to missing module which should be present. I figure -offline would be what I'm after, but it doesn't seem to work in the latest ports version. 1.6.0.

dmgk commented

Looks like you are on quarterly branch, the version in latest is 1.8.1
Anyway, -offline doesn't do what you described, it just disables network access (calling Gitlab API) in modules2tuple.

I figured out the issue was with git trying to run go mod each time, which makes web calls during the build, which isn't available during my port build phase. I did end up building the latest version here and trying -offline to learn that it didn't do what I wanted. Thanks for the support.

dmgk commented

@xaque208 If you haven't seen it yet, there's a Go port example that uses modules in Porter's Handbook, hope this helps.

Thank you, I did see that but I was a little confused when I read it. The example I needed was to skip the module handling entirely, which my solution was to modify build step.

	@( cd ${WRKSRC}; \
		${SETENV} ${MAKE_ENV} GOFLAGS="-mod=vendor" go build . ; \
		)```