Skip to content

Commit

Permalink
fix: do not attempt to compile subpackages (#1522)
Browse files Browse the repository at this point in the history
For a module that has some subpackages, we can end up getting weird
build errors.
If we ignore all subpackages when extracting a modules schema, this
fixes all those issues.
  • Loading branch information
matt2e authored May 17, 2024
1 parent 1300bf2 commit ce6abd2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go-runtime/compile/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ func ExtractModuleSchema(dir string) (optional.Option[ParseResult], error) {
if !ok {
return optional.None[ParseResult](), fmt.Errorf("package %q is not in the ftl namespace", pkg.PkgPath)
}
if len(strings.Split(pkg.PkgPath, "/")) > 2 {
// skip subpackages of a module
continue
}
module.Name = moduleName
if len(pkg.Errors) > 0 {
for _, perr := range pkg.Errors {
Expand Down

0 comments on commit ce6abd2

Please sign in to comment.