Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/scripts/baremetal_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,16 @@ pipx install conan>=$CONAN_VERSION
conan config install https://github.com/libhal/conan-config2.git
conan hal setup

# Loop over architectures and build types
# Loop over architectures and build types. Only the first package runs the
# test_package: it rebuilds every imported C++ module just to link one small
# program, which roughly doubles the cost of each package, and linking against
# the other architectures adds little.
TEST_FOLDER_ARGS=()
for ARCH in "${ARCH_LIST[@]}"; do
echo "Building for architecture: $ARCH"

for BUILD_TYPE in "${BUILD_TYPES[@]}"; do
conan create $DIR -s:h build_type=$BUILD_TYPE -s:h os=baremetal -s:h arch=$ARCH --version $VERSION -pr:h $COMPILER_PROFILE --build=missing $EXTRA_CONAN_ARGS
conan create $DIR -s:h build_type=$BUILD_TYPE -s:h os=baremetal -s:h arch=$ARCH --version $VERSION -pr:h $COMPILER_PROFILE --build=missing "${TEST_FOLDER_ARGS[@]}" $EXTRA_CONAN_ARGS
TEST_FOLDER_ARGS=(--test-folder "")
done
done
15 changes: 8 additions & 7 deletions .github/workflows/package_and_upload_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ jobs:
'[{name: "M sample", archs: $archs}]')
cortex_m_gcc="cortex-m0plus,$sample"
else
# Deploy: every build type and Cortex-M core. LLVM splits the
# cores across two jobs because one job for all of them is slow.
# Deploy: every build type and Cortex-M core. Building every core in
# one job is slow, so LLVM builds them in three parallel jobs.
build_types="Debug,MinSizeRel,Release"
older="cortex-m3,cortex-m4,cortex-m4f,cortex-m7f,cortex-m7d"
newer="cortex-m23,cortex-m33,cortex-m33f,cortex-m35pf,cortex-m55,cortex-m85"
cortex_m_llvm=$(jq -nc --arg older "$armv6m$older" --arg newer "$newer" \
'[{name: "M0-M7", archs: $older}, {name: "M23-M85", archs: $newer}]')
cortex_m_gcc="cortex-m0,cortex-m0plus,cortex-m1,$older,$newer"
cortex_m_llvm=$(jq -nc --arg armv6m "$armv6m" '[
{ name: "M0-M4", archs: ($armv6m + "cortex-m3,cortex-m4") },
{ name: "M4F-M23", archs: "cortex-m4f,cortex-m7f,cortex-m7d,cortex-m23" },
{ name: "M33-M85", archs: "cortex-m33,cortex-m33f,cortex-m35pf,cortex-m55,cortex-m85" }
]')
cortex_m_gcc="cortex-m0,cortex-m0plus,cortex-m1,cortex-m3,cortex-m4,cortex-m4f,cortex-m7f,cortex-m7d,cortex-m23,cortex-m33,cortex-m33f,cortex-m35pf,cortex-m55,cortex-m85"
fi

{
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ It runs in one of two modes, picked by `version`:
| --- | --- | --- |
| Build types | `MinSizeRel` | `Debug`, `MinSizeRel`, `Release` |
| Linux x86_64, Linux armv8, macOS armv8 (LLVM) | ✅ | ✅ |
| Cortex-M (LLVM) | M0+, M3, M4F, M33F in one job | M0, M0+, M1, M3, M4, M4F, M7F, M7D and M23, M33, M33F, M35PF, M55, M85 in two jobs |
| Cortex-M (LLVM) | M0+, M3, M4F, M33F in one job | M0, M0+, M1, M3, M4, M4F, M7F, M7D, M23, M33, M33F, M35PF, M55, M85, split evenly across three jobs |
| Cortex-M (GCC, when `modules_support_needed` is false) | M0+, M3, M4F, M33F | every Cortex-M architecture |

Check mode keeps pull requests and pushes to main cheap. Deploys still build
Expand All @@ -420,6 +420,11 @@ place and the build jobs read its outputs. ARMv6-M (M0, M0+, M1) is left out of
Host jobs time out after 30 minutes and Cortex-M jobs after 45, so a hung
runner can't run for hours.

Within each Cortex-M job, only the first package runs its `test_package`. A
test_package rebuilds every imported C++ module (mp-units, libhal, ...) just to
link one program, so running it for every architecture and build type roughly
doubled the job's time.

**Usage:**

```yaml
Expand Down
Loading