-
Notifications
You must be signed in to change notification settings - Fork 2
feat(qemu): provision Linux runtime libraries instead of requiring apt #1352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
160b1cf
feat(qemu): provision Linux runtime libraries instead of requiring apt
zackees 5105278
refactor(qemu): move runtime probing into esp_qemu_runtime + update l…
zackees 45bf93a
fix(qemu): use NormalizedPath in the runtime module + refresh inventory
zackees ec98f15
fix(qemu): lower bundle glibc floor to 2.30 and harden the builder
zackees 42a9886
chore(ci): refresh platform-boundary inventory line numbers
zackees d01726c
test(ci): raise the platform-boundary ledger count to 14
zackees 6be0328
fix(qemu): require every direct dependency before accepting a cached …
zackees File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: QEMU Linux Runtime | ||
|
|
||
| # Proves fbuild can start Espressif QEMU on a stock Linux runner without any | ||
| # host library installation. `ubuntu-latest` (24.04) ships none of libslirp, | ||
| # libSDL2 or libpixman, which the Espressif QEMU binaries link against — so | ||
| # this job is red unless fbuild provisions them itself. | ||
| # | ||
| # There is deliberately NO apt-get step here. Adding one would make the job | ||
| # pass for the wrong reason. | ||
|
|
||
| on: | ||
| workflow_dispatch: {} | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'crates/fbuild-toolchain/**' | ||
| - 'crates/fbuild-daemon/src/handlers/emulator/**' | ||
| - 'ci/build_qemu_linux_runtime.py' | ||
| - '.github/workflows/qemu-linux-runtime.yml' | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'crates/fbuild-toolchain/**' | ||
| - 'crates/fbuild-daemon/src/handlers/emulator/**' | ||
| - 'ci/build_qemu_linux_runtime.py' | ||
| - '.github/workflows/qemu-linux-runtime.yml' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUSTFLAGS: "-D warnings" | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | ||
|
|
||
| jobs: | ||
| qemu_runtime: | ||
| name: QEMU starts with no host libraries (ubuntu-latest) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Confirm the runner really is missing the libraries | ||
| # Documents the premise of the test. Informational: a future runner | ||
| # image that ships them makes the test exercise the host path, which | ||
| # is still a valid pass. | ||
| run: | | ||
| for lib in libslirp.so.0 libSDL2-2.0.so.0 libpixman-1.so.0; do | ||
| if ldconfig -p | grep -q "$lib"; then | ||
| echo "present: $lib" | ||
| else | ||
| echo "absent: $lib <- fbuild must provision this" | ||
| fi | ||
| done | ||
|
|
||
| - uses: astral-sh/setup-uv@v3 | ||
|
|
||
| - name: Setup soldr | ||
| uses: zackees/setup-soldr@v0 | ||
| with: | ||
| version: 0.8.23 | ||
| cache: true | ||
| build-cache: true | ||
| target-cache: true | ||
| prebuild-deps: none | ||
| linker: platform-default | ||
|
|
||
| - name: QEMU runtime provisioning test | ||
| run: | | ||
| soldr cargo test -p fbuild-toolchain --test qemu_linux_runtime -- \ | ||
| --ignored --nocapture | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Build QEMU Linux Runtime Bundle | ||
|
|
||
| # Manually-dispatched builder for the runtime-library bundles fbuild downloads | ||
| # when a Linux host cannot start Espressif QEMU on its own. | ||
| # | ||
| # The bundle is always built inside an ubuntu:20.04 container, so the libraries | ||
| # it carries need at most GLIBC_2.30 — the same floor the Espressif QEMU | ||
| # binaries themselves have. The runner only supplies the CPU architecture: | ||
| # aarch64 needs a native arm64 runner because dpkg's maintainer scripts fail | ||
| # under emulated arm64. | ||
| # | ||
| # Upload the resulting artifacts to the `qemu-linux-runtime-v1` release and | ||
| # paste the printed SHA-256 into | ||
| # crates/fbuild-toolchain/src/toolchain/esp_qemu_runtime.rs. | ||
|
|
||
| on: | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| bundle: | ||
| name: ${{ matrix.arch }} | ||
| runs-on: ${{ matrix.runner }} | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: x86_64 | ||
| runner: ubuntu-latest | ||
| - arch: aarch64 | ||
| runner: ubuntu-24.04-arm | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: astral-sh/setup-uv@v3 | ||
|
|
||
| - name: Build bundle | ||
| run: | | ||
| uv run --no-project python ci/build_qemu_linux_runtime.py \ | ||
| --arch ${{ matrix.arch }} --out dist/qemu-runtime | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: qemu-esp-linux-runtime-${{ matrix.arch }} | ||
| path: dist/qemu-runtime/* | ||
| if-no-files-found: error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.