From 528b0adbc5e66a260e4699a5adcdf957ecf8e3e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:28:37 -0700 Subject: [PATCH 1/8] chore(deps-dev): bump ruff from 0.4.1 to 0.4.2 in /requirements (#644) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.1 to 0.4.2. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.4.1...v0.4.2) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index aaa78e54d..eb9d9231f 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -9,4 +9,4 @@ pyelftools~=0.31 # Used to verify the generated Go binary architecture in integr # formatter black==24.4.0 -ruff==0.4.1 +ruff==0.4.2 From 7bb8be7d9b877e02bc470df3eff08b1bdec17775 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:29:17 -0700 Subject: [PATCH 2/8] chore(deps-dev): bump coverage from 7.4.4 to 7.5.0 in /requirements (#642) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.4 to 7.5.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.4...7.5.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index eb9d9231f..39406155e 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -coverage==7.4.4 +coverage==7.5.0 flake8==3.8.4 pytest-cov==5.0.0 From d53ef223f14760c40876e654ca7e8678a885e823 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 17:52:29 +0000 Subject: [PATCH 3/8] chore(deps-dev): bump black from 24.4.0 to 24.4.2 in /requirements (#643) Bumps [black](https://github.com/psf/black) from 24.4.0 to 24.4.2. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.4.0...24.4.2) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 39406155e..415a07b6e 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -8,5 +8,5 @@ parameterized==0.9.0 pyelftools~=0.31 # Used to verify the generated Go binary architecture in integration tests (utils.py) # formatter -black==24.4.0 +black==24.4.2 ruff==0.4.2 From 751d7294ac793cea7ca71f65b5c37f4083babfc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 09:32:40 -0700 Subject: [PATCH 4/8] chore(deps-dev): bump coverage from 7.5.0 to 7.5.1 in /requirements (#646) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.0 to 7.5.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.0...7.5.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 415a07b6e..a4b6d353c 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -coverage==7.5.0 +coverage==7.5.1 flake8==3.8.4 pytest-cov==5.0.0 From c5e7d3ee1b70fa8e87e1cda70af2485faeafe58a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 12:53:52 -0700 Subject: [PATCH 5/8] chore(deps-dev): bump ruff from 0.4.2 to 0.4.3 in /requirements (#647) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.2 to 0.4.3. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.4.2...v0.4.3) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index a4b6d353c..794851f13 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -9,4 +9,4 @@ pyelftools~=0.31 # Used to verify the generated Go binary architecture in integr # formatter black==24.4.2 -ruff==0.4.2 +ruff==0.4.3 From 0c617381e7e74cf59f2fc8921469f33966789741 Mon Sep 17 00:00:00 2001 From: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> Date: Mon, 13 May 2024 09:59:21 -0700 Subject: [PATCH 6/8] fix: set CARGO_TARGET_DIR env var to support cargo workspace setup for sam build (#649) --- .../workflows/rust_cargo/cargo_lambda.py | 6 +++ .../workflows/rust_cargo/test_rust_cargo.py | 40 ++++++++++++++----- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py b/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py index 33c61ee36..223fcc633 100644 --- a/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py +++ b/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py @@ -100,6 +100,12 @@ def run(self, command, cwd): if "RUST_LOG" not in os.environ: os.environ["RUST_LOG"] = "debug" LOG.debug("RUST_LOG environment variable set to `%s`", os.environ.get("RUST_LOG")) + + if not os.getenv("CARGO_TARGET_DIR"): + # This results in the "target" dir being created under the member dir of a cargo workspace + # This is for supporting sam build for a Cargo Workspace project + os.environ["CARGO_TARGET_DIR"] = "target" + cargo_process = self._osutils.popen( command, stderr=subprocess.PIPE, diff --git a/tests/integration/workflows/rust_cargo/test_rust_cargo.py b/tests/integration/workflows/rust_cargo/test_rust_cargo.py index 2fb846718..fd3930a1e 100644 --- a/tests/integration/workflows/rust_cargo/test_rust_cargo.py +++ b/tests/integration/workflows/rust_cargo/test_rust_cargo.py @@ -9,8 +9,8 @@ from aws_lambda_builders.workflows.rust_cargo.feature_flag import EXPERIMENTAL_FLAG_CARGO_LAMBDA -def rm_target_lambda(base): - shutil.rmtree(os.path.join(base, "target", "lambda"), ignore_errors=True) +def rm_target(base): + shutil.rmtree(os.path.join(base, "target"), ignore_errors=True) class TestRustCargo(TestCase): @@ -52,7 +52,7 @@ def test_failed_build_project(self): def test_builds_hello_project(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "hello") - rm_target_lambda(source_dir) + rm_target(source_dir) self.builder.build( source_dir, @@ -70,7 +70,7 @@ def test_builds_hello_project(self): def test_builds_hello_project_with_artifact_name(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "hello") - rm_target_lambda(source_dir) + rm_target(source_dir) self.builder.build( source_dir, @@ -89,7 +89,7 @@ def test_builds_hello_project_with_artifact_name(self): def test_builds_hello_project_for_arm64(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "hello") - rm_target_lambda(source_dir) + rm_target(source_dir) self.builder.build( source_dir, @@ -109,10 +109,10 @@ def test_builds_hello_project_for_arm64(self): def test_builds_workspaces_project_with_bin_name(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "workspaces") - rm_target_lambda(source_dir) + rm_target(source_dir) self.builder.build( - source_dir, + f"{source_dir}", self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "Cargo.toml"), @@ -125,10 +125,30 @@ def test_builds_workspaces_project_with_bin_name(self): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) + self.assertIn("foo", os.listdir(os.path.join(source_dir, "target", "lambda"))) + + def test_builds_workspace_member(self): + source_dir = os.path.join(self.TEST_DATA_FOLDER, "workspaces") + rm_target(source_dir) + + self.builder.build( + f"{source_dir}/bar", + self.artifacts_dir, + self.scratch_dir, + os.path.join(source_dir, "Cargo.toml"), + runtime=self.runtime, + experimental_flags=[EXPERIMENTAL_FLAG_CARGO_LAMBDA], + ) + + expected_files = {"bootstrap"} + output_files = set(os.listdir(self.artifacts_dir)) + + self.assertEqual(expected_files, output_files) + self.assertIn("bar", os.path.join(source_dir, "bar", "target", "lambda")) def test_builds_workspaces_project_with_package_option(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "workspaces") - rm_target_lambda(source_dir) + rm_target(source_dir) self.builder.build( source_dir, @@ -147,7 +167,7 @@ def test_builds_workspaces_project_with_package_option(self): def test_builds_multi_function_project_with_function_a(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "multi-binary") - rm_target_lambda(source_dir) + rm_target(source_dir) self.builder.build( source_dir, @@ -166,7 +186,7 @@ def test_builds_multi_function_project_with_function_a(self): def test_builds_multi_function_project_with_function_b(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "multi-binary") - rm_target_lambda(source_dir) + rm_target(source_dir) self.builder.build( source_dir, From 7f963aa91f4b7668193f39df951c50d8dd094640 Mon Sep 17 00:00:00 2001 From: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> Date: Mon, 13 May 2024 10:45:41 -0700 Subject: [PATCH 7/8] update _RUNTIME_GLIBC mapping to support newer python versions (#648) --- aws_lambda_builders/workflows/python_pip/packager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws_lambda_builders/workflows/python_pip/packager.py b/aws_lambda_builders/workflows/python_pip/packager.py index 65a802028..3fc48427a 100644 --- a/aws_lambda_builders/workflows/python_pip/packager.py +++ b/aws_lambda_builders/workflows/python_pip/packager.py @@ -203,6 +203,9 @@ class DependencyBuilder(object): "cp37m": (2, 17), "cp38": (2, 26), "cp39": (2, 26), + "cp310": (2, 26), + "cp311": (2, 26), + "cp312": (2, 26), } # Fallback version if we're on an unknown python version # not in _RUNTIME_GLIBC. From 4b8b67512a269212229aeedcc376dfd54949f484 Mon Sep 17 00:00:00 2001 From: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> Date: Mon, 13 May 2024 11:09:51 -0700 Subject: [PATCH 8/8] chore: bump version to 1.50.0 (#650) --- aws_lambda_builders/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_builders/__init__.py b/aws_lambda_builders/__init__.py index d7910614c..d28d17012 100644 --- a/aws_lambda_builders/__init__.py +++ b/aws_lambda_builders/__init__.py @@ -5,5 +5,5 @@ # Changing version will trigger a new release! # Please make the version change as the last step of your development. -__version__ = "1.49.0" +__version__ = "1.50.0" RPC_PROTOCOL_VERSION = "0.3"