Skip to content

Commit dc615c6

Browse files
valerenavicheey
andauthored
feat: add ruby3.4 support (#7940)
New Lambda managed runtime: Ruby 3.4 (`ruby3.4`) Co-authored-by: vicheey <181402101+vicheey@users.noreply.github.com>
1 parent 7e855f1 commit dc615c6

File tree

8 files changed

+21
-12
lines changed

8 files changed

+21
-12
lines changed

samcli/commands/build/command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
------------------
5959
1. Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 using PIP\n
6060
2. Nodejs 22.x, Nodejs 20.x, 18.x, 16.x, 14.x, 12.x using NPM\n
61-
3. Ruby 3.2, 3.3 using Bundler\n
61+
3. Ruby 3.2, 3.3, 3.4 using Bundler\n
6262
4. Java 8, Java 11, Java 17, Java 21 using Gradle and Maven\n
6363
5. Dotnet8, Dotnet6 using Dotnet CLI\n
6464
6. Go 1.x using Go Modules (without --use-container)\n

samcli/lib/build/workflow_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def get_layer_subfolder(build_workflow: str) -> str:
100100
"nodejs22.x": "nodejs",
101101
"ruby3.2": "ruby/lib",
102102
"ruby3.3": "ruby/lib",
103+
"ruby3.4": "ruby/lib",
103104
"java11": "java",
104105
"java8.al2": "java",
105106
"java17": "java",
@@ -167,6 +168,7 @@ def get_workflow_config(
167168
"nodejs22.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
168169
"ruby3.2": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
169170
"ruby3.3": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
171+
"ruby3.4": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
170172
"dotnet6": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
171173
"dotnet8": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
172174
"go1.x": BasicWorkflowSelector(GO_MOD_CONFIG),

samcli/lib/utils/architecture.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"python3.13": [ARM64, X86_64],
2828
"ruby3.2": [ARM64, X86_64],
2929
"ruby3.3": [ARM64, X86_64],
30+
"ruby3.4": [ARM64, X86_64],
3031
"java8.al2": [ARM64, X86_64],
3132
"java11": [ARM64, X86_64],
3233
"java17": [ARM64, X86_64],

samcli/local/common/runtime_template.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
],
2525
"ruby": [
2626
{
27-
"runtimes": ["ruby3.3", "ruby3.2"],
27+
"runtimes": ["ruby3.4", "ruby3.3", "ruby3.2"],
2828
"dependency_manager": "bundler",
2929
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-ruby"),
3030
"build": True,
@@ -125,6 +125,7 @@ def get_local_lambda_images_location(mapping, runtime):
125125
"python3.9",
126126
"python3.8",
127127
# ruby runtimes in descending order
128+
"ruby3.4",
128129
"ruby3.3",
129130
"ruby3.2",
130131
]
@@ -150,6 +151,7 @@ def get_local_lambda_images_location(mapping, runtime):
150151
"python3.10": "amazon/python3.10-base",
151152
"python3.9": "amazon/python3.9-base",
152153
"python3.8": "amazon/python3.8-base",
154+
"ruby3.4": "amazon/ruby3.4-base",
153155
"ruby3.3": "amazon/ruby3.3-base",
154156
"ruby3.2": "amazon/ruby3.2-base",
155157
}

samcli/local/docker/lambda_image.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Runtime(Enum):
4747
python313 = "python3.13"
4848
ruby32 = "ruby3.2"
4949
ruby33 = "ruby3.3"
50+
ruby34 = "ruby3.4"
5051
java8al2 = "java8.al2"
5152
java11 = "java11"
5253
java17 = "java17"

schema/samcli.json

Lines changed: 11 additions & 8 deletions
Large diffs are not rendered by default.

tests/integration/buildcmd/test_build_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def _prepare_application_environment(self, runtime):
316316
└── template.yaml
317317
"""
318318
# copy .ruby-version to the root of the project
319-
ruby_runtime_path = "Ruby32" if runtime == "ruby3.2" else "Ruby33"
319+
ruby_runtime_path = runtime.replace(".", "").title() # ruby3.X to Ruby3X
320320
shutil.copyfile(
321321
Path(self.template_path).parent.joinpath(ruby_runtime_path, ".ruby-version"),
322322
Path(self.working_dir).joinpath(".ruby-version"),

tests/unit/lib/build_module/test_workflow_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_raise_exception_for_bad_specified_workflow(self, runtime):
101101
with self.assertRaises(UnsupportedBuilderException):
102102
get_workflow_config(runtime, self.code_dir, self.project_dir, specified_workflow="Wrong")
103103

104-
@parameterized.expand([("ruby3.2",)])
104+
@parameterized.expand([("ruby3.2",), ("ruby3.3",), ("ruby3.4",)])
105105
def test_must_work_for_ruby(self, runtime):
106106
result = get_workflow_config(runtime, self.code_dir, self.project_dir)
107107
self.assertEqual(result.language, "ruby")

0 commit comments

Comments
 (0)