Skip to content
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

Deprecate provider.runtime: rust #105

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const { mkdirSync, writeFileSync, readFileSync } = require("fs");

const DEFAULT_DOCKER_TAG = "latest";
const DEFAULT_DOCKER_IMAGE = "softprops/lambda-rust";
const RUST_RUNTIME = "rust";
const RUST_RUNTIME = ["rust", "provided.al2"];
const LEGACY_RUST_RUNTIME = "rust";
const BASE_RUNTIME = "provided.al2";
const NO_OUTPUT_CAPTURE = { stdio: ["ignore", process.stdout, process.stderr] };
const MUSL_PLATFORMS = ["darwin", "win32", "linux"];
Expand Down Expand Up @@ -271,10 +272,13 @@ class RustPlugin {
this.functions().forEach((funcName) => {
const func = service.getFunction(funcName);
const runtime = func.runtime || service.provider.runtime;
if (runtime != RUST_RUNTIME) {
if (!(RUST_RUNTIME.includes(runtime) && (this.custom.rust || func.rust))) {
// skip functions which don't apply to rust
return;
}
if (runtime === LEGACY_RUST_RUNTIME) {
this.serverless.cli.warn(`"${LEGACY_RUST_RUNTIME}" for "provider.runtime" is deprecated. Check how to migrate on https://github.com/softprops/serverless-rust`);
}
rustFunctionsFound = true;
const { cargoPackage, binary } = this.cargoBinary(func);

Expand Down
Empty file.
Loading