Skip to content

Commit 2acf608

Browse files
Prune zephyr manifest (#30)
* Vibe Coded West Manifest * Vibe Coded West Manifest * Trying to Fix CI * Bump to Test CI * Improving CI with Caching * Trying to fix cache * Verification Patch * Introduce build-lite * Added generate-lite * Moving Submodules * Removing Things We Don't Need * Attempting to Cache Submodules * Attempting to Cache Submodules * Initing the Modules * Trying Some Git Commit Stuff * Attempting Direct Clone * Reduce * Use make submodules * working * Fix order --------- Co-authored-by: Nate Gay <[email protected]>
1 parent d1b1502 commit 2acf608

File tree

5 files changed

+181
-22
lines changed

5 files changed

+181
-22
lines changed

.github/workflows/ci.yaml

Lines changed: 75 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,81 @@ jobs:
1414
- name: Lint
1515
run: |
1616
make fmt
17+
1718
build:
1819
runs-on: ubuntu-latest
20+
1921
steps:
20-
- uses: actions/checkout@v4
21-
- name: Build
22-
run: |
23-
make build
24-
- name: Archive
25-
uses: actions/upload-artifact@v4
26-
with:
27-
name: artifacts
28-
path: |
29-
build-artifacts/zephyr.uf2
30-
build-artifacts/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
submodules: false # We'll handle submodules with smart caching
26+
fetch-depth: 0
27+
28+
- name: Cache submodules
29+
id: cache-submodules
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
lib/fprime
34+
lib/fprime-zephyr
35+
lib/zephyr-workspace/zephyr
36+
key: project-deps-${{ hashFiles('.gitmodules') }}-v3
37+
restore-keys: |
38+
project-deps-${{ hashFiles('.gitmodules') }}-
39+
project-deps-
40+
41+
- name: Setup submodules
42+
if: steps.cache-submodules.outputs.cache-hit != 'true'
43+
run: |
44+
make submodules
45+
46+
- name: Cache python environment
47+
id: cache-python
48+
uses: actions/cache@v4
49+
with:
50+
path: fprime-venv
51+
key: python-packages-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3
52+
restore-keys: |
53+
python-packages-${{ runner.os }}-
54+
python-packages-
55+
56+
- name: Setup python environment
57+
if: steps.cache-python.outputs.cache-hit != 'true'
58+
run: |
59+
make fprime-venv
60+
61+
- name: Cache Zephyr workspace and SDK
62+
id: cache-zephyr
63+
uses: actions/cache@v4
64+
with:
65+
path: |
66+
lib/zephyr-workspace/modules
67+
lib/zephyr-workspace/bootloader
68+
~/zephyr-sdk-0.17.2
69+
key: zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3
70+
restore-keys: |
71+
zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-
72+
zephyr-minimal-
73+
74+
- name: Setup Zephyr
75+
if: steps.cache-zephyr.outputs.cache-hit != 'true'
76+
run: |
77+
make zephyr-setup
78+
env:
79+
PIP_DISABLE_PIP_VERSION_CHECK: 1
80+
PIP_NO_COMPILE: 1
81+
82+
- name: Build
83+
run: |
84+
# Skip both zephyr-setup and submodules since we cached them separately
85+
make build -o zephyr-setup -o submodules
86+
87+
- name: Upload build artifacts
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: artifacts
91+
path: |
92+
build-artifacts/zephyr.uf2
93+
build-artifacts/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json
94+
retention-days: 30

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
####
55

66
cmake_minimum_required(VERSION 3.24.2)
7+
8+
# Set BOARD_ROOT to find custom boards
9+
# The structure is BOARD_ROOT/boards/vendor/board
10+
list(APPEND BOARD_ROOT "${CMAKE_CURRENT_LIST_DIR}")
11+
712
# Patch in std-atomic implementations
813
if (BOARD STREQUAL "rpi_pico" OR FPRIME_ZEPHYR_USE_STD_ATOMIC_FIX)
914
include_directories(BEFORE "${CMAKE_CURRENT_LIST_DIR}/lib/fprime-zephyr/fprime-zephyr/Os/StdAtomic")

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ fprime-venv: ## Create a virtual environment
2121

2222
.PHONY: zephyr-setup
2323
zephyr-setup: fprime-venv ## Set up Zephyr environment
24-
@test -s lib/zephyr-workspace/tools/edtt/.gitignore || { \
24+
@test -d lib/zephyr-workspace/modules/hal/rpi_pico || test -d ../lib/zephyr-workspace/modules/hal/rpi_pico || { \
2525
echo "Setting up Zephyr environment..."; \
26-
cd lib/zephyr-workspace && \
27-
$(UVX) west update && \
28-
$(UVX) west zephyr-export && \
29-
$(UV) run west packages pip --install && \
30-
$(UV) run west sdk install; \
26+
rm -rf ../.west/ && \
27+
$(UVX) west init --local . && \
28+
$(UVX) west update && \
29+
$(UVX) west zephyr-export && \
30+
$(UV) run west packages pip --install && \
31+
$(UV) run west sdk install --toolchains arm-zephyr-eabi; \
3132
}
3233

3334
##@ Development
@@ -67,6 +68,12 @@ clean: ## Remove all gitignored files
6768
clean-zephyr: ## Remove all Zephyr build files
6869
rm -rf lib/zephyr-workspace/bootloader lib/zephyr-workspace/modules lib/zephyr-workspace/tools
6970

71+
.PHONY: clean-zephyr-sdk
72+
clean-zephyr-sdk: ## Remove Zephyr SDK (reinstall with 'make zephyr-setup')
73+
@echo "Removing Zephyr SDK..."
74+
rm -rf ~/zephyr-sdk-*
75+
@echo "Run 'make zephyr-setup' to reinstall with minimal ARM-only toolchain"
76+
7077
##@ Operations
7178

7279
.PHONY: gds

lib/zephyr-workspace/.west/config

Lines changed: 0 additions & 5 deletions
This file was deleted.

west.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# West manifest for PROVES Core - Optimized for RP2040/RP2350 only
2+
# This minimal manifest significantly reduces the download and setup time
3+
# by only including modules required for Raspberry Pi RP2040/RP2350 builds
4+
5+
manifest:
6+
defaults:
7+
remote: upstream
8+
9+
remotes:
10+
- name: upstream
11+
url-base: https://github.com/zephyrproject-rtos
12+
13+
# Import filter to exclude optional groups
14+
group-filter: [-babblesim, -optional]
15+
16+
projects:
17+
# Zephyr RTOS core
18+
- name: zephyr
19+
repo-path: zephyr
20+
revision: v4.2.0
21+
path: lib/zephyr-workspace/zephyr
22+
west-commands: scripts/west-commands.yml
23+
import:
24+
# Import specific submanifests only (instead of all submanifests)
25+
name-allowlist:
26+
- cmsis # ARM CMSIS support (required for Cortex-M)
27+
- hal_rpi_pico # Raspberry Pi Pico HAL (REQUIRED for RP2040/RP2350)
28+
- picolibc # C library
29+
- mbedtls # Crypto library
30+
- tinycrypt # Lightweight crypto library
31+
- mcuboot # Bootloader support
32+
33+
# Core modules required for RP2040/RP2350
34+
- name: cmsis
35+
revision: 512cc7e895e8491696b61f7ba8066b4a182569b8
36+
path: lib/zephyr-workspace/modules/hal/cmsis
37+
groups:
38+
- hal
39+
40+
- name: cmsis_6
41+
repo-path: CMSIS_6
42+
revision: 06d952b6713a2ca41c9224a62075e4059402a151
43+
path: lib/zephyr-workspace/modules/hal/cmsis_6
44+
groups:
45+
- hal
46+
47+
- name: hal_rpi_pico
48+
path: lib/zephyr-workspace/modules/hal/rpi_pico
49+
revision: 7b57b24588797e6e7bf18b6bda168e6b96374264
50+
groups:
51+
- hal
52+
53+
- name: hal_st
54+
revision: 9f81b4427e955885398805b7bca0da3a8cd9109c
55+
path: lib/zephyr-workspace/modules/hal/st
56+
groups:
57+
- hal
58+
59+
- name: picolibc
60+
path: lib/zephyr-workspace/modules/lib/picolibc
61+
revision: 560946f26db075c296beea5b39d99e6de43c9010
62+
63+
- name: loramac-node
64+
revision: fb00b383072518c918e2258b0916c996f2d4eebe
65+
path: lib/zephyr-workspace/modules/lib/loramac-node
66+
67+
# Crypto libraries (commonly used)
68+
- name: mbedtls
69+
revision: 85440ef5fffa95d0e9971e9163719189cf34d979
70+
path: lib/zephyr-workspace/modules/crypto/mbedtls
71+
groups:
72+
- crypto
73+
74+
- name: tinycrypt
75+
revision: 1012a3ebee18c15ede5efc8332ee2fc37817670f
76+
path: lib/zephyr-workspace/modules/crypto/tinycrypt
77+
groups:
78+
- crypto
79+
80+
# Bootloader support (optional - remove if not needed)
81+
- name: mcuboot
82+
revision: 4eba8087fa606db801455f14d185255bc8c49467
83+
path: lib/zephyr-workspace/bootloader/mcuboot
84+
groups:
85+
- bootloader
86+
87+
self:
88+
path: .

0 commit comments

Comments
 (0)