Skip to content

Commit 50e7d02

Browse files
committed
Added pixi environment for the ease of bootstrapping new development machines
1 parent acd0463 commit 50e7d02

7 files changed

Lines changed: 1237 additions & 17 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11

22
*.sh text eol=lf
3+
# SCM syntax highlighting & preventing 3-way merges
4+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff

.github/workflows/build-firmware.yaml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,17 @@ jobs:
2222
with:
2323
submodules: recursive
2424

25-
# Build machines don't have arm-none-eabi gcc, so let's download it and put it on the path
26-
- name: Download & Install GCC
27-
env:
28-
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
29-
run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time
30-
wget 'https://github.com/rusefi/build_support/raw/master/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz' -O compiler.tar.xz
31-
tar -xvf compiler.tar.xz
32-
echo "::add-path::`pwd`/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin"
33-
34-
# Make sure the compiler we just downloaded works - just print out the version
35-
- name: Test Compiler
36-
run: arm-none-eabi-gcc -v
25+
- uses: prefix-dev/setup-pixi@v0.9.4
26+
with:
27+
pixi-version: v0.63.2
28+
cache: true
3729

3830
- name: Install build tools
3931
run: |
4032
sudo apt-get install srecord libarchive-zip-perl
4133
4234
- name: Build Firmware
43-
working-directory: ./firmware/boards/${{matrix.build-target}}
44-
run: ./build_wideband.sh
35+
run: pixi run build ${{matrix.build-target}}
4536

4637
- name: Attach binaries
4738
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ build/
6565

6666
# cortex-debug vscode extension local state
6767
.vscode/.cortex-debug*state.json
68+
# pixi environments
69+
.pixi/*
70+
!.pixi/config.toml

firmware/boards/build_f1_board.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,19 @@ mkdir -p ${DELIVER_DIR}
3030
rm -f ${DELIVER_DIR}/*
3131

3232
if uname | grep "NT"; then
33-
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.exe
33+
if command -v hex2dfu.exe >/dev/null 2>&1; then
34+
HEX2DFU=hex2dfu.exe
35+
else
36+
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.exe
37+
fi
3438
SREC_CAT=srec_cat.exe
3539
else
36-
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.bin
37-
chmod u+x $HEX2DFU
40+
if command -v hex2dfu >/dev/null 2>&1; then
41+
HEX2DFU=hex2dfu
42+
else
43+
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.bin
44+
chmod u+x $HEX2DFU
45+
fi
3846
SREC_CAT=srec_cat
3947
fi
4048

pixi.lock

Lines changed: 1166 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[workspace]
2+
channels = ["conda-forge", "xtitoris"]
3+
name = "wideband"
4+
platforms = ["win-64", "linux-64", "osx-arm64"]
5+
version = "0.1.0"
6+
7+
[tasks]
8+
clean = { cmd = "make clean", cwd = "firmware" }
9+
build-tests = { cmd = "make -j8", cwd = "test" }
10+
tests = { cmd = "build/wideband_test", cwd = "test", depends-on = ["build-tests"], env = { SAN_OPTIONS = "detect_stack_use_after_return=1" } }
11+
12+
[tasks.build]
13+
args = ["board"]
14+
cmd = "cd firmware/boards/{{ board }} && bash build_wideband.sh"
15+
16+
[dependencies]
17+
make = ">=4.4.1,<5"
18+
arm-gnu-toolchain = ">=15.2.rel1,<16"
19+
hex2dfu = ">=0.21.0,<0.22"
20+
srecord = ">=1.65,<2"
21+
22+
[target.linux-64.dependencies]
23+
gcc = ">=15.2.0,<15.3"
24+
gxx = ">=15.2.0,<15.3"
25+
26+
[target.win-64.dependencies]
27+
m2-coreutils = "*"
28+
m2-bash = "*"
29+
m2-grep = "*"
30+
gcc = ">=15.2.0,<15.3"
31+
gxx = ">=15.2.0,<15.3"
32+
33+
[target.osx-arm64.dependencies]
34+
clang = ">=19.1.7,<19.2"
35+
clangxx = ">=19.1.7,<19.2"

test/Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,21 @@ else
130130
TRGT =
131131
endif
132132

133+
ifeq ($(IS_MAC),yes)
134+
CC = clang
135+
CPPC = clang++
136+
LD = clang++
137+
CP = $(TRGT)objcopy
138+
AS = clang -x assembler-with-cpp
139+
OD = $(TRGT)objdump
140+
else
133141
CC = $(TRGT)gcc
134142
CPPC = $(TRGT)g++
135143
LD = $(TRGT)g++
136144
CP = $(TRGT)objcopy
137145
AS = $(TRGT)gcc -x assembler-with-cpp
138146
OD = $(TRGT)objdump
147+
endif
139148
HEX = $(CP) -O ihex
140149
BIN = $(CP) -O binary
141150

@@ -206,3 +215,9 @@ endif
206215
PROJECT = wideband_test
207216

208217
include rules.mk
218+
219+
# Clean main firmware build artifacts when "make clean" is run in the test directory, since the test code depends on the firmware code
220+
# and will not compile if the firmware code was previously built for a different target
221+
CLEAN_RULE_HOOK:
222+
$(MAKE) -C $(FIRMWARE_DIR) clean || true
223+
rm -rf $(FIRMWARE_DIR)/.dep $(FIRMWARE_DIR)/build

0 commit comments

Comments
 (0)