Skip to content

Commit

Permalink
Fix architecture subrepos
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatskaari committed Nov 15, 2023
1 parent 21ad656 commit 026b74a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/core/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func (pkg *Package) TargetOrDie(name string) *BuildTarget {
return t
}


// AddTarget adds a new target to this package with the given name.
// It doesn't check for duplicates.
func (pkg *Package) AddTarget(target *BuildTarget) {
Expand Down
3 changes: 1 addition & 2 deletions src/core/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,7 @@ func (state *BuildState) Initialise(subrepo *Subrepo) (err error) {
// handled for us already in plz.go
if state.CurrentSubrepo != "" {
state.RepoConfig = &Configuration{}
err = readSubrepoConfig(state.RepoConfig, subrepo)
if err != nil {
if err := readSubrepoConfig(state.RepoConfig, subrepo); err != nil {
return
}
if err = validateSubrepoNameAndPluginConfig(state.Config, state.RepoConfig, subrepo); err != nil {
Expand Down
7 changes: 6 additions & 1 deletion src/core/subrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ type Subrepo struct {
}

func NewSubrepo(state *BuildState, name, root string, target *BuildTarget, arch cli.Arch, isCrosscompile bool) *Subrepo {
subrepoFS := os.DirFS(root)
if root == "" {
// This happens for architecture subrepos, which should use the same FS as the host repo
subrepoFS = fs.HostFS
}
return &Subrepo{
Name: name,
Root: root,
FS: os.DirFS(root),
FS: subrepoFS,
State: state,
Target: target,
Arch: arch,
Expand Down

0 comments on commit 026b74a

Please sign in to comment.