Skip to content

Commit d3ff827

Browse files
Merge pull request #121 from gitpod-io/mads-dont-check-ephmeral-pkgs-in-transitive-deps
Go: Ignore ephemeral packages when checking transitive dependencies
2 parents 4caf42a + 17b7e83 commit d3ff827

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pkg/leeway/build.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,11 +1121,25 @@ func (p *Package) buildGo(buildctx *buildContext, wd, result string) (res *packa
11211121
}...)
11221122
}
11231123

1124+
// We don't check if ephemeral packages in the transitive dependency tree have been built,
1125+
// as they may be too far down the tree to trigger a build (e.g. their parent may be built already).
1126+
// Hence, we need to ensure all direct dependencies on ephemeral packages have been built.
1127+
for _, deppkg := range p.GetDependencies() {
1128+
_, ok := buildctx.LocalCache.Location(deppkg)
1129+
if deppkg.Ephemeral && !ok {
1130+
return nil, PkgNotBuiltErr{deppkg}
1131+
}
1132+
}
1133+
11241134
transdep := p.GetTransitiveDependencies()
11251135
if len(transdep) > 0 {
11261136
commands = append(commands, []string{"mkdir", "_deps"})
11271137

11281138
for _, dep := range transdep {
1139+
if dep.Ephemeral {
1140+
continue
1141+
}
1142+
11291143
builtpkg, ok := buildctx.LocalCache.Location(dep)
11301144
if !ok {
11311145
return nil, PkgNotBuiltErr{dep}

0 commit comments

Comments
 (0)