-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some kind of cycle is causing a build failure #924
Comments
I don't think there's a solution that FTL can provide in the near term. What's happening is actually quite obvious in hindsight, but the errors were really obtuse:
This cycle is triggered by the That said, this would really only be a bandaid in certain circumstances I think. If you had data types or verbs in different modules that referenced each other in a cycle, this would still break. I think the real issue here is that the reported errors are useless. We should fix those. |
Previously: ``` failed to build module: failed to extract module schema: ftl/foo: /Users/alec/dev/example/backend/modules/foo/foo.go:14:2: could not import ftl/bar (invalid package name: "") ``` Now: ``` failed to build module: failed to extract module schema: /Users/alec/dev/example/backend/modules/foo/foo.go:2:1: /Users/alec/dev/example/backend/modules/foo/foo.go:88:1: /Users/alec/dev/example/backend/modules/foo/foo.go:88:138: /Users/alec/dev/example/backend/modules/foo/foo.go:106:2: /Users/alec/dev/example/backend/modules/foo/foo.go:106:23: call first argument must be a function but is an unresolved reference to bar.BarRequest ``` Fixes #924 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
It's strange, because there are no cycles in the FTL data type system itself, only in "calls" which should not impact the Go compiler, but still somehow the Go build will get into a loop like this:
Even stranger is that if we comment out the verbs that trigger it, let everything rebuild, then uncomment them, things seem to work in a flaky kind of way.
The text was updated successfully, but these errors were encountered: