From 0d64f5e76d44973bf31b0a84ef7392eda33a70e1 Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Fri, 29 Dec 2023 12:57:14 -0800 Subject: [PATCH 1/7] Fix typos and remove self-host runner requirement for Windows. --- .github/workflows/check-clang-linux.yml | 2 +- .github/workflows/check-clang-windows.yml | 2 +- .github/workflows/checkedc-clang-macos.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-clang-linux.yml b/.github/workflows/check-clang-linux.yml index 1822ac7..a7e9026 100644 --- a/.github/workflows/check-clang-linux.yml +++ b/.github/workflows/check-clang-linux.yml @@ -1,4 +1,4 @@ -name: Checked C Clang CI Linux] +name: Checked C Clang CI [Linux] on: workflow_dispatch: diff --git a/.github/workflows/check-clang-windows.yml b/.github/workflows/check-clang-windows.yml index ee7e298..8c680ad 100644 --- a/.github/workflows/check-clang-windows.yml +++ b/.github/workflows/check-clang-windows.yml @@ -47,7 +47,7 @@ env: jobs: test_CheckedC_Clang_on_windows : name: Build Checked C clang and test it on Windows - runs-on: [ self-hosted, Windows, X64 ] + runs-on: [ Windows, X64 ] steps: - name: Checkout Checked C Clang code uses: actions/checkout@v2 diff --git a/.github/workflows/checkedc-clang-macos.yml b/.github/workflows/checkedc-clang-macos.yml index 10be7e7..9ceb9f4 100644 --- a/.github/workflows/checkedc-clang-macos.yml +++ b/.github/workflows/checkedc-clang-macos.yml @@ -53,7 +53,7 @@ jobs: rm -rf ${{env.BUILD_SOURCESDIRECTORY}} mkdir -p ${{env.BUILD_SOURCESDIRECTORY}} - test_CheckedC_Clang_UNIX: + test_CheckedC_Clang_MacOS: name: Build and test Checked C Clang on MacOS needs: clean runs-on: macOS From deb7ddaf299bf7f8ababf38fcd854c00fd55de11 Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Fri, 29 Dec 2023 13:16:42 -0800 Subject: [PATCH 2/7] Update OS tags. --- .github/workflows/check-clang-windows.yml | 2 +- .github/workflows/checkedc-clang-macos.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-clang-windows.yml b/.github/workflows/check-clang-windows.yml index 8c680ad..f03ff59 100644 --- a/.github/workflows/check-clang-windows.yml +++ b/.github/workflows/check-clang-windows.yml @@ -47,7 +47,7 @@ env: jobs: test_CheckedC_Clang_on_windows : name: Build Checked C clang and test it on Windows - runs-on: [ Windows, X64 ] + runs-on: [ windows-latest ] steps: - name: Checkout Checked C Clang code uses: actions/checkout@v2 diff --git a/.github/workflows/checkedc-clang-macos.yml b/.github/workflows/checkedc-clang-macos.yml index 9ceb9f4..1cfb6c3 100644 --- a/.github/workflows/checkedc-clang-macos.yml +++ b/.github/workflows/checkedc-clang-macos.yml @@ -56,7 +56,7 @@ jobs: test_CheckedC_Clang_MacOS: name: Build and test Checked C Clang on MacOS needs: clean - runs-on: macOS + runs-on: macos-latest steps: - name: Checkout Checked C Clang code uses: actions/checkout@v2 From 0e97d91b3d3ba5bf2dabc5dd477132fd6a507da9 Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Fri, 29 Dec 2023 13:26:26 -0800 Subject: [PATCH 3/7] Try updating macos tag yet again. --- .github/workflows/checkedc-clang-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkedc-clang-macos.yml b/.github/workflows/checkedc-clang-macos.yml index 1cfb6c3..d486a7d 100644 --- a/.github/workflows/checkedc-clang-macos.yml +++ b/.github/workflows/checkedc-clang-macos.yml @@ -56,7 +56,7 @@ jobs: test_CheckedC_Clang_MacOS: name: Build and test Checked C Clang on MacOS needs: clean - runs-on: macos-latest + runs-on: [ macos-latest ] steps: - name: Checkout Checked C Clang code uses: actions/checkout@v2 From b687c8fe19fdbfef627fc2115cd2a9d71ef88c9a Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Fri, 29 Dec 2023 19:54:25 -0800 Subject: [PATCH 4/7] Update missed macOS tag. --- .github/workflows/checkedc-clang-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkedc-clang-macos.yml b/.github/workflows/checkedc-clang-macos.yml index d486a7d..e3cfe46 100644 --- a/.github/workflows/checkedc-clang-macos.yml +++ b/.github/workflows/checkedc-clang-macos.yml @@ -42,7 +42,7 @@ jobs: # Cleanup files left behind by prior runs clean: name: Clean - runs-on: macOS + runs-on: [ macos-latest ] steps: - name: Clean run: | From f58d800025d9da50552369e01cd6257dff09dd4a Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Sun, 31 Dec 2023 13:00:36 -0800 Subject: [PATCH 5/7] Try specifying an older version of Python. --- .github/workflows/check-clang-windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-clang-windows.yml b/.github/workflows/check-clang-windows.yml index f03ff59..2977fed 100644 --- a/.github/workflows/check-clang-windows.yml +++ b/.github/workflows/check-clang-windows.yml @@ -49,6 +49,10 @@ jobs: name: Build Checked C clang and test it on Windows runs-on: [ windows-latest ] steps: + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' - name: Checkout Checked C Clang code uses: actions/checkout@v2 with: From 60e46f5cced627508504e090b7bb37cd6ddb03a2 Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Mon, 2 Sep 2024 17:05:30 -0700 Subject: [PATCH 6/7] Add missing Python library Distutils is usually included in Python 3.9 distributions. For the GitHub Windows Sesrver 2022, it isn't. Trying adding setuptools, which pip substitutes behind the scene for distutils. Distutils is deprecated and has been removed from later versions of Python. When we upgrade our clang ources, we can follow what LLVM has done for later versions of Python. --- .github/workflows/check-clang-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-clang-windows.yml b/.github/workflows/check-clang-windows.yml index 2977fed..bd9c224 100644 --- a/.github/workflows/check-clang-windows.yml +++ b/.github/workflows/check-clang-windows.yml @@ -53,6 +53,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.9' + - name: Add Python setuptools + run: pip3 install setuptools - name: Checkout Checked C Clang code uses: actions/checkout@v2 with: From dd17089cc8b03322d2f0f8f06cc4f3159204dfe6 Mon Sep 17 00:00:00 2001 From: David Tarditi Date: Mon, 2 Sep 2024 21:02:08 -0700 Subject: [PATCH 7/7] Update Windows scripts to use repo info. Switch to checkedc-clang. - Switch from using checkedc-llvm-project to checkedc-clang. - The Windows scripts did not use the clang or Checked C repo locations, unlike the Linux scripts. Update them to use them. --- .github/workflows/check-clang-linux.yml | 2 +- .github/workflows/check-clang-windows.yml | 4 +--- .github/workflows/checkedc-clang-macos.yml | 2 +- test_scripts/automation/UNIX/config-vars.sh | 2 ++ test_scripts/automation/Windows/config-vars.bat | 12 ++++++++++++ test_scripts/automation/Windows/run-cmake.bat | 2 +- test_scripts/automation/Windows/setup-files.bat | 12 ++++++------ 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-clang-linux.yml b/.github/workflows/check-clang-linux.yml index a7e9026..f9d6c31 100644 --- a/.github/workflows/check-clang-linux.yml +++ b/.github/workflows/check-clang-linux.yml @@ -18,7 +18,7 @@ on: clang_repo: description: 'Clang Repo name' required: true - default: 'https://github.com/checkedc/checkedc-llvm-project.git' + default: 'https://github.com/checkedc/checkedc-clang.git' testType: description: 'Test Type' required: true diff --git a/.github/workflows/check-clang-windows.yml b/.github/workflows/check-clang-windows.yml index bd9c224..62a1f79 100644 --- a/.github/workflows/check-clang-windows.yml +++ b/.github/workflows/check-clang-windows.yml @@ -18,7 +18,7 @@ on: clang_repo: description: 'Clang Repo name' required: true - default: 'https://github.com/checkedc/checkedc-llvm-project.git' + default: 'https://github.com/checkedc/checkedc-clang.git' testType: description: 'Test Type' required: true @@ -53,8 +53,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.9' - - name: Add Python setuptools - run: pip3 install setuptools - name: Checkout Checked C Clang code uses: actions/checkout@v2 with: diff --git a/.github/workflows/checkedc-clang-macos.yml b/.github/workflows/checkedc-clang-macos.yml index e3cfe46..ee9ccb1 100644 --- a/.github/workflows/checkedc-clang-macos.yml +++ b/.github/workflows/checkedc-clang-macos.yml @@ -18,7 +18,7 @@ on: clang_repo: description: 'Clang Repo name' required: true - default: 'https://github.com/checkedc/checkedc-llvm-project.git' + default: 'https://github.com/checkedc/checkedc-clang.git' testType: description: 'Test Type' required: true diff --git a/test_scripts/automation/UNIX/config-vars.sh b/test_scripts/automation/UNIX/config-vars.sh index 844911d..1a47e1f 100755 --- a/test_scripts/automation/UNIX/config-vars.sh +++ b/test_scripts/automation/UNIX/config-vars.sh @@ -203,6 +203,8 @@ if [ "$CHECKEDC_CONFIG_STATUS" == "passed" ]; then echo "Configured environment variables:" echo echo " BUILDCONFIGURATION: $BUILDCONFIGURATION" + echo " CLANG_REPO: $CLANG_REPO" + echo " CHECKEDC_REPO: $CHECKEDC_REPO" echo " BUILD_PACKAGE: $BUILD_PACKAGE" echo " BUILDOS: $BUILDOS" echo " TEST_TARGET_ARCH: $TEST_TARGET_ARCH" diff --git a/test_scripts/automation/Windows/config-vars.bat b/test_scripts/automation/Windows/config-vars.bat index 630bbe3..e9ef121 100644 --- a/test_scripts/automation/Windows/config-vars.bat +++ b/test_scripts/automation/Windows/config-vars.bat @@ -52,6 +52,16 @@ if NOT DEFINED BUILDCONFIGURATION ( exit /b 1 ) +if NOT DEFINED CLANG_REPO ( + echo CLANG_REPO not set: must be set to the URL of the Clang repository + exit /b /1 +) + +if NOT DEFINED CHECKEDC_REPO ( + echo CHECKEDC_REPO not set: must be set to the URL of the Clang repository + exit /b /1 +) + rem Validate build OS if NOT DEFINED BUILDOS ( @@ -195,6 +205,8 @@ if NOT DEFINED MSBUILD_CPU_COUNT ( echo Configured environment variables: echo. echo. BUILDCONFIGURATION: %BUILDCONFIGURATION% +echo. CLANG_REPO: %CLANG_REPO% +echo. CHECKEDC_REPO: %CHECKEDC_REPO% echo. BUILDOS: %BUILDOS% echo. TEST_TARGET_ARCH: %TEST_TARGET_ARCH% echo. TEST_SUITE: %TEST_SUITE% diff --git a/test_scripts/automation/Windows/run-cmake.bat b/test_scripts/automation/Windows/run-cmake.bat index 559a44b..bf12c1c 100644 --- a/test_scripts/automation/Windows/run-cmake.bat +++ b/test_scripts/automation/Windows/run-cmake.bat @@ -14,7 +14,7 @@ set OLD_DIR=%CD% cd %LLVM_OBJ_DIR% -cmake -G Ninja %EXTRA_FLAGS% -DCMAKE_BUILD_TYPE=%BUILDCONFIGURATION% -DLLVM_ENABLE_PROJECTS=clang -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\llvm +cmake -G Ninja %EXTRA_FLAGS% -DCMAKE_BUILD_TYPE=%BUILDCONFIGURATION% -DLLVM_ENABLE_PROJECTS=clang -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON %BUILD_SOURCESDIRECTORY%\checkedc-clang\llvm :succeeded cd %OLD_DIR% diff --git a/test_scripts/automation/Windows/setup-files.bat b/test_scripts/automation/Windows/setup-files.bat index 4839840..1222211 100644 --- a/test_scripts/automation/Windows/setup-files.bat +++ b/test_scripts/automation/Windows/setup-files.bat @@ -13,13 +13,13 @@ if "%BUILD_CHECKEDC_CLEAN%"=="Yes" ( ) ) -if not exist %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\.git ( - git clone -c core.autocrlf=false https://github.com/checkedc/checkedc-llvm-project %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project +if not exist %BUILD_SOURCESDIRECTORY%\checkedc-clang\.git ( + git clone -c core.autocrlf=false %CLANG_REPO% %BUILD_SOURCESDIRECTORY%\checkedc-clang if ERRORLEVEL 1 (goto cmdfailed) ) -if not exist %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\llvm\projects\checkedc-wrapper\checkedc\.git ( - git clone https://github.com/checkedc/checkedc %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\llvm\projects\checkedc-wrapper\checkedc +if not exist %BUILD_SOURCESDIRECTORY%\checkedc-clang\llvm\projects\checkedc-wrapper\checkedc\.git ( + git clone %CHECKEDC_REPO% %BUILD_SOURCESDIRECTORY%\checkedc-clang\llvm\projects\checkedc-wrapper\checkedc if ERRORLEVEL 1 (goto cmdfailed) ) @@ -34,7 +34,7 @@ if "%SIGN_INSTALLER%" NEQ "No" ( ) rem Set up clang sources -cd %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project +cd %BUILD_SOURCESDIRECTORY%\checkedc-clang if ERRORLEVEL 1 (goto cmdfailed) git fetch origin if ERRORLEVEL 1 (goto cmdfailed) @@ -52,7 +52,7 @@ if not exist %LLVM_OBJ_DIR% ( ) rem set up Checked C sources -cd %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\llvm\projects\checkedc-wrapper\checkedc +cd %BUILD_SOURCESDIRECTORY%\checkedc-clang\llvm\projects\checkedc-wrapper\checkedc if ERRORLEVEL 1 (goto cmdfailed) git fetch origin if ERRORLEVEL 1 (goto cmdfailed)