Dennis Dang
05/13/2021, 5:14 AMDennis Dang
05/13/2021, 5:15 AMFrank
Frank
Frank
Dennis Dang
05/13/2021, 2:47 PMDennis Dang
05/13/2021, 2:50 PMFrank
sst deploy
we need to build the Rust functions;
2. in sst start
we need to run the Rust functions on request;
3. in sst start
we need to watch for changes and rebuild the Rust functions quickly
I don’t know Rust, but if you could help me on #1, that’d be great. #2 and #3 should be fairly straight forward.
For #1, here’s the code for building the Lambda functions - https://github.com/serverless-stack/serverless-stack/blob/master/packages/resources/src/Function.ts#L215-L241
It’s pretty short. Python is built inside Docker; Node and Go are not. We just need to add another case here to handle Rust.
Let me know if you want to take a crack at it and submit a PR.Dennis Dang
05/13/2021, 6:52 PMFrank
rust1.x
or something, and you create the function like this:
new sst.Function(this, "MyRustFunction", {
srcPath: "path/to/Cargo.toml",
handler: "path/to/lambda.rs",
runtime: "rust1.x",
});
And internally we will use provided.al2
runtime to create the lambda function. What do you think?Dennis Dang
05/13/2021, 7:34 PMDennis Dang
05/13/2021, 7:35 PMmain.go
entry point for a lambda (package main). Does the Go builder support passing a handler with a different name. i.e. some_handler.go
with package main
. I ask because building the Rust lambda probably brings with it the same constraints. Can't nicely pick a fn export like Node can.Frank
src
, it assumes the file is src/main.go
. But u can specify a different file src/some_handler.go
with package main
.Frank
go build
commandDennis Dang
05/14/2021, 1:45 PMFrank