From 504fa11d0ef9e7df501dc28199ba976ffb3c631d Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Thu, 30 Jan 2025 05:56:58 -0800 Subject: [PATCH 01/12] Let armv8 tests run on new ubuntu-24.04-arm Github runners --- builder/core/data.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/builder/core/data.py b/builder/core/data.py index 2ce27aea3..4830a357f 100644 --- a/builder/core/data.py +++ b/builder/core/data.py @@ -321,9 +321,6 @@ class PKG_TOOLS(Enum): 'armv7': { 'run_tests': False }, - 'armv8': { - 'run_tests': False - }, 'mips': { 'run_tests': False }, From cccf1fd85b04da341897a92a485bec04a0f718e4 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Thu, 30 Jan 2025 09:44:36 -0800 Subject: [PATCH 02/12] ensure tests don't run when ACTUALLY cross-compiling --- builder/core/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/core/project.py b/builder/core/project.py index d473627c0..84967afbc 100644 --- a/builder/core/project.py +++ b/builder/core/project.py @@ -572,7 +572,7 @@ def post_build(self, env): return Script(steps, name='post_build {}'.format(self.name)) def test(self, env): - run_tests = env.config.get('run_tests', True) + run_tests = self.needs_tests(env) if not run_tests: return From 600541df97f8666b91a8726ff5ed00c4e0859506 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Thu, 30 Jan 2025 10:26:44 -0800 Subject: [PATCH 03/12] ugh project.test() needs to work with mock Env in builder's unittests, so check for cross-compile this way instead --- builder/core/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builder/core/project.py b/builder/core/project.py index 84967afbc..a204f511f 100644 --- a/builder/core/project.py +++ b/builder/core/project.py @@ -553,7 +553,8 @@ def build_consumers(self, env): for c in consumers: build_consumers += _build_project(c, env) # build consumer tests - build_consumers += to_list(c.test(env)) + if c.needs_tests(env): + build_consumers += to_list(c.test(env)) if len(build_consumers) == 0: return None return Script(build_consumers, name='build consumers of {}'.format(self.name)) @@ -572,7 +573,7 @@ def post_build(self, env): return Script(steps, name='post_build {}'.format(self.name)) def test(self, env): - run_tests = self.needs_tests(env) + run_tests = env.config.get('run_tests', True) if not run_tests: return From 218a379076787d00bd1b8c75f1595f6c3e56c9e4 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Thu, 30 Jan 2025 10:39:51 -0800 Subject: [PATCH 04/12] mock aren't real --- tests/test_project.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_project.py b/tests/test_project.py index 996255d2f..c6b2e4e97 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -16,6 +16,7 @@ 'name': 'test-proj', 'search_dirs': [test_data_dir], 'path': here, + 'run_tests': True, } @@ -148,7 +149,8 @@ def test_downstream_tests_build_by_default(self): ] p = Project(**config) - mock_env = mock.Mock(name='MockEnv', config=config) + m_toolchain = mock.Mock(name='mock toolchain', cross_compile=False) + mock_env = mock.Mock(name='MockEnv', config=config, project=p, toolchain=m_toolchain) mock_env.spec = BuildSpec() steps = p.build_consumers(mock_env) self._assert_step_contains_all(steps, ['test lib-1']) @@ -163,7 +165,8 @@ def test_downstream_post_build_runs_before_tests(self): ] p = Project(**config) - mock_env = mock.Mock(name='MockEnv', config=config) + m_toolchain = mock.Mock(name='mock toolchain', cross_compile=False) + mock_env = mock.Mock(name='MockEnv', config=config, project=p, toolchain=m_toolchain) mock_env.spec = BuildSpec() steps = p.build_consumers(mock_env) self._assert_step_contains_all(steps, ['post build lib-1', 'test lib-1']) From 4c814797fb3a9937778c68cd03920a2f55055314 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Thu, 30 Jan 2025 19:55:34 +0000 Subject: [PATCH 05/12] needs another needs_tests() call before test() --- builder/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/main.py b/builder/main.py index b3f759dee..61beb82f6 100755 --- a/builder/main.py +++ b/builder/main.py @@ -73,7 +73,8 @@ def post_build(env): return env.project.post_build(env) def test(env): - return env.project.test(env) + if env.project.needs_tests(env): + return env.project.test(env) def install(env): return env.project.install(env) From 03ba17444dea4c61883d7707c43645d6d505abba Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Thu, 30 Jan 2025 19:56:02 +0000 Subject: [PATCH 06/12] why not al2023 --- builder/core/data.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/builder/core/data.py b/builder/core/data.py index 4830a357f..36f861c2c 100644 --- a/builder/core/data.py +++ b/builder/core/data.py @@ -215,6 +215,15 @@ class PKG_TOOLS(Enum): 'python': "python3", }, }, + 'al2023': { + 'os': 'linux', + 'pkg_tool': PKG_TOOLS.DNF, + 'pkg_update': 'dnf update -y', + 'pkg_install': 'dnf install -y', + 'variables': { + 'python': "python3", + }, + }, 'manylinux': { 'os': 'linux', 'pkg_tool': PKG_TOOLS.YUM, From a1e9830705ecd6da341fdf5981a7a5370dc00a02 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Wed, 19 Mar 2025 08:22:23 -0700 Subject: [PATCH 07/12] try ubuntu-24.04 and see if that magically fixes aws-crt-cpp sanity test. also VERBOSE=1 for debugging help --- .github/workflows/sanity-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sanity-test.yml b/.github/workflows/sanity-test.yml index 8a741f726..0e0f1653d 100644 --- a/.github/workflows/sanity-test.yml +++ b/.github/workflows/sanity-test.yml @@ -204,7 +204,7 @@ jobs: # Make sure linux compilers + stdlibs are installing properly std-compat: needs: [package, sanity_test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -227,6 +227,7 @@ jobs: - name: Build aws-crt-cpp with ${{ matrix.compiler }}/${{ matrix.std }} run: | export CXXFLAGS=-std=${{ matrix.std }} + export VERBOSE=1 python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }} release_notes: From c3a62161d3638d46a5c93ee45e99cbfc05eb6616 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Wed, 19 Mar 2025 08:36:13 -0700 Subject: [PATCH 08/12] can't do gcc8 on ubuntu-24.04 try setting C_STANDARD=00 --- .github/workflows/sanity-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sanity-test.yml b/.github/workflows/sanity-test.yml index 0e0f1653d..d8d70a5a5 100644 --- a/.github/workflows/sanity-test.yml +++ b/.github/workflows/sanity-test.yml @@ -204,7 +204,7 @@ jobs: # Make sure linux compilers + stdlibs are installing properly std-compat: needs: [package, sanity_test] - runs-on: ubuntu-24.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -227,6 +227,7 @@ jobs: - name: Build aws-crt-cpp with ${{ matrix.compiler }}/${{ matrix.std }} run: | export CXXFLAGS=-std=${{ matrix.std }} + export CMAKE_C_STANDARD=99 export VERBOSE=1 python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }} From 4dac0b2780449a0152cf1ec93ecab0c10c575d8b Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Wed, 19 Mar 2025 14:10:18 -0700 Subject: [PATCH 09/12] maybe gcc-9 is OK with this. also ubuntu-20.04 runners going away soon --- .github/workflows/sanity-test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-test.yml b/.github/workflows/sanity-test.yml index d8d70a5a5..5fa62b667 100644 --- a/.github/workflows/sanity-test.yml +++ b/.github/workflows/sanity-test.yml @@ -204,11 +204,11 @@ jobs: # Make sure linux compilers + stdlibs are installing properly std-compat: needs: [package, sanity_test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - compiler: [gcc-8, clang-9] + compiler: [gcc-9, clang-9] std: [c++11, c++14, c++17, c++2a] steps: - uses: aws-actions/configure-aws-credentials@v4 @@ -227,7 +227,6 @@ jobs: - name: Build aws-crt-cpp with ${{ matrix.compiler }}/${{ matrix.std }} run: | export CXXFLAGS=-std=${{ matrix.std }} - export CMAKE_C_STANDARD=99 export VERBOSE=1 python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }} From 77e831da7cc7054f1572bd724abf5b1d8cc040f4 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 21 Mar 2025 09:22:15 -0700 Subject: [PATCH 10/12] always set -DCMAKE_VERBOSE_MAKEFILE=ON so we can see all flags passed to the compiler and linker --- builder/actions/cmake.py | 1 + 1 file changed, 1 insertion(+) diff --git a/builder/actions/cmake.py b/builder/actions/cmake.py index a15631bbc..6f0375422 100644 --- a/builder/actions/cmake.py +++ b/builder/actions/cmake.py @@ -147,6 +147,7 @@ def _build_project(env, project, cmake_extra, build_tests=False, args_transforme "-H{}".format(project_source_dir), "-DAWS_WARNINGS_ARE_ERRORS=ON", "-DPERFORM_HEADER_CHECK=ON", + "-DCMAKE_VERBOSE_MAKEFILE=ON", # shows all flags passed to compiler & linker "-DCMAKE_INSTALL_PREFIX=" + project_install_dir, "-DCMAKE_PREFIX_PATH=" + project_install_dir, "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", From 04a4c6bc29acaabcdcf491c9af0a1e50acb24bad Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 21 Mar 2025 09:40:23 -0700 Subject: [PATCH 11/12] Set c++ standard version in a more CMake-friendly way --- .github/workflows/sanity-test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanity-test.yml b/.github/workflows/sanity-test.yml index 5fa62b667..80b498532 100644 --- a/.github/workflows/sanity-test.yml +++ b/.github/workflows/sanity-test.yml @@ -209,7 +209,7 @@ jobs: fail-fast: false matrix: compiler: [gcc-9, clang-9] - std: [c++11, c++14, c++17, c++2a] + cxx-std: ["11", "14", "17", "20"] steps: - uses: aws-actions/configure-aws-credentials@v4 with: @@ -226,9 +226,7 @@ jobs: - name: Build aws-crt-cpp with ${{ matrix.compiler }}/${{ matrix.std }} run: | - export CXXFLAGS=-std=${{ matrix.std }} - export VERBOSE=1 - python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }} + python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }} --cmake-extra=-DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }} release_notes: strategy: From 80df14404c09c762af34ecb482c31d76ddcf30e5 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 21 Mar 2025 09:59:35 -0700 Subject: [PATCH 12/12] don't feel like dealing with issues moving from ubuntu 20 -> 24 right now... --- .github/workflows/sanity-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-test.yml b/.github/workflows/sanity-test.yml index 80b498532..60aa943ad 100644 --- a/.github/workflows/sanity-test.yml +++ b/.github/workflows/sanity-test.yml @@ -204,11 +204,11 @@ jobs: # Make sure linux compilers + stdlibs are installing properly std-compat: needs: [package, sanity_test] - runs-on: ubuntu-24.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - compiler: [gcc-9, clang-9] + compiler: [gcc-8, clang-9] cxx-std: ["11", "14", "17", "20"] steps: - uses: aws-actions/configure-aws-credentials@v4 @@ -224,7 +224,7 @@ jobs: name: builder path: . - - name: Build aws-crt-cpp with ${{ matrix.compiler }}/${{ matrix.std }} + - name: Build aws-crt-cpp with ${{ matrix.compiler }}/cxx${{ matrix.cxx-std }} run: | python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }} --cmake-extra=-DCMAKE_CXX_STANDARD=${{ matrix.cxx-std }}