generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: experimental Rust runtime (#1924)
This Rust runtime implementation needs a fair amount of work to be stable. Features: - Verb service and client. - Can answer verb call requests. - Can call out to verbs in other runtimes and process responses. - FTL can build and restart the runtime automatically. - Generates schema protos for verbs and args/return types recursively. Limitations: - Very limited functionality: verbs only, no generics. - No error handling (unwraps everywhere). - No scaffolding generation. - No external module code generation. - Only struct types referenced by verb arguments and returns in the same module will correctly work. - Hardcoded paths to crate dependencies in Cargo.toml
- Loading branch information
Showing
30 changed files
with
4,416 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package buildengine | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"github.com/TBD54566975/ftl/backend/schema" | ||
"github.com/TBD54566975/ftl/internal/exec" | ||
"github.com/TBD54566975/ftl/internal/log" | ||
) | ||
|
||
func buildRustModule(ctx context.Context, _ *schema.Schema, module Module) error { | ||
logger := log.FromContext(ctx) | ||
|
||
logger.Debugf("Using build command '%s'", module.Config.Build) | ||
err := exec.Command(ctx, log.Debug, module.Config.Dir+"/_ftl", "bash", "-c", module.Config.Build).RunBuffered(ctx) | ||
if err != nil { | ||
return fmt.Errorf("failed to build module %q: %w", module.Config.Module, err) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.