From b3d359fabfd2fc497f909ce4fde25ef79a780ef3 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Date: Sun, 12 Apr 2026 05:33:48 +0200 Subject: [PATCH] devcontainer: Fix build error on macos (#44126) When building the devcontainer from source on arm macOS, we get arm Ubuntu, for which we don't have a prebuild mozjs version. That triggers a compilation from source, which fails, due to issues finding String.h. I can't confirm this, but it might be because the mounted workspace is case-insensitive. We definitly don't want that, so just make sure that the cargo target directory is in a named volume. That also has the advantage that we don't clobber the hosts target dir and still persist. Testing: Manually tested on macOS. Fixes: ./mach build in a devcontainer built from source on arm64 macOS. Signed-off-by: Jonathan Schwender --- .devcontainer/devcontainer.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f46e08a9d3b..00c378fc4c0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,9 +16,17 @@ "postCreateCommand": "./mach bootstrap --yes", + "mounts": [ + "source=servo-cargo-target,target=/var/servo-cargo-target,type=volume" + ], + "containerEnv": { "CC": "clang", "CXX": "clang++", + // at least on macOS the workspace directory can be mounted as case-insensitve, + // which causes build errors in mozjs. Using a volume avoids this issue, and can + // also improve performance. + "CARGO_TARGET_DIR": "/var/servo-cargo-target", "UV_PROJECT_ENVIRONMENT": ".devcontainer-venv" } }