Skip to content

Commit 82c397c

Browse files
committed
cmd/gomobile: always use abolute paths to replace in go.mod
A replative path in go.mod works only in the directory of the go.mod. When creating go.mod for gobind, copying relative paths did not work since go.mod is in a different temporary directory. This CL fixes the issue to use Dir, which is an absolute path to the module, instead of Path. Updates golang/go#27234 Change-Id: Ib009ec508aa3ce3d092af14f921a57192feaac61 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/215421 Run-TryBot: Hajime Hoshi <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent 23a0503 commit 82c397c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/gomobile/bind.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func getModuleVersions(targetOS string, targetArch string, src string) (*modfile
263263
if mod != nil {
264264
switch {
265265
case mod.Replace != nil:
266-
f.AddReplace(mod.Path, mod.Version, mod.Replace.Path, mod.Replace.Version)
266+
f.AddReplace(mod.Path, mod.Version, mod.Replace.Dir, mod.Replace.Version)
267267
case mod.Version == "":
268268
// When the version part is empty, the module is local and mod.Dir represents the location.
269269
f.AddReplace(mod.Path, "", mod.Dir, "")

0 commit comments

Comments
 (0)