diff --git a/VERSION b/VERSION index 337a71806c..61d609d284 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.4.0-beta.5 +17.4.0-beta.6 diff --git a/src/core/subrepo.go b/src/core/subrepo.go index a4a16a264b..30d474b0b2 100644 --- a/src/core/subrepo.go +++ b/src/core/subrepo.go @@ -49,10 +49,15 @@ func (s *Subrepo) FS() iofs.FS { // Must be an architecture subrepo return fs.HostFS } - if s.Target == nil || s.Target.Local || s.State.RemoteClient == nil { - return os.DirFS(s.Root) + if s.IsRemoteSubrepo() { + return s.State.RemoteClient.SubrepoFS(s.Target, s.Root) } - return s.State.RemoteClient.SubrepoFS(s.Target, s.Root) + return os.DirFS(s.Root) +} + +// IsRemoteSubrepo returns true when the subrepo sources are remote i.e. not downloaded to plz-out +func (s *Subrepo) IsRemoteSubrepo() bool { + return s.Root != "" && s.Target != nil && !s.Target.Local && s.State.RemoteClient != nil } // SubrepoForArch creates a new subrepo for the given architecture. diff --git a/src/fs/glob.go b/src/fs/glob.go index 4c98ee345a..073e29cc43 100644 --- a/src/fs/glob.go +++ b/src/fs/glob.go @@ -72,7 +72,7 @@ func Glob(fs iofs.FS, buildFileNames []string, rootPath string, includes, exclud // it isn't safe for use in concurrent goroutines. type Globber struct { buildFileNames []string - fs iofs.ReadDirFS + fs iofs.FS walkedDirs map[string]walkedDir } @@ -90,13 +90,9 @@ func Match(glob, path string) (bool, error) { // NewGlobber creates a new Globber. You should call this rather than creating one directly (or use Glob() if you don't care). func NewGlobber(fs iofs.FS, buildFileNames []string) *Globber { - rdfs, ok := fs.(iofs.ReadDirFS) - if !ok { - log.Fatalf("NewGlobber must be constructed with a ReadDirFS") - } return &Globber{ buildFileNames: buildFileNames, - fs: rdfs, + fs: fs, walkedDirs: map[string]walkedDir{}, } } diff --git a/src/remote/action.go b/src/remote/action.go index 9894e7c52e..5b30d94188 100644 --- a/src/remote/action.go +++ b/src/remote/action.go @@ -258,7 +258,7 @@ func (c *Client) uploadInputDir(ch chan<- *uploadinfo.Entry, target *core.BuildT } continue } - if i, ok := input.(core.SubrepoFileLabel); ok && !target.Local { + if i, ok := input.(core.SubrepoFileLabel); ok && target.Subrepo.IsRemoteSubrepo() { for _, p := range i.Paths(c.state.Graph) { subrepoPath, err := filepath.Rel(target.Subrepo.PackageRoot, p) if err != nil {