From 4e132103d6dc0bb411f233951a4496c151e55259 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Fri, 18 Oct 2024 14:56:31 -0700 Subject: [PATCH 1/7] Prebuild s2n (#602) --- crt/CMakeLists.txt | 12 +++++++++--- crt/aws-c-common | 2 +- crt/aws-c-io | 2 +- crt/aws-c-mqtt | 2 +- crt/aws-lc | 2 +- crt/s2n | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 6dc50883..875068d3 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -30,9 +30,9 @@ include(CTest) # (On Windows and Apple we use the default OS libraries) if(UNIX AND NOT APPLE) option(USE_OPENSSL "Set this if you want to use your system's OpenSSL compatible libcrypto" OFF) + include(AwsPrebuildDependency) if(NOT USE_OPENSSL) - include(AwsPrebuildDependency) set(AWSLC_CMAKE_ARGUMENTS -DDISABLE_GO=ON # Build without using Go, we don't want the extra dependency @@ -54,8 +54,14 @@ if(UNIX AND NOT APPLE) ) endif() - set(UNSAFE_TREAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "") - add_subdirectory(s2n) + # prebuild s2n-tls. + aws_prebuild_dependency( + DEPENDENCY_NAME S2N + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/s2n + CMAKE_ARGUMENTS + -DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF + -DBUILD_TESTING=OFF + ) endif() add_subdirectory(aws-c-common) diff --git a/crt/aws-c-common b/crt/aws-c-common index b9959f59..f8c5d8e5 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit b9959f5922a4b969beab8f0b99aa0b34bc9ee55c +Subproject commit f8c5d8e5134fa97955351a44f16b84f96de24045 diff --git a/crt/aws-c-io b/crt/aws-c-io index c345d772..dc41ddc4 160000 --- a/crt/aws-c-io +++ b/crt/aws-c-io @@ -1 +1 @@ -Subproject commit c345d77274db83c0c2e30331814093e7c84c45e2 +Subproject commit dc41ddc498c10ebbf69aba7775afa36c8c1910bd diff --git a/crt/aws-c-mqtt b/crt/aws-c-mqtt index c43232c1..77d6f00e 160000 --- a/crt/aws-c-mqtt +++ b/crt/aws-c-mqtt @@ -1 +1 @@ -Subproject commit c43232c1bc378344bb7245d7fcb167410f3fe931 +Subproject commit 77d6f00e89b10e3263d8a17576ec8e91c45b4606 diff --git a/crt/aws-lc b/crt/aws-lc index d3a598c1..8b2ebfcf 160000 --- a/crt/aws-lc +++ b/crt/aws-lc @@ -1 +1 @@ -Subproject commit d3a598c1b419d49b5b08f0677add4581572e2edc +Subproject commit 8b2ebfcf3fc8b0656f1f4161166484a70238aeaa diff --git a/crt/s2n b/crt/s2n index 08d413a0..ffe0bf42 160000 --- a/crt/s2n +++ b/crt/s2n @@ -1 +1 @@ -Subproject commit 08d413a0b9b3226e775a38f04e3cf02230cc97c4 +Subproject commit ffe0bf42da8f139eff8fd2237f47fbde40b478fb From 5c4d1adc4ceedb41544ce4ed610dac646e573bb2 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Mon, 21 Oct 2024 08:35:08 -0700 Subject: [PATCH 2/7] Fix Network Interface Test (#605) --- crt/aws-c-common | 2 +- crt/aws-c-io | 2 +- crt/aws-c-s3 | 2 +- crt/aws-lc | 2 +- test/test_s3.py | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/crt/aws-c-common b/crt/aws-c-common index f8c5d8e5..f58e807d 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit f8c5d8e5134fa97955351a44f16b84f96de24045 +Subproject commit f58e807d8fd643bd9a96eef182c1db37d01b88e7 diff --git a/crt/aws-c-io b/crt/aws-c-io index dc41ddc4..e3637404 160000 --- a/crt/aws-c-io +++ b/crt/aws-c-io @@ -1 +1 @@ -Subproject commit dc41ddc498c10ebbf69aba7775afa36c8c1910bd +Subproject commit e36374047beadc72a0eb6df14ce3cbc822a789a3 diff --git a/crt/aws-c-s3 b/crt/aws-c-s3 index aede1d8c..16701501 160000 --- a/crt/aws-c-s3 +++ b/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit aede1d8c24f9f580d5a96c089878e9b258b88d04 +Subproject commit 16701501fa9d1684b0ff5406211d058ce2a5b404 diff --git a/crt/aws-lc b/crt/aws-lc index 8b2ebfcf..8ffe277c 160000 --- a/crt/aws-lc +++ b/crt/aws-lc @@ -1 +1 @@ -Subproject commit 8b2ebfcf3fc8b0656f1f4161166484a70238aeaa +Subproject commit 8ffe277c21915ca82dc78a3bdc6a92e10c284b92 diff --git a/test/test_s3.py b/test/test_s3.py index ddde60aa..2ff06920 100644 --- a/test/test_s3.py +++ b/test/test_s3.py @@ -222,8 +222,9 @@ def test_sanity_secure(self): self.assertIsNotNone(s3_client) def test_sanity_network_interface_names(self): - s3_client = s3_client_new(True, self.region, network_interface_names=("eth0", "eth1")) - self.assertIsNotNone(s3_client) + # This is just a sanity test to ensure that we are passing the parameter correctly. + with self.assertRaises(Exception): + s3_client_new(True, self.region, network_interface_names=("eth0", "invalid-network-interface")) def test_wait_shutdown(self): s3_client = s3_client_new(False, self.region) From 59d7e693a6a033b09ea5593399c9803342dda636 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Mon, 21 Oct 2024 13:38:22 -0700 Subject: [PATCH 3/7] Update Win Sanity Check Script (#606) --- codebuild/cd/manylinux-x64-build.yml | 2 +- codebuild/cd/manylinux-x86-build.yml | 2 +- continuous-delivery/sanity-check-test-pypi.bat | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codebuild/cd/manylinux-x64-build.yml b/codebuild/cd/manylinux-x64-build.yml index 146f3a72..844f3b25 100644 --- a/codebuild/cd/manylinux-x64-build.yml +++ b/codebuild/cd/manylinux-x64-build.yml @@ -8,7 +8,7 @@ phases: commands: - export CC=gcc - cd aws-crt-python - - /opt/python/cp37-cp37m/bin/python ./continuous-delivery/update-version.py + - /opt/python/cp38-cp38m/bin/python ./continuous-delivery/update-version.py build: commands: - echo Build started on `date` diff --git a/codebuild/cd/manylinux-x86-build.yml b/codebuild/cd/manylinux-x86-build.yml index d1bd6e05..5a9253f1 100644 --- a/codebuild/cd/manylinux-x86-build.yml +++ b/codebuild/cd/manylinux-x86-build.yml @@ -8,7 +8,7 @@ phases: commands: - export CC=gcc - cd aws-crt-python - - /opt/python/cp37-cp37m/bin/python ./continuous-delivery/update-version.py + - /opt/python/cp38-cp38m/bin/python ./continuous-delivery/update-version.py build: commands: - echo Build started on `date` diff --git a/continuous-delivery/sanity-check-test-pypi.bat b/continuous-delivery/sanity-check-test-pypi.bat index 94991161..8cc2d016 100644 --- a/continuous-delivery/sanity-check-test-pypi.bat +++ b/continuous-delivery/sanity-check-test-pypi.bat @@ -1,8 +1,8 @@ FOR /F "delims=" %%A in ('git describe --tags') do ( set TAG_VERSION=%%A ) set CURRENT_VERSION=%TAG_VERSION:v=% -"C:\Program Files\Python37\python.exe" continuous-delivery\pip-install-with-retry.py --no-cache-dir -i https://testpypi.python.org/simple --user awscrt==%CURRENT_VERSION% || goto error -"C:\Program Files\Python37\python.exe" continuous-delivery\test-pip-install.py || goto error +"C:\Program Files\Python38\python.exe" continuous-delivery\pip-install-with-retry.py --no-cache-dir -i https://testpypi.python.org/simple --user awscrt==%CURRENT_VERSION% || goto error +"C:\Program Files\Python38\python.exe" continuous-delivery\test-pip-install.py || goto error goto :EOF From c974233750aa17d066e303f02099e3eb130e6563 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Mon, 21 Oct 2024 14:43:59 -0700 Subject: [PATCH 4/7] Fix path (#607) --- codebuild/cd/manylinux-x64-build.yml | 2 +- codebuild/cd/manylinux-x86-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codebuild/cd/manylinux-x64-build.yml b/codebuild/cd/manylinux-x64-build.yml index 844f3b25..a3dd03af 100644 --- a/codebuild/cd/manylinux-x64-build.yml +++ b/codebuild/cd/manylinux-x64-build.yml @@ -8,7 +8,7 @@ phases: commands: - export CC=gcc - cd aws-crt-python - - /opt/python/cp38-cp38m/bin/python ./continuous-delivery/update-version.py + - /opt/python/cp38-cp38/bin/python ./continuous-delivery/update-version.py build: commands: - echo Build started on `date` diff --git a/codebuild/cd/manylinux-x86-build.yml b/codebuild/cd/manylinux-x86-build.yml index 5a9253f1..4046bce4 100644 --- a/codebuild/cd/manylinux-x86-build.yml +++ b/codebuild/cd/manylinux-x86-build.yml @@ -8,7 +8,7 @@ phases: commands: - export CC=gcc - cd aws-crt-python - - /opt/python/cp38-cp38m/bin/python ./continuous-delivery/update-version.py + - /opt/python/cp38-cp38/bin/python ./continuous-delivery/update-version.py build: commands: - echo Build started on `date` From 22daf3c3f8bf4f4624e6ae6b4983c4a5df8fe464 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Wed, 23 Oct 2024 10:48:20 -0700 Subject: [PATCH 5/7] Update CMake to 3.9 (#603) --- crt/CMakeLists.txt | 2 +- crt/aws-c-auth | 2 +- crt/aws-c-cal | 2 +- crt/aws-c-common | 2 +- crt/aws-c-compression | 2 +- crt/aws-c-event-stream | 2 +- crt/aws-c-http | 2 +- crt/aws-c-io | 2 +- crt/aws-c-mqtt | 2 +- crt/aws-c-s3 | 2 +- crt/aws-c-sdkutils | 2 +- crt/aws-checksums | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index 875068d3..afda9e15 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt @@ -1,6 +1,6 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.9) # This CMakeLists.txt exists so we can build all the C libraries we depend on # simultaneously. This is much faster than building dependencies one at a time. diff --git a/crt/aws-c-auth b/crt/aws-c-auth index 48d647bf..3982bd75 160000 --- a/crt/aws-c-auth +++ b/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit 48d647bf43f8872e4dc5ec6343b0c5974195fbdd +Subproject commit 3982bd75fea74efd8f9b462b27fedd4599db4f53 diff --git a/crt/aws-c-cal b/crt/aws-c-cal index 2cb1d2ea..656762ae 160000 --- a/crt/aws-c-cal +++ b/crt/aws-c-cal @@ -1 +1 @@ -Subproject commit 2cb1d2eac925e2dbc45025eb89af82bd790c23a0 +Subproject commit 656762aefbee2bc8f509cb23cd107abff20a72bb diff --git a/crt/aws-c-common b/crt/aws-c-common index f58e807d..f41b772f 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit f58e807d8fd643bd9a96eef182c1db37d01b88e7 +Subproject commit f41b772f0de9454a4e7a65750b58c2379533bbf1 diff --git a/crt/aws-c-compression b/crt/aws-c-compression index f36d0167..c6c1191e 160000 --- a/crt/aws-c-compression +++ b/crt/aws-c-compression @@ -1 +1 @@ -Subproject commit f36d01672d61e49d96a777870d456f66fa391cd4 +Subproject commit c6c1191e525e5aa6ead9e1afc392e35d3b50331e diff --git a/crt/aws-c-event-stream b/crt/aws-c-event-stream index 1b3825fc..d2dcc934 160000 --- a/crt/aws-c-event-stream +++ b/crt/aws-c-event-stream @@ -1 +1 @@ -Subproject commit 1b3825fc9cae2e9c7ed7479ee5d354d52ebdf7a0 +Subproject commit d2dcc9344dae24de320866045d85166d8a91a0d1 diff --git a/crt/aws-c-http b/crt/aws-c-http index 6068653e..74b3a0dd 160000 --- a/crt/aws-c-http +++ b/crt/aws-c-http @@ -1 +1 @@ -Subproject commit 6068653e1d582bd8e7d1c9f81f86beaf10444e3d +Subproject commit 74b3a0dd1396b72f701c8bdf24e5c6f41e52cf87 diff --git a/crt/aws-c-io b/crt/aws-c-io index e3637404..fe93d0af 160000 --- a/crt/aws-c-io +++ b/crt/aws-c-io @@ -1 +1 @@ -Subproject commit e36374047beadc72a0eb6df14ce3cbc822a789a3 +Subproject commit fe93d0afcc1cede32ac9569abd8669ed011b1b8c diff --git a/crt/aws-c-mqtt b/crt/aws-c-mqtt index 77d6f00e..627c3334 160000 --- a/crt/aws-c-mqtt +++ b/crt/aws-c-mqtt @@ -1 +1 @@ -Subproject commit 77d6f00e89b10e3263d8a17576ec8e91c45b4606 +Subproject commit 627c3334e52021aa8d5772b6ca076884610f3219 diff --git a/crt/aws-c-s3 b/crt/aws-c-s3 index 16701501..8c1969bc 160000 --- a/crt/aws-c-s3 +++ b/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit 16701501fa9d1684b0ff5406211d058ce2a5b404 +Subproject commit 8c1969bce5bfe0e063cbc719182dbe344342b880 diff --git a/crt/aws-c-sdkutils b/crt/aws-c-sdkutils index 4658412a..0818f28e 160000 --- a/crt/aws-c-sdkutils +++ b/crt/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit 4658412a61ad5749db92a8d1e0717cb5e76ada1c +Subproject commit 0818f28ee436b892f09fbe8e3a6ae37ff40e9436 diff --git a/crt/aws-checksums b/crt/aws-checksums index ce04ab00..0d2f5521 160000 --- a/crt/aws-checksums +++ b/crt/aws-checksums @@ -1 +1 @@ -Subproject commit ce04ab00b3ecc41912f478bfedca39f8e1919d6b +Subproject commit 0d2f5521f61215f38f791d106ae304402208112d From e9c64a3d93685e3023c5048fa1af87dc0251af92 Mon Sep 17 00:00:00 2001 From: Ashish Dhingra <67916761+ashishdhingra@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:02:52 -0700 Subject: [PATCH 6/7] chore: Modified bug issue template to add checkbox to report potential regression. (#595) Co-authored-by: Joseph Klix --- .github/ISSUE_TEMPLATE/bug-report.yml | 8 +++++ .../workflows/issue-regression-labeler.yml | 32 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/issue-regression-labeler.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index fb637876..bbdecca5 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -12,6 +12,14 @@ body: description: What is the problem? A clear and concise description of the bug. validations: required: true + - type: checkboxes + id: regression + attributes: + label: Regression Issue + description: What is a regression? If it worked in a previous version but doesn't in the latest version, it's considered a regression. In this case, please provide specific version number in the report. + options: + - label: Select this option if this issue appears to be a regression. + required: false - type: textarea id: expected attributes: diff --git a/.github/workflows/issue-regression-labeler.yml b/.github/workflows/issue-regression-labeler.yml new file mode 100644 index 00000000..bd000719 --- /dev/null +++ b/.github/workflows/issue-regression-labeler.yml @@ -0,0 +1,32 @@ +# Apply potential regression label on issues +name: issue-regression-label +on: + issues: + types: [opened, edited] +jobs: + add-regression-label: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Fetch template body + id: check_regression + uses: actions/github-script@v7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TEMPLATE_BODY: ${{ github.event.issue.body }} + with: + script: | + const regressionPattern = /\[x\] Select this option if this issue appears to be a regression\./i; + const template = `${process.env.TEMPLATE_BODY}` + const match = regressionPattern.test(template); + core.setOutput('is_regression', match); + - name: Manage regression label + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" ]; then + gh issue edit ${{ github.event.issue.number }} --add-label "potential-regression" -R ${{ github.repository }} + else + gh issue edit ${{ github.event.issue.number }} --remove-label "potential-regression" -R ${{ github.repository }} + fi From 084e141e9b87aea833b53e5b3a9175320218ed57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Wed, 30 Oct 2024 22:35:00 +0100 Subject: [PATCH 7/7] Remove deprecated `ByteString` (#608) `ByteString` has been deprecated in Python 3.12 and will be removed in Python 3.14. Replace it with `Union[bytes, bytearray]`. See: https://docs.python.org/dev/deprecations/pending-removal-in-3.14.html --- awscrt/eventstream/__init__.py | 7 +++---- awscrt/eventstream/rpc.py | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/awscrt/eventstream/__init__.py b/awscrt/eventstream/__init__.py index 09e24ada..94502752 100644 --- a/awscrt/eventstream/__init__.py +++ b/awscrt/eventstream/__init__.py @@ -5,9 +5,8 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. -from collections.abc import ByteString from enum import IntEnum -from typing import Any +from typing import Any, Union from uuid import UUID __all__ = ['HeaderType', 'Header'] @@ -135,7 +134,7 @@ def from_int64(cls, name: str, value: int) -> 'Header': return cls(name, value, HeaderType.INT64) @classmethod - def from_byte_buf(cls, name: str, value: ByteString) -> 'Header': + def from_byte_buf(cls, name: str, value: Union[bytes, bytearray]) -> 'Header': """Create a Header of type :attr:`~HeaderType.BYTE_BUF` The value must be a bytes-like object""" @@ -246,7 +245,7 @@ def value_as_int64(self) -> int: Raises an exception if type is not :attr:`~HeaderType.INT64`""" return self._value_as(HeaderType.INT64) - def value_as_byte_buf(self) -> ByteString: + def value_as_byte_buf(self) -> Union[bytes, bytearray]: """Return value of bytes Raises an exception if type is not :attr:`~HeaderType.BYTE_BUF`""" diff --git a/awscrt/eventstream/rpc.py b/awscrt/eventstream/rpc.py index b70352e0..ff0096e2 100644 --- a/awscrt/eventstream/rpc.py +++ b/awscrt/eventstream/rpc.py @@ -11,11 +11,11 @@ import awscrt.exceptions from awscrt.eventstream import Header from awscrt.io import ClientBootstrap, SocketOptions, TlsConnectionOptions -from collections.abc import ByteString, Callable +from collections.abc import Callable from concurrent.futures import Future from enum import IntEnum from functools import partial -from typing import Optional, Sequence +from typing import Optional, Sequence, Union __all__ = [ 'MessageType', @@ -381,7 +381,7 @@ def send_protocol_message( self, *, headers: Optional[Sequence[Header]] = None, - payload: Optional[ByteString] = None, + payload: Optional[Union[bytes, bytearray]] = None, message_type: MessageType, flags: Optional[int] = None, on_flush: Callable = None) -> 'concurrent.futures.Future': @@ -483,7 +483,7 @@ def activate( *, operation: str, headers: Sequence[Header] = None, - payload: ByteString = None, + payload: Union[bytes, bytearray] = None, message_type: MessageType, flags: int = None, on_flush: Callable = None): @@ -553,7 +553,7 @@ def send_message( self, *, headers: Sequence[Header] = None, - payload: ByteString = None, + payload: Union[bytes, bytearray] = None, message_type: MessageType, flags: int = None, on_flush: Callable = None) -> 'concurrent.futures.Future':