Skip to content

Commit ed3b702

Browse files
committed
update: README.md, CHANGELOG.md, bump actions/checkout@v7
1 parent 786a6d9 commit ed3b702

4 files changed

Lines changed: 77 additions & 68 deletions

File tree

.github/workflows/natmod.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
}
7676

7777
steps:
78-
- uses: actions/checkout@v6
78+
- uses: actions/checkout@v7
7979
with:
8080
submodules: recursive
8181

@@ -119,7 +119,7 @@ jobs:
119119
- { suffix: _sp, precision: single }
120120
- { suffix: _dp, precision: double }
121121
steps:
122-
- uses: actions/checkout@v6
122+
- uses: actions/checkout@v7
123123
with:
124124
submodules: recursive
125125

@@ -162,7 +162,7 @@ jobs:
162162
- { suffix: _sp, precision: single }
163163
- { suffix: _dp, precision: double }
164164
steps:
165-
- uses: actions/checkout@v6
165+
- uses: actions/checkout@v7
166166
with:
167167
submodules: recursive
168168

@@ -202,7 +202,7 @@ jobs:
202202
if: ${{ !cancelled() }}
203203
runs-on: ubuntu-latest
204204
steps:
205-
- uses: actions/checkout@v6
205+
- uses: actions/checkout@v7
206206
with:
207207
submodules: recursive
208208

@@ -260,7 +260,7 @@ jobs:
260260
# if: ${{ !cancelled() }}
261261
# runs-on: ubuntu-latest
262262
# steps:
263-
# - uses: actions/checkout@v6
263+
# - uses: actions/checkout@v7
264264

265265
# - name: Fetch MicroPython ${{ env.MPY_TAG }}
266266
# run: |

.github/workflows/usermod.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
name: build + test (armhf / qemu-arm)
2323
runs-on: ubuntu-26.04-arm
2424
steps:
25-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@v7
2626
with:
2727
submodules: 'true'
2828
fetch-depth: 0
@@ -61,7 +61,7 @@ jobs:
6161
name: build + test (mipsel / qemu-mipsel)
6262
runs-on: ubuntu-latest
6363
steps:
64-
- uses: actions/checkout@v6
64+
- uses: actions/checkout@v7
6565
with:
6666
submodules: 'true'
6767
fetch-depth: 0
@@ -98,7 +98,7 @@ jobs:
9898
name: build + test (aarch64)
9999
runs-on: ubuntu-26.04-arm
100100
steps:
101-
- uses: actions/checkout@v6
101+
- uses: actions/checkout@v7
102102
with:
103103
submodules: 'true'
104104
fetch-depth: 0
@@ -142,7 +142,7 @@ jobs:
142142
name: build + test (armv7m_sp / QEMU Cortex-M3)
143143
runs-on: ubuntu-26.04-arm
144144
steps:
145-
- uses: actions/checkout@v6
145+
- uses: actions/checkout@v7
146146
with:
147147
submodules: 'true'
148148
fetch-depth: 0
@@ -163,7 +163,7 @@ jobs:
163163
name: build + test (x64)
164164
runs-on: ubuntu-latest
165165
steps:
166-
- uses: actions/checkout@v6
166+
- uses: actions/checkout@v7
167167
with:
168168
submodules: 'true'
169169
fetch-depth: 0
@@ -205,7 +205,7 @@ jobs:
205205
name: build + test (x86)
206206
runs-on: ubuntu-latest
207207
steps:
208-
- uses: actions/checkout@v6
208+
- uses: actions/checkout@v7
209209
with:
210210
submodules: 'true'
211211
fetch-depth: 0
@@ -241,7 +241,7 @@ jobs:
241241
name: build + artifact (rp2040)
242242
runs-on: ubuntu-latest
243243
steps:
244-
- uses: actions/checkout@v6
244+
- uses: actions/checkout@v7
245245
with:
246246
submodules: 'true'
247247
fetch-depth: 0

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

12+
#### `usermod/` — x86, armhf, armv7m builds moved inside Docker
13+
14+
All targets that require standalone libffi (`autoreconf` + `deplibs`) or a bare-metal
15+
toolchain are now fully self-contained inside pinned Ubuntu 22.04 Docker images.
16+
This eliminates `autotools` version sensitivity (Ubuntu 24.04+ breaks libffi's
17+
`configure.ac` from MicroPython v1.28) and removes all host-side toolchain requirements
18+
beyond Docker itself.
19+
20+
| Target | Dockerfile | What runs inside |
21+
|--------|-----------|-----------------|
22+
| `x86` / `x86sp` | `Dockerfile.x86` | mpy-cross, autoreconf, deplibs, main build |
23+
| `armhf` / `armhfsp` | `Dockerfile.armhf` | mpy-cross, autoreconf, deplibs, main build, strip |
24+
| `qemu-armv7m` | `Dockerfile.armv7m` | mpy-cross, firmware build, QEMU test |
25+
| `mipsel` / `mipselsp` | `Dockerfile.mipsel` | mpy-cross, submodules, deplibs, main build, strip |
26+
27+
- `usermod/Dockerfile.x86`: Ubuntu 22.04 + `gcc-multilib g++-multilib` + autotools.
28+
- `usermod/Dockerfile.armhf`: Ubuntu 22.04 + `gcc-arm-linux-gnueabihf` + autotools.
29+
- `usermod/Dockerfile.armv7m`: Ubuntu 22.04 + `gcc-arm-none-eabi libnewlib-arm-none-eabi qemu-system-arm python3-serial`.
30+
- New `make qemu-armv7m` target: runs the full Cortex-M3 build **and** test inside Docker via `usermod/ci/run_qemu.py`.
31+
- `apt-deps` Makefile target removed (superseded by Docker).
32+
- `.github/workflows/usermod.yml`:
33+
- `build-test-x86`: removed `Install deps` and `Build mpy-cross` steps; single `make x86 / make x86sp` step.
34+
- `build-test-armhf`: runner changed `ubuntu-22.04``ubuntu-26.04-arm`; removed `Install cross-compiler`, `Build mpy-cross`, `Build standalone libffi` steps; build step is now `make armhf`; only `Install QEMU` + test remain on the host.
35+
- `build-test-qemu-armv7m`: runner changed `ubuntu-latest``ubuntu-26.04-arm`; all 5 steps (toolchain install, mpy-cross, version header, firmware build, test) replaced with a single `make qemu-armv7m`.
36+
1237
#### `usermod/Makefile` — mipsel builds inside Docker
13-
- `mipsel` / `mipselsp` targets now run inside a Docker container (Ubuntu 20.04 + `gcc-mipsel-linux-gnu`) instead of requiring the toolchain on the host. Docker image is built automatically on first run from `usermod/Dockerfile.mipsel` and reused on subsequent builds.
14-
- `usermod/Dockerfile.mipsel`: Ubuntu 20.04, `libtool-bin` included for `autoreconf`/`deplibs`; no host toolchain install needed for mipsel.
38+
- `mipsel` / `mipselsp` targets now run inside a Docker container (Ubuntu 22.04 + `gcc-mipsel-linux-gnu`) instead of requiring the toolchain on the host. Docker image is built automatically on first run from `usermod/Dockerfile.mipsel` and reused on subsequent builds.
39+
- `usermod/Dockerfile.mipsel`: Ubuntu 22.04, `libtool-bin` included for `autoreconf`/`deplibs`; no host toolchain install needed for mipsel.
1540
- Build sequence inside container: `mpy-cross``submodules``deplibs` → main build. Output lands on the host at `usermod/build/mipsel_{dp,sp}/micropython` via Docker volume mount.
1641
- `.github/workflows/usermod.yml` `build-mipsel` job simplified: toolchain install, mpy-cross, and deplibs steps removed; replaced with a single `make mipsel MPY_DIR=...` step.
1742

README.md

Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ and all flag / index constants.
4242
│ ├── micropython.mk # Picked up by py.mk via USER_C_MODULES
4343
│ ├── micropython.cmake # CMake entry point for RP2040 / pico-sdk
4444
│ ├── manifest.py # Freezes tiny_bclibc.py into firmware
45-
│ ├── Dockerfile.mipsel # Ubuntu 22.04 + mipsel cross-compiler
45+
│ ├── Dockerfile.x86 # Ubuntu 22.04 + gcc-multilib (x86 builds)
46+
│ ├── Dockerfile.armhf # Ubuntu 22.04 + gcc-arm-linux-gnueabihf
47+
│ ├── Dockerfile.armv7m # Ubuntu 22.04 + gcc-arm-none-eabi + qemu-system-arm
48+
│ ├── Dockerfile.mipsel # Ubuntu 22.04 + gcc-mipsel-linux-gnu
4649
│ └── ci/run_qemu.py # QEMU UART bridge for usermod CI tests
4750
4851
├── ffimod/ # FFI-based access (any unix arch)
@@ -196,18 +199,19 @@ available as a built-in. Use this approach when:
196199
All commands are run from `usermod/`.
197200

198201
```bash
199-
make x64 # x64 double (default)
200-
make x64sp # x64 single
201-
make x86 # x86 double [requires gcc-multilib; standalone static]
202-
make x86sp # x86 single
203-
make aarch64 # AArch64 double (cross: aarch64-linux-gnu-, static)
204-
make aarch64sp # AArch64 single
205-
make armhf # ARMv7hf double (cross: arm-linux-gnueabihf-, static)
206-
make armhfsp # ARMv7hf single
207-
make mipsel # MIPS LE double (cross: mipsel-linux-gnu-, static)
208-
make mipselsp # MIPS LE single
209-
make rp2040 # RP2040 single (cmake, pico-sdk)
210-
make rp2040dp # RP2040 double
202+
make x64 # x64 double (default)
203+
make x64sp # x64 single
204+
make x86 # x86 double [Docker — no host toolchain needed]
205+
make x86sp # x86 single [Docker]
206+
make aarch64 # AArch64 double (cross: aarch64-linux-gnu-, static)
207+
make aarch64sp # AArch64 single
208+
make armhf # ARMv7hf double [Docker — no host toolchain needed]
209+
make armhfsp # ARMv7hf single [Docker]
210+
make mipsel # MIPS LE double [Docker]
211+
make mipselsp # MIPS LE single [Docker]
212+
make qemu-armv7m # Cortex-M3 build + test [Docker]
213+
make rp2040 # RP2040 single (cmake, pico-sdk)
214+
make rp2040dp # RP2040 double
211215
```
212216

213217
Output for unix targets: `usermod/build/<target>/micropython`
@@ -219,17 +223,15 @@ Precision is passed as `TINY_BCLIBC_PRECISION=single|double` for make-based port
219223
### Prerequisites
220224

221225
```bash
222-
# For armhf / aarch64 cross-compile targets
223-
sudo apt-get install \
224-
autoconf automake libtool libtool-bin \
225-
gcc-arm-linux-gnueabihf \ # armhf
226-
gcc-aarch64-linux-gnu \ # aarch64
227-
gcc-multilib # x86
226+
# x64 / x64sp — host gcc only (already installed)
228227

229-
# mipsel — builds inside Docker (Ubuntu 22.04); no host toolchain needed:
230-
# make mipsel MPY_DIR=... (Docker image built automatically on first run)
228+
# aarch64 / aarch64sp — cross-compiler on host
229+
sudo apt-get install gcc-aarch64-linux-gnu
231230

232-
# For rp2040
231+
# x86, armhf, mipsel, qemu-armv7m — Docker only, no host toolchain needed:
232+
# Docker images are built automatically on first run from usermod/Dockerfile.*
233+
234+
# rp2040 / rp2040dp — bare-metal ARM toolchain
233235
sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi
234236
```
235237

@@ -264,46 +266,28 @@ vfs.mount(bdev, '/')
264266

265267
### Test (QEMU Cortex-M3 / armv7m_sp)
266268

267-
```bash
268-
sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi qemu-system-arm
269-
pip install pyserial
270-
271-
MPY_DIR=/path/to/micropython-1.28.0
272-
make -C "$MPY_DIR/mpy-cross"
273-
make generated MPY_DIR="$MPY_DIR"
274-
275-
make -C "$MPY_DIR/ports/qemu" BOARD=MPS2_AN385 \
276-
USER_C_MODULES="$(pwd)/.." \
277-
FROZEN_MANIFEST="$(pwd)/manifest.py" \
278-
TINY_BCLIBC_PRECISION=single
269+
Runs entirely inside Docker — no host toolchain needed:
279270

280-
MPY_DIR="$MPY_DIR" python3 ci/run_qemu.py \
281-
"$MPY_DIR/ports/qemu/build-MPS2_AN385/firmware.elf" \
282-
../tests/
271+
```bash
272+
cd usermod
273+
make qemu-armv7m MPY_DIR=/path/to/micropython-1.28.0
283274
```
284275

285-
Unlike the natmod QEMU runner, `ci/run_qemu.py` sends `test_bclibc.py` directly to the
286-
UART REPL — no `.mpy` injection step, because the module is already built into the firmware.
276+
The `qemu-armv7m` target builds the Docker image on first run, then inside the container:
277+
mpy-cross → version header → MPS2_AN385 firmware → `ci/run_qemu.py` test.
287278

288-
### Standalone static build (cross, for qemu-user testing)
279+
### Test (armhf / qemu-arm)
289280

290-
Cross-compile targets (`armhf`, `aarch64`, `mipsel`) use `MICROPY_STANDALONE=1` and
291-
`LDFLAGS_EXTRA="-static"` to produce fully static binaries. These run directly under
292-
`qemu-arm` / `qemu-aarch64` / `qemu-mipsel` without needing matching shared libraries.
281+
```bash
282+
cd usermod
283+
make armhf MPY_DIR=/path/to/micropython-1.28.0
284+
qemu-arm build/armhf_dp/micropython ../tests/test_bclibc.py
285+
```
293286

294-
Building libffi from source (required by `MICROPY_STANDALONE=1`) needs `libtool-bin`
295-
so that `lib/libffi/autogen.sh → autoreconf` can find `libtoolize`:
287+
The build runs inside Docker (`Dockerfile.armhf`). Only `qemu-arm` is needed on the host:
296288

297289
```bash
298-
sudo apt-get install autoconf automake libtool libtool-bin pkg-config
299-
USERMOD_BUILD="$(pwd)/build"
300-
make -C "$MPY_DIR/ports/unix" VARIANT=standard \
301-
BUILD="$USERMOD_BUILD/armhf" \
302-
CROSS_COMPILE=arm-linux-gnueabihf- \
303-
MICROPY_STANDALONE=1 LDFLAGS_EXTRA="-static" \
304-
deplibs
305-
make armhf MPY_DIR="$MPY_DIR"
306-
qemu-arm build/armhf/micropython ../tests/test_bclibc.py
290+
sudo apt-get install qemu-user
307291
```
308292

309293
### natmod vs usermod comparison

0 commit comments

Comments
 (0)