Commit c99e0e1
chore: Avoid Rosetta on Apple (#228)
This speeds up both building and using the dev container by a lot on
Apple Silicon, see benchmarks below. Unfortunately, the checksums do
not reproduce and developers would have to either wait for PRs to fail
once in CI or run the image with `--platform linux/amd64`.
The major workflows `check_other`, `check_generated_files`,
`check_generated_files_container` all work in the new dev container on
an aarch64 host. What doesn't work is running some apps on in the
container (as opposed to on device). These can run outside the
container in most cases so in the unlikely event that it impacts
anyone, there's a workaround available.
## Benchmarks
These ran on an Apple M4 Max.
`time docker build --no-cache -f .devcontainer/Dockerfile .`:
- before: 5:55.01
- after: 3:08.48 (-47%)
These are the steps that took the most time:
```
Before After
=> [stage-2 9/10] RUN ./install-system-packages.sh ... 58.6s 22.0s
=> [stage-2 10/10] RUN --mount=type=bind,target=/con ... 245.7s 119.4s
=> exporting to image ... 45.4s 44.3s
=> => exporting layers ... 30.8s 30.6s
=> => unpacking to ... 14.6s 13.7s
```
Unsurprisingly, the most time saved was from commands running
containerized. These run more than twice as fast. This is reflected
also when building apps inside the dev container:
```
rm -r target-aarch64/
time make build
```
- before: 0m20.285s
- after: 0m7.264s (-64%)
## Details
`.devcontainer/Dockerfile`:
- Update to Debian trixie to avoid `version 'GLIBC_2.39' not found`
errors when running `cargo-acap-sdk`. The best explanation I could
find for this is that the host pre-built standard lib depends on
different versions depending on the platform they were build on.
`.devhost/install-rust.sh`:
- Use platform appropriate `rustup-init` to avoid the problem
documented in #70.
`README.md`:
- Update the suggested docker commands to one that can easily be
adapted to run `make check_generated_files_container`.
Note that `inspect_env` still doesn't reproduce.
## Footers
Related-to: #229
Co-authored-by: Jovy <joeiphone08@gmail.com>1 parent 8de8796 commit c99e0e1
File tree
5 files changed
+53
-36
lines changed- .devcontainer
- .devhost
5 files changed
+53
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
7 | 19 | | |
8 | | - | |
9 | | - | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
12 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| 69 | + | |
65 | 70 | | |
66 | | - | |
67 | | - | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
0 commit comments