The purpose of this flag is to not populate the vendor directory as it causes some problem with go 1.18 and some ports (sysutils/zrepl and net/syncthing for example)
Ideally we should move the go modules (for example /usr/ports/distfiles/go/sysutils_zrepl) somewhere in WRKDIR so that we can patch them if needed (à la cargo-crates)
Details
exp-run
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Vendoring dependencies is needed so we're able to patch them locally. Patching directly in $GOCACHE (e.g. /usr/ports/distfiles/go/sysutils_zrepl) won't work because go verifies integrity of cached dependencies and will refuse to build if it detects any changes (that's why we don't checksum deps ourselves and delegate their integrity checking to go).
Starting with go1.16, go additionally checks (in modules mode) that vendored dependencies are actually correspond to the dependencies listed in go.mod. We had a few problems with ports shipping outdated "vendor" before, but it is not an issue anymore because upstreams are now forced to vendor correct versions.
If there are any issues with dependencies vendored by the upstream (old versions, incompatibilities etc), the best course of action would be to just remove packaged "vendor" and patch/re-vendor at our side.