Skip to content

Fix the Docker build of the OS locally and in GitHub Actions - #812

Merged
NevynUK merged 6 commits into
mainfrom
FixDockerBuild
Oct 14, 2026
Merged

NevynUK merged 6 commits into
mainfrom
FixDockerBuild

Conversation

@NevynUK

@NevynUK NevynUK commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Gets build-os.yml working again, and makes the same Docker build work locally (including on Apple Silicon).

  • Dockerfile
    • Pin the base image to ubuntu:22.04. ubuntu:latest no longer provides python3.10, python3-distutils or clang-15.
    • Pin it to linux/amd64, because the bundled toolchain/linux/ld.lld is x86-64 only.
    • Add a HOME that any user can write to. The build runs with --user "$(id -u):$(id -g)", and that UID (501 on macOS, 1001 on GitHub runners) has no passwd entry in the image. That left HOME=/, so git config --global failed.
  • build.sh: distclean now uses $MEADOW_ADDITIONAL_MAKE_OPTIONS (which is -j1 under Docker) instead of a hardcoded -j8. Under Docker, -j8 produced write jobserver: Bad file descriptor errors. Those left stale generated apps/*/Kconfig files containing host paths, which then broke kconfig-conf --olddefconfig.
  • build-os.yml
    • Check out full history (filter: blob:none), because the build number is derived from git history.
    • Check out the only submodules the build needs, mbedtls and mono/external/corefx, rewriting the SSH submodule URLs to authenticated HTTPS.
    • corefx is private and uses the existing GIT_REPO_CHECKOUT_PAT secret. PRs from forks don't get that secret, so they will fail at this step.

Local usage

docker build --platform linux/amd64 -t nuttx-build -f ./DockerFiles/Build/Dockerfile .
docker run --rm --platform linux/amd64 -v $PWD:/project -w /project --user "$(id -u):$(id -g)" nuttx-build ./build.sh --force --clean

Test plan

  • Docker build on macOS (arm64) of an existing working tree: succeeded and produced Meadow.OS.bin, Meadow.OS.Runtime.bin and Meadow.OS.Update.bin.
  • Docker build on a fresh clone with only the mbedtls and mono/external/corefx submodules, mirroring the workflow checkout: succeeded.
  • This PR's Build OS and RT run passes. This also confirms that GIT_REPO_CHECKOUT_PAT can read WildernessLabs/corefx.

🤖 Generated with Claude Code

NevynUK and others added 6 commits October 14, 2026 05:23
- Dockerfile: pin the base image to ubuntu:22.04 (latest no longer has
  python3.10, python3-distutils or clang-15) and to linux/amd64 (the
  bundled toolchain/linux/ld.lld is x86-64 only, needed on Apple Silicon).
- Dockerfile: provide a world writable HOME.  The build runs with
  --user "$(id -u):$(id -g)" and that UID has no passwd entry in the
  image, leaving HOME as "/" so git config --global failed.
- build.sh: use MEADOW_ADDITIONAL_MAKE_OPTIONS for distclean rather than
  a hard coded -j8.  Under Docker -j8 fails with jobserver errors, which
  left stale generated Kconfig files with host paths and broke configure.
- build-os.yml: fetch full history (needed for the build number) and the
  mbedtls and mono/external/corefx submodules, rewriting the SSH
  submodule URLs to authenticated HTTPS.  corefx is private and uses
  the GIT_REPO_CHECKOUT_PAT secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repository is public, so GIT_REPO_CHECKOUT_PAT is only needed for the
private mono/external/corefx submodule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- build-os.yml: add a bcl job that runs build-mono-bcl.sh in the Docker
  image, alongside the OS build.  It needs the mbedtls headers and the
  mono/external submodules (llvm-project is skipped).
- Dockerfile: add rsync, curl/wget (monolite download), ca-certificates
  and cmake (required by Mono's configure when BTLS is enabled).
- build-mono-bcl.sh: do not quote the empty RSYNC_FLAGS.  rsync 3.2.x
  rejects the resulting '' argument ("Empty source arg specified");
  unquoted it expands to nothing on Linux, WSL and macOS alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api-doc-tools needs its nested Lucene.Net.Light submodule to build monodoc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The artifact names and contents match those published by the Azure
pipelines (azure-pipelines.yml and azure-pipelines-bcl.yml).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NevynUK
NevynUK merged commit 1edf5df into main Oct 14, 2026
@NevynUK
NevynUK deleted the FixDockerBuild branch October 14, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant