Skip to content

Commit bde031e

Browse files
Merge from aws/aws-sam-cli/develop
2 parents 86576a7 + 2a3e0f9 commit bde031e

50 files changed

Lines changed: 341 additions & 75 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

appveyor-ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ configuration:
1616
- OtherAndEndToEndTesting
1717

1818
environment:
19-
PYTHON_HOME: "$HOME/venv3.11/bin"
20-
PYTHON_VERSION: '3.11'
19+
PYTHON_HOME: "$HOME/venv3.9/bin"
20+
PYTHON_VERSION: '3.9'
2121
AWS_DEFAULT_REGION: us-east-1
2222
SAM_CLI_DEV: 1
2323
NODE_VERSION: "18.18.2"

appveyor-windows-al2023.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ environment:
1313
TMPDIR: "%TEMP%"
1414
TMP: "%TEMP%"
1515

16-
# MSI Installers use Py3.11. It is sufficient to test with this version here.
17-
PYTHON_HOME: "C:\\Python311-x64"
18-
PYTHON_SCRIPTS: "C:\\Python311-x64\\Scripts"
19-
PYTHON_EXE: "C:\\Python311-x64\\python.exe"
16+
# MSI Installers use Py3.9. It is sufficient to test with this version here.
17+
PYTHON_HOME: "C:\\Python39-x64"
18+
PYTHON_SCRIPTS: "C:\\Python39-x64\\Scripts"
19+
PYTHON_EXE: "C:\\Python39-x64\\python.exe"
2020
PYTHON_ARCH: "64"
2121
HOME: 'C:\Users\appveyor'
2222
HOMEDRIVE: "C:"

appveyor-windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ environment:
2626
TMPDIR: "%TEMP%"
2727
TMP: "%TEMP%"
2828

29-
# MSI Installers uses Py3.11. It is sufficient to test with this version here.
30-
PYTHON_HOME: "C:\\Python311-x64"
31-
PYTHON_SCRIPTS: "C:\\Python311-x64\\Scripts"
32-
PYTHON_EXE: "C:\\Python311-x64\\python.exe"
29+
# MSI Installers uses Py3.9. It is sufficient to test with this version here.
30+
PYTHON_HOME: "C:\\Python39-x64"
31+
PYTHON_SCRIPTS: "C:\\Python39-x64\\Scripts"
32+
PYTHON_EXE: "C:\\Python39-x64\\python.exe"
3333
PYTHON_ARCH: "64"
3434
HOME: 'C:\Users\appveyor'
3535
HOMEDRIVE: "C:"

requirements/dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ types-pywin32==308.0.0.20241221; python_version<"3.9"
1515
types-PyYAML==6.0.12.20241230
1616
types-chevron==0.14.2.20250103
1717
types-psutil==6.1.0.20241221
18-
types-setuptools==75.8.0.20250110
18+
types-setuptools==75.8.0.20250210
1919
types-Pygments==2.19.0.20250107
2020
types-colorama==0.4.15.20240311
21-
types-dateparser==1.2.0.20240420
21+
types-dateparser==1.2.0.20250208
2222
types-docutils==0.21.0.20241128
2323
types-jsonschema==4.23.0.20241208
2424
types-pyOpenSSL==24.1.0.20240722

requirements/pre-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruff==0.9.3
1+
ruff==0.9.6

requirements/pyinstaller-build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Executable binary builder requirements
22
setuptools==75.6.0
3-
pyinstaller==6.11.1
3+
pyinstaller==6.12.0

samcli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
SAM CLI version
33
"""
44

5-
__version__ = "1.133.0"
5+
__version__ = "1.134.0"

samcli/commands/_utils/options.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,34 @@ def use_container_build_option(f):
862862
return use_container_build_click_option()(f)
863863

864864

865+
def mount_symlinks_click_option():
866+
return click.option(
867+
"--mount-symlinks/--no-mount-symlinks",
868+
default=False,
869+
is_flag=True,
870+
help="Specify if symlinks at the top level of the code should be mounted inside the container. "
871+
"Activating this flag could allow access to locations outside of your workspace by using a symbolic link. "
872+
"By default symlinks are not mounted.",
873+
)
874+
875+
876+
def mount_symlinks_option(f):
877+
return mount_symlinks_click_option()(f)
878+
879+
880+
def no_memory_limit_click_option():
881+
return click.option(
882+
"--no-memory-limit",
883+
default=False,
884+
is_flag=True,
885+
help="Remove the Memory limit during emulation. This runs the container without the --memory parameter",
886+
)
887+
888+
889+
def no_memory_limit_option(f):
890+
return no_memory_limit_click_option()(f)
891+
892+
865893
def terraform_plan_file_callback(ctx, param, provided_value):
866894
"""
867895
Callback for --terraform-plan-file to check if --hook-name is also specified

samcli/commands/build/build_context.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def __init__(
8282
hook_name: Optional[str] = None,
8383
build_in_source: Optional[bool] = None,
8484
mount_with: str = MountMode.READ.value,
85+
mount_symlinks: Optional[bool] = False,
8586
) -> None:
8687
"""
8788
Initialize the class
@@ -139,6 +140,8 @@ def __init__(
139140
Set to True to build in the source directory.
140141
mount_with:
141142
Mount mode of source code directory when building inside container, READ ONLY by default
143+
mount_symlinks Optional[bool]:
144+
Indicates if symlinks should be mounted inside the container
142145
"""
143146

144147
self._resource_identifier = resource_identifier
@@ -180,6 +183,7 @@ def __init__(
180183
self._build_in_source = build_in_source
181184
self._build_result: Optional[ApplicationBuildResult] = None
182185
self._mount_with = MountMode(mount_with)
186+
self._mount_symlinks = mount_symlinks
183187

184188
def __enter__(self) -> "BuildContext":
185189
self.set_up()
@@ -273,6 +277,7 @@ def run(self) -> None:
273277
combine_dependencies=not self._create_auto_dependency_layer,
274278
build_in_source=self._build_in_source,
275279
mount_with_write=mount_with_write,
280+
mount_symlinks=self._mount_symlinks,
276281
)
277282

278283
self._check_exclude_warning()

samcli/commands/build/command.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
docker_common_options,
2525
hook_name_click_option,
2626
manifest_option,
27+
mount_symlinks_option,
2728
parameter_override_option,
2829
skip_prepare_infra_option,
2930
template_option_without_build,
@@ -115,6 +116,7 @@
115116
"be changed/added by the build process. By default the source code directory is read only.",
116117
cls=ContainerOptions,
117118
)
119+
@mount_symlinks_option
118120
@build_dir_option
119121
@cache_dir_option
120122
@base_dir_option
@@ -158,6 +160,7 @@ def cli(
158160
mount_with: str,
159161
terraform_project_root_path: Optional[str],
160162
build_in_source: Optional[bool],
163+
mount_symlinks: Optional[bool],
161164
) -> None:
162165
"""
163166
`sam build` command entry point
@@ -189,6 +192,7 @@ def cli(
189192
hook_name,
190193
build_in_source,
191194
mount_with,
195+
mount_symlinks,
192196
) # pragma: no cover
193197

194198

@@ -215,6 +219,7 @@ def do_cli( # pylint: disable=too-many-locals, too-many-statements
215219
hook_name: Optional[str],
216220
build_in_source: Optional[bool],
217221
mount_with: str,
222+
mount_symlinks: Optional[bool],
218223
) -> None:
219224
"""
220225
Implementation of the ``cli`` method
@@ -254,6 +259,7 @@ def do_cli( # pylint: disable=too-many-locals, too-many-statements
254259
hook_name=hook_name,
255260
build_in_source=build_in_source,
256261
mount_with=mount_with,
262+
mount_symlinks=mount_symlinks,
257263
) as ctx:
258264
ctx.run()
259265

0 commit comments

Comments
 (0)