diff options
| -rw-r--r-- | .github/workflows/r52_fvp.yml | 5 | ||||
| -rw-r--r-- | .github/workflows/regression_template.yml | 106 | ||||
| -rw-r--r-- | ports_module/cortex_a35/ac6/inc/txm_module_port.h | 12 | ||||
| -rw-r--r-- | ports_module/cortex_a35/gnu/inc/txm_module_port.h | 12 | ||||
| -rw-r--r-- | ports_module/cortex_a35_smp/ac6/inc/txm_module_port.h | 12 | ||||
| -rw-r--r-- | ports_module/cortex_a35_smp/gnu/inc/txm_module_port.h | 12 | ||||
| -rwxr-xr-x | scripts/install.sh | 8 | ||||
| -rwxr-xr-x | scripts/install_riscv.sh | 12 |
8 files changed, 156 insertions, 23 deletions
diff --git a/.github/workflows/r52_fvp.yml b/.github/workflows/r52_fvp.yml index 2293e1bd..b7184abd 100644 --- a/.github/workflows/r52_fvp.yml +++ b/.github/workflows/r52_fvp.yml @@ -22,7 +22,8 @@ name: r52_fvp # # - the default configuration -- the images gcc_check's CMake stage builds, # but run rather than merely linked, plus the FVP module manager example, -# whose two images are the module isolation tests; +# whose two images are the module isolation tests. They link every portable +# module manager source, so common_modules/ is among the trigger paths; # - the feature configuration -- the same images with VFP and the hard float # ABI, FIQ, IRQ nesting and FIQ nesting. Those four options gate whole # assembly blocks (the VMRS/VSTMDB/VLDMIA sequences, the FIQ context paths, @@ -44,6 +45,7 @@ on: - "CMakeLists.txt" - "cmake/cortex_r52*.cmake" - "common/**" + - "common_modules/**" - "ports/cortex_r52/**" - "ports_module/cortex_r52/**" pull_request: @@ -58,6 +60,7 @@ on: - "CMakeLists.txt" - "cmake/cortex_r52*.cmake" - "common/**" + - "common_modules/**" - "ports/cortex_r52/**" - "ports_module/cortex_r52/**" diff --git a/.github/workflows/regression_template.yml b/.github/workflows/regression_template.yml index 392f6a96..decfadd4 100644 --- a/.github/workflows/regression_template.yml +++ b/.github/workflows/regression_template.yml @@ -41,6 +41,21 @@ on: default: 15 required: false type: number + # Minutes for the test step. Sixty covers every ThreadX suite, whose + # longest observed run is 37 minutes. NetX Duo runs all 43 configurations + # of its full suite in this one step, which took 201 minutes on 25 Oct + # 2026, so it passes a larger value. + test_timeout_minutes: + default: 60 + required: false + type: number + # Keep the .deb files apt downloads in the install step in the Actions + # cache, so a later run installs them without fetching them again. See the + # apt cache steps below. + apt_cache: + default: true + required: false + type: boolean skip_test: default: false required: false @@ -123,6 +138,59 @@ jobs: with: submodules: true + # The apt cache. The install scripts retry and bound every fetch, but a + # mirror can be slow without being down: on 23 Oct 2026 it served packages + # at 50 to 250 KB/s while indexes still came at 12 MB/s, and the ThreadX and + # RISC-V installs timed out on all three attempts inside an 11 MB and a 58 MB + # file. With the .deb files restored from the Actions cache, apt fetches + # only the indexes and whatever changed since the cache was saved. + # + # It is done here rather than in the install scripts so that every caller's + # script gets it unchanged: an apt.conf.d entry points apt-get's archive + # directory at the restored one. A restored file cannot alter what is + # installed, because apt checks every .deb against the hash in the signed + # index before using it, and fetches it again if the two differ. + # + # The key carries the runner image, whose package versions the cache + # matches, and the install script, whose package list it holds. A miss on + # either still restores the closest older cache, so a new image or one + # added package costs only the packages that changed. + - name: Prepare the apt cache key + id: apt_key + if: ${{ inputs.apt_cache }} + env: + INSTALL_SCRIPT: ${{ inputs.install_script }} + run: | + echo "dir=${RUNNER_TEMP}/apt-archives" >> "$GITHUB_OUTPUT" + echo "image=${ImageOS}-${ImageVersion}" >> "$GITHUB_OUTPUT" + echo "script=$( (sha256sum "$INSTALL_SCRIPT" 2> /dev/null || echo none) | cut -c1-16)" >> "$GITHUB_OUTPUT" + + - name: Restore the apt cache + id: apt_restore + if: ${{ inputs.apt_cache }} + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ steps.apt_key.outputs.dir }} + key: apt-${{ steps.apt_key.outputs.image }}-${{ steps.apt_key.outputs.script }} + restore-keys: | + apt-${{ steps.apt_key.outputs.image }}- + apt- + + # apt downloads as the unprivileged _apt user, which must own partial/. + # Keep-Downloaded-Packages is set because the apt front end deletes what it + # installed by default; apt-get keeps it, but a caller's script may use + # either. + - name: Point apt at the cache + if: ${{ inputs.apt_cache }} + env: + APT_DIR: ${{ steps.apt_key.outputs.dir }} + run: | + sudo mkdir -p "$APT_DIR/partial" + sudo chown _apt:root "$APT_DIR/partial" + printf 'Dir::Cache::Archives "%s/";\nAPT::Keep-Downloaded-Packages "true";\nBinary::apt::APT::Keep-Downloaded-Packages "true";\n' "$APT_DIR" \ + | sudo tee /etc/apt/apt.conf.d/99-ci-archive-cache > /dev/null + echo "apt cache: $(find "$APT_DIR" -maxdepth 1 -name '*.deb' | wc -l) packages restored" + # apt and PyPI have stalled this step twice, for 55 minutes and for over two # hours, against a normal 27 to 152 seconds. Nothing here had a timeout, so a # stall ran until the six hour job limit and cost a whole run rather than @@ -131,6 +199,29 @@ jobs: timeout-minutes: ${{ inputs.install_timeout_minutes }} run: ${{ inputs.install_script }} + # Saved straight after the install rather than at the end of the job, so a + # run whose tests fail still leaves the packages for the next one. autoclean + # drops .deb files the indexes no longer list, so the cache does not grow + # with every superseded version. apt's lock file and partial/ are root-only + # and are removed so the cache action, which runs unprivileged, can read the + # rest. + - name: Save the apt cache + if: ${{ inputs.apt_cache && steps.apt_restore.outputs.cache-hit != 'true' }} + env: + APT_DIR: ${{ steps.apt_key.outputs.dir }} + run: | + sudo apt-get autoclean -qq + sudo rm -rf "$APT_DIR/partial" "$APT_DIR/lock" + sudo chmod -R a+rX "$APT_DIR" + echo "apt cache: $(find "$APT_DIR" -maxdepth 1 -name '*.deb' | wc -l) packages, $(du -sh "$APT_DIR" | cut -f1)" + + - name: Upload the apt cache + if: ${{ inputs.apt_cache && steps.apt_restore.outputs.cache-hit != 'true' }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ steps.apt_key.outputs.dir }} + key: apt-${{ steps.apt_key.outputs.image }}-${{ steps.apt_key.outputs.script }} + # TX_COVERAGE instruments every build configuration rather than only the one # whose name ends in _coverage. It has to be set for the build as well as the # test: the build is where -fprofile-arcs is decided, and the test run is @@ -142,7 +233,7 @@ jobs: run: ${{ inputs.build_script }} - name: Test - timeout-minutes: 60 + timeout-minutes: ${{ inputs.test_timeout_minutes }} env: TX_COVERAGE: ${{ inputs.skip_coverage && 'OFF' || 'ON' }} run: ${{ inputs.test_script }} @@ -276,9 +367,20 @@ jobs: # run_tests that is cancelled -- which is what a job that never gets a runner # ends up as -- leaves both false and lets the deploy proceed to download an # artifact the cancelled job never uploaded. + # + # The one exception is a caller passing skip_test, such as the deploy jobs + # of ThreadX and NetX Duo: run_tests is skipped by design, and the steps below + # download the coverage the caller's other jobs uploaded. The caller's needs + # gates those jobs. !cancelled() is required because an if without a status + # function implies success(), which is false when run_tests is skipped. deploy_code_coverage: runs-on: ubuntu-24.04 - if: ((github.event_name == 'push') || (github.event_name == 'workflow_dispatch')) && !inputs.skip_coverage && !inputs.skip_deploy && needs.run_tests.result == 'success' + if: >- + !cancelled() && + ((github.event_name == 'push') || (github.event_name == 'workflow_dispatch')) && + !inputs.skip_coverage && !inputs.skip_deploy && + (needs.run_tests.result == 'success' || + (inputs.skip_test && needs.run_tests.result == 'skipped')) needs: run_tests environment: name: github-pages diff --git a/ports_module/cortex_a35/ac6/inc/txm_module_port.h b/ports_module/cortex_a35/ac6/inc/txm_module_port.h index cbe6b8e3..51eb1362 100644 --- a/ports_module/cortex_a35/ac6/inc/txm_module_port.h +++ b/ports_module/cortex_a35/ac6/inc/txm_module_port.h @@ -8,6 +8,7 @@ * * SPDX-License-Identifier: MIT **************************************************************************/ +// Portions of this file were generated with AI assistance. /**************************************************************************/ @@ -114,9 +115,11 @@ The following extensions must also be defined in tx_port.h: #define TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS 0x00000004 -/* Define the supported options for this module. */ +/* Define the supported options for this module. Module threads run at the Module Manager's + exception level and call it directly, so this port cannot isolate a module and refuses + user mode and memory protection at load. */ -#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_USER_MODE | TXM_MODULE_MEMORY_PROTECTION | TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) +#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) #define TXM_MODULE_MANAGER_REQUIRED_OPTIONS 0 @@ -255,8 +258,9 @@ typedef struct TXM_MODULE_MANAGER_MEMORY_FAULT_INFO_STRUCT /* Define the macros to perform port-specific checks when passing pointers to the kernel. */ -/* Define macro to make sure object is inside the module's data. */ -#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_SUCCESS) +/* Define macro to make sure object is inside the module's data. No module on this port has + memory protection, so this is never asked; any range is refused if it is. */ +#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_FALSE) /* Define some internal prototypes to this module port. */ diff --git a/ports_module/cortex_a35/gnu/inc/txm_module_port.h b/ports_module/cortex_a35/gnu/inc/txm_module_port.h index e5654cde..9daa6308 100644 --- a/ports_module/cortex_a35/gnu/inc/txm_module_port.h +++ b/ports_module/cortex_a35/gnu/inc/txm_module_port.h @@ -8,6 +8,7 @@ * * SPDX-License-Identifier: MIT **************************************************************************/ +// Portions of this file were generated with AI assistance. /**************************************************************************/ @@ -114,9 +115,11 @@ The following extensions must also be defined in tx_port.h: #define TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS 0x00000004 -/* Define the supported options for this module. */ +/* Define the supported options for this module. Module threads run at the Module Manager's + exception level and call it directly, so this port cannot isolate a module and refuses + user mode and memory protection at load. */ -#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_USER_MODE | TXM_MODULE_MEMORY_PROTECTION | TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) +#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) #define TXM_MODULE_MANAGER_REQUIRED_OPTIONS 0 @@ -255,8 +258,9 @@ typedef struct TXM_MODULE_MANAGER_MEMORY_FAULT_INFO_STRUCT /* Define the macros to perform port-specific checks when passing pointers to the kernel. */ -/* Define macro to make sure object is inside the module's data. */ -#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_SUCCESS) +/* Define macro to make sure object is inside the module's data. No module on this port has + memory protection, so this is never asked; any range is refused if it is. */ +#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_FALSE) /* Define some internal prototypes to this module port. */ diff --git a/ports_module/cortex_a35_smp/ac6/inc/txm_module_port.h b/ports_module/cortex_a35_smp/ac6/inc/txm_module_port.h index 97930b4f..35ec29c4 100644 --- a/ports_module/cortex_a35_smp/ac6/inc/txm_module_port.h +++ b/ports_module/cortex_a35_smp/ac6/inc/txm_module_port.h @@ -8,6 +8,7 @@ * * SPDX-License-Identifier: MIT **************************************************************************/ +// Portions of this file were generated with AI assistance. /**************************************************************************/ @@ -114,9 +115,11 @@ The following extensions must also be defined in tx_port.h: #define TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS 0x00000004 -/* Define the supported options for this module. */ +/* Define the supported options for this module. Module threads run at the Module Manager's + exception level and call it directly, so this port cannot isolate a module and refuses + user mode and memory protection at load. */ -#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_USER_MODE | TXM_MODULE_MEMORY_PROTECTION | TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) +#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) #define TXM_MODULE_MANAGER_REQUIRED_OPTIONS 0 @@ -250,8 +253,9 @@ typedef struct TXM_MODULE_MANAGER_MEMORY_FAULT_INFO_STRUCT /* Define the macros to perform port-specific checks when passing pointers to the kernel. */ -/* Define macro to make sure object is inside the module's data. */ -#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_SUCCESS) +/* Define macro to make sure object is inside the module's data. No module on this port has + memory protection, so this is never asked; any range is refused if it is. */ +#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_FALSE) /* Define some internal prototypes to this module port. */ diff --git a/ports_module/cortex_a35_smp/gnu/inc/txm_module_port.h b/ports_module/cortex_a35_smp/gnu/inc/txm_module_port.h index 99e7d056..c92ea9ce 100644 --- a/ports_module/cortex_a35_smp/gnu/inc/txm_module_port.h +++ b/ports_module/cortex_a35_smp/gnu/inc/txm_module_port.h @@ -8,6 +8,7 @@ * * SPDX-License-Identifier: MIT **************************************************************************/ +// Portions of this file were generated with AI assistance. /**************************************************************************/ @@ -114,9 +115,11 @@ The following extensions must also be defined in tx_port.h: #define TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS 0x00000004 -/* Define the supported options for this module. */ +/* Define the supported options for this module. Module threads run at the Module Manager's + exception level and call it directly, so this port cannot isolate a module and refuses + user mode and memory protection at load. */ -#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_USER_MODE | TXM_MODULE_MEMORY_PROTECTION | TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) +#define TXM_MODULE_MANAGER_SUPPORTED_OPTIONS (TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS) #define TXM_MODULE_MANAGER_REQUIRED_OPTIONS 0 @@ -250,8 +253,9 @@ typedef struct TXM_MODULE_MANAGER_MEMORY_FAULT_INFO_STRUCT /* Define the macros to perform port-specific checks when passing pointers to the kernel. */ -/* Define macro to make sure object is inside the module's data. */ -#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_SUCCESS) +/* Define macro to make sure object is inside the module's data. No module on this port has + memory protection, so this is never asked; any range is refused if it is. */ +#define TXM_MODULE_MANAGER_CHECK_INSIDE_DATA(module_instance, obj_ptr, obj_size) (TX_FALSE) /* Define some internal prototypes to this module port. */ diff --git a/scripts/install.sh b/scripts/install.sh index cb80c899..57796c9f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -10,6 +10,8 @@ # SPDX-License-Identifier: MIT ############################################################################## +# Portions of this file were generated with AI assistance. + # # Install necessary softwares for Ubuntu. @@ -48,6 +50,11 @@ if ! retry sudo "${TIMEOUT[@]}" apt-get "${APT_OPTIONS[@]}" update; then echo "install.sh: gate and fails if any package needed is unavailable." echo "" fi +# CMake is not installed from apt: the pip install at the end of this script +# provides it, and on a runner the image's own CMake comes first on PATH anyway. +# The apt package was never used, and with its data package it was 13 of the +# 34 MB this install fetched. On 23 Oct 2026 the mirror served it at about +# 90 KB/s, and all three attempts timed out inside that one file. retry sudo "${TIMEOUT[@]}" apt-get "${APT_OPTIONS[@]}" install -y \ gcc-multilib \ git \ @@ -58,7 +65,6 @@ retry sudo "${TIMEOUT[@]}" apt-get "${APT_OPTIONS[@]}" install -y \ p7zip-full \ tofrodos \ gawk \ - cmake \ software-properties-common || exit 1 retry "${TIMEOUT[@]}" python3 -m pip install --retries 3 --timeout 30 --upgrade pip || exit 1 diff --git a/scripts/install_riscv.sh b/scripts/install_riscv.sh index 21e3ac85..801885c6 100755 --- a/scripts/install_riscv.sh +++ b/scripts/install_riscv.sh @@ -56,11 +56,17 @@ fi # job that runs qemu-system-riscv64 headless. That download is what pushes the # install past its two-minute budget on a slow mirror, and a larger budget is # not available: TIMEOUT_LONG is already sized so three attempts fit the step cap. +# +# CMake is installed only when none is on PATH. The runner image carries a newer +# one in /usr/local/bin, which shadows the apt package, so on a runner that +# package was 13 MB downloaded and never run. +packages=(qemu-system-misc ninja-build) +if ! command -v cmake > /dev/null; then + packages+=(cmake) +fi retry sudo "${TIMEOUT[@]}" apt-get "${APT_OPTIONS[@]}" install -y \ --no-install-recommends \ - qemu-system-misc \ - ninja-build \ - cmake || exit 1 + "${packages[@]}" || exit 1 echo "=== Downloading RISC-V GCC toolchain (${RELEASE_TAG}) ===" |
