Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eebf24a

Browse files
committed
Apply FindOnly mode only to the upstream syscall/js package.
We do want to load it fully from the VFS, since we completely reimplement the package.
1 parent 8d451d4 commit eebf24a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build/context.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ func (sc simpleCtx) applyPackageTweaks(importPath string, mode build.ImportMode)
165165
bctx.GOARCH = build.Default.GOARCH
166166
bctx.InstallSuffix += build.Default.GOARCH
167167
case "syscall/js":
168-
// There are no buildable files in this package, but we need to use files in the virtual directory.
169-
mode |= build.FindOnly
168+
if !sc.isVirtual {
169+
// There are no buildable files in this package upstream, but we need to use files in the virtual directory.
170+
mode |= build.FindOnly
171+
}
170172
case "crypto/x509", "os/user":
171173
// These stdlib packages have cgo and non-cgo versions (via build tags); we want the latter.
172174
bctx.CgoEnabled = false

0 commit comments

Comments
 (0)