fast-nail-55400
10/25/2021, 3:37 PMfast-nail-55400
10/25/2021, 3:38 PMgo: <http://github.com/hashicorp/consul/sdk@v0.3.0|github.com/hashicorp/consul/sdk@v0.3.0> (replaced by ../sdk): reading ../sdk/go.mod: open /private/var/folders/md/0q71p41n0rbgwhnc8npjjzg00000gn/T/sdk/go.mod: no such file or directory
fast-nail-55400
10/25/2021, 3:38 PMfast-nail-55400
10/25/2021, 3:39 PMfast-nail-55400
10/25/2021, 3:40 PMdirectives only apply in the main module’sreplace
file and are ignored in other modules. See Minimal version selection for details.go.mod
fast-nail-55400
10/25/2021, 3:44 PMgo
since the command references the packages using ./…
. https://github.com/pantsbuild/pants/blob/a57985b22160ab717adcadf0ab07995f870e2c34/src/python/pants/backend/go/util_rules/third_party_pkg.py#L2[…]281fast-nail-55400
10/25/2021, 3:44 PMgo list
thinks it should apply replace directives in in that instancefast-nail-55400
10/25/2021, 3:45 PMhundreds-father-404
10/25/2021, 4:18 PMhundreds-father-404
10/25/2021, 6:10 PMhundreds-father-404
10/25/2021, 6:43 PMgo list -json
working by having the chroot include <http://github.com/hashicorp/consul/sdk@v0.3.0|github.com/hashicorp/consul/sdk@v0.3.0>
and renaming the folder to sdk
w/o the version...
That was really important for performance that running go list
on a downloaded module uses a chroot with only that module, not sibling modulesfast-nail-55400
10/25/2021, 6:46 PMhundreds-father-404
10/25/2021, 6:47 PMgo.mod
for replace directives and pull in the module in that case? Seems finickyhundreds-father-404
10/25/2021, 7:01 PMgo mod edit -json
to find this:
"Replace": [
{
"Old": {
"Path": "<http://github.com/hashicorp/consul/sdk|github.com/hashicorp/consul/sdk>"
},
"New": {
"Path": "../sdk"
}
}
],
We know the import path is <http://github.com/hashicorp/consul/api|github.com/hashicorp/consul/api>
, so we calculate it's trying to load <http://github.com/hashicorp/consul/sdk|github.com/hashicorp/consul/sdk>
when you apply the ../sdk
. We see if there is that downloaded module. If so, the Digest
for consul/api
has to also include consul/sdk
hundreds-father-404
10/25/2021, 8:27 PMfast-nail-55400
10/25/2021, 8:29 PMfast-nail-55400
10/25/2021, 8:32 PMhundreds-father-404
10/25/2021, 8:34 PMwitty-crayon-22786
10/27/2021, 6:49 PMwitty-crayon-22786
10/27/2021, 6:49 PMhundreds-father-404
10/27/2021, 6:55 PMhundreds-father-404
10/27/2021, 6:56 PMwitty-crayon-22786
10/27/2021, 6:56 PM