mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
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 <schwenderjonathan@gmail.com>
33 lines
1.1 KiB
JSON
33 lines
1.1 KiB
JSON
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
|
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
|
|
{
|
|
"name": "Ubuntu",
|
|
"image": "ghcr.io/servo/servo/devcontainer-ubuntu:latest",
|
|
// Alternatively, uncomment the "build" property below to build the image from the Dockerfile in this folder.
|
|
// "build": {
|
|
// "dockerfile": "Ubuntu.Dockerfile",
|
|
// "context": ".."
|
|
// },
|
|
|
|
|
|
// Most dependencies are installed in the image, but we run mach bootstrap to ensure
|
|
// the environment matches what's expected in the current servo version, which might
|
|
// have changed since the image was built.
|
|
"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"
|
|
}
|
|
}
|