I have try to cross compile the offical anki sync server for aarch64 using the following docker files:
FROM --platform=$BUILDPLATFORM rust AS builder
SHELL ["/bin/bash", "-uo", "pipefail", "-c"]
ARG version
ENV TARGET aarch64-unknown-linux-musl
RUN rustup target add "$TARGET"
ENV version 23.12.1
COPY cargo-config.toml $CARGO_HOME/config.toml
RUN echo "$CARGO_HOME/config.toml"
RUN cat "$CARGO_HOME/config.toml"
RUN apt-get -y update && apt-get -y install protobuf-compiler musl clang mold musl musl-dev musl-tools
ENV PROTOC=/usr/bin/protoc
RUN echo "build version ${version}"
RUN
RUN cargo install --locked --target "$TARGET" --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server
RUN ldd /usr/local/cargo/bin/anki-sync-server
FROM --platform=$BUILDPLATFORM scratch
ENV SYNC_BASE=/data
COPY --from=builder --chmod=0755 /usr/local/cargo/bin/anki-sync-server /
CMD ["./anki-sync-server"]
and the following cargo-config.toml
[env]
CC_aarch64-unknown-linux-musl = "clang -target aarch64-unknown-linux-musl -fuse-ld=mold"
CXX_aarch64-unknown-linux-musl = "clang++ -target aarch64-unknown-linux-musl -fuse-ld=mold"
CC_x86_64-unknown-linux-musl = "clang -target x86_64-unknown-linux-musl -fuse-ld=mold"
CXX_x86_64-unknown-linux-musl = "clang++ -target x86_64-unknown-linux-musl -fuse-ld=mold"
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
[target.x86_64-unknown-linux-musl]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
[target.aarch64-unknown-linux-musl]
linker = "clang"
rustflags = ["-C", "link-arg=--target=aarch64-unknown-linux-musl", "-C", "link-arg=-fuse-ld=mold"]
[target.armv7-unknown-linux-musleabihf]
linker = "clang"
rustflags = ["-C", "link-arg=--target=armv7-unknown-linux-musleabihf", "-C", "link-arg=-fuse-ld=mold"]
But I hit the following error:
#13 27.86 The following warnings were emitted during compilation:
#13 27.86
#13 27.86 warning: libsqlite3-sys@0.27.0: clang: warning: argument unused during compilation: '-fuse-ld=mold' [-Wunused-command-line-argument]
#13 27.86 warning: libsqlite3-sys@0.27.0: In file included from sqlite3/sqlite3.c:14494:
#13 27.86 warning: libsqlite3-sys@0.27.0: /usr/include/stdio.h:27:10: fatal error: 'bits/libc-header-start.h' file not found
#13 27.86 warning: libsqlite3-sys@0.27.0: #include <bits/libc-header-start.h>
#13 27.86 warning: libsqlite3-sys@0.27.0: ^~~~~~~~~~~~~~~~~~~~~~~~~~
#13 27.86 warning: libsqlite3-sys@0.27.0: 1 error generated.
#13 27.86
#13 27.86 error: failed to run custom build command for `libsqlite3-sys v0.27.0`
#13 27.86
#13 27.86 Caused by:
#13 27.86 process didn't exit successfully: `/tmp/cargo-install854K7z/release/build/libsqlite3-sys-40d6f2a2955646f2/build-script-build` (exit status: 1)
#13 27.86 --- stdout
#13 27.86 cargo:rerun-if-env-changed=LIBSQLITE3_SYS_USE_PKG_CONFIG
#13 27.86 cargo:rerun-if-changed=sqlite3/sqlite3.c
#13 27.86 cargo:rerun-if-changed=sqlite3/wasm32-wasi-vfs.c
#13 27.86 cargo:rerun-if-env-changed=SQLITE_MAX_VARIABLE_NUMBER
#13 27.86 cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH
#13 27.86 cargo:rerun-if-env-changed=SQLITE_MAX_COLUMN
#13 27.86 cargo:rerun-if-env-changed=LIBSQLITE3_FLAGS
#13 27.86 TARGET = Some("aarch64-unknown-linux-musl")
#13 27.86 OPT_LEVEL = Some("3")
#13 27.86 HOST = Some("x86_64-unknown-linux-gnu")
#13 27.86 cargo:rerun-if-env-changed=CC_aarch64-unknown-linux-musl
#13 27.86 CC_aarch64-unknown-linux-musl = Some("clang -target aarch64-unknown-linux-musl -fuse-ld=mold")
#13 27.86 cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
#13 27.86 CRATE_CC_NO_DEFAULTS = None
#13 27.86 DEBUG = Some("false")
#13 27.86 cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-linux-musl
#13 27.86 CFLAGS_aarch64-unknown-linux-musl = None
#13 27.86 cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_linux_musl
#13 27.86 CFLAGS_aarch64_unknown_linux_musl = None
#13 27.86 cargo:rerun-if-env-changed=TARGET_CFLAGS
#13 27.86 TARGET_CFLAGS = None
#13 27.86 cargo:rerun-if-env-changed=CFLAGS
#13 27.86 CFLAGS = None
#13 27.86 running: "clang" "-target" "aarch64-unknown-linux-musl" "-fuse-ld=mold" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-unknown-linux-musl" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/tmp/cargo-install854K7z/aarch64-unknown-linux-musl/release/build/libsqlite3-sys-de3696f7792b01b2/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c"
#13 27.86 cargo:warning=clang: warning: argument unused during compilation: '-fuse-ld=mold' [-Wunused-command-line-argument]
#13 27.86
#13 27.86 cargo:warning=In file included from sqlite3/sqlite3.c:14494:
#13 27.86
#13 27.86 cargo:warning=/usr/include/stdio.h:27:10: fatal error: 'bits/libc-header-start.h' file not found
#13 27.86
#13 27.86 cargo:warning=#include <bits/libc-header-start.h>
#13 27.86
#13 27.86 cargo:warning= ^~~~~~~~~~~~~~~~~~~~~~~~~~
#13 27.86
#13 27.86 cargo:warning=1 error generated.
#13 27.86
#13 27.86 exit status: 1
#13 27.86
#13 27.86 --- stderr
#13 27.86
#13 27.86
#13 27.86 error occurred: Command "clang" "-target" "aarch64-unknown-linux-musl" "-fuse-ld=mold" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-unknown-linux-musl" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/tmp/cargo-install854K7z/aarch64-unknown-linux-musl/release/build/libsqlite3-sys-de3696f7792b01b2/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c" with args "clang" did not execute successfully (status code exit status: 1).
#13 27.86
#13 27.86
#13 27.86 warning: build failed, waiting for other jobs to finish...
#13 30.40 error: failed to compile `anki-sync-server v0.0.0 (https://github.com/ankitects/anki.git?tag=23.12.1#1a1d4d54)`, intermediate artifacts can be found at `/tmp/cargo-install854K7z`.
#13 30.40 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
#13 ERROR: process "/bin/bash -uo pipefail -c cargo install --locked --target \"$TARGET\" --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server" did not complete successfully: exit code: 101
------
> [builder 9/10] RUN cargo install --locked --target "aarch64-unknown-linux-musl" --git https://github.com/ankitects/anki.git --tag 23.12.1 anki-sync-server:
27.86
27.86 --- stderr
27.86
27.86
27.86 error occurred: Command "clang" "-target" "aarch64-unknown-linux-musl" "-fuse-ld=mold" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-unknown-linux-musl" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/tmp/cargo-install854K7z/aarch64-unknown-linux-musl/release/build/libsqlite3-sys-de3696f7792b01b2/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c" with args "clang" did not execute successfully (status code exit status: 1).
27.86
27.86
27.86 warning: build failed, waiting for other jobs to finish...
30.40 error: failed to compile `anki-sync-server v0.0.0 (https://github.com/ankitects/anki.git?tag=23.12.1#1a1d4d54)`, intermediate artifacts can be found at `/tmp/cargo-install854K7z`.
30.40 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
------
Dockerfile:18
--------------------
16 | RUN echo "build version ${version}"
17 | RUN
18 | >>> RUN cargo install --locked --target "$TARGET" --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server
19 | RUN ldd /usr/local/cargo/bin/anki-sync-server
20 |
--------------------
ERROR: failed to solve: process "/bin/bash -uo pipefail -c cargo install --locked --target \"$TARGET\" --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server" did not complete successfully: exit code: 101
The internet suggest to install gcc-multilib
, but installing an gcc package to compile with musl sound wrong. However if you try this anyway, you hit the following error:
#13 24.36 The following warnings were emitted during compilation:
#13 24.36
#13 24.36 warning: libsqlite3-sys@0.27.0: clang: warning: argument unused during compilation: '-fuse-ld=mold' [-Wunused-command-line-argument]
#13 24.36 warning: libsqlite3-sys@0.27.0: In file included from sqlite3/sqlite3.c:28902:
#13 24.36 warning: libsqlite3-sys@0.27.0: /usr/include/pthread.h:698:6: error: 'regparm' is not valid on this platform
#13 24.36 warning: libsqlite3-sys@0.27.0: __cleanup_fct_attribute;
#13 24.36 warning: libsqlite3-sys@0.27.0: ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.36 warning: libsqlite3-sys@0.27.0: /usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.36 warning: libsqlite3-sys@0.27.0: # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.36 warning: libsqlite3-sys@0.27.0: ^ ~
#13 24.36 warning: libsqlite3-sys@0.27.0: In file included from sqlite3/sqlite3.c:28902:
#13 24.36 warning: libsqlite3-sys@0.27.0: /usr/include/pthread.h:710:3: error: 'regparm' is not valid on this platform
#13 24.36 warning: libsqlite3-sys@0.27.0: __cleanup_fct_attribute;
#13 24.36 warning: libsqlite3-sys@0.27.0: ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.36 warning: libsqlite3-sys@0.27.0: /usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.36 warning: libsqlite3-sys@0.27.0: # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.36 warning: libsqlite3-sys@0.27.0: ^ ~
#13 24.36 warning: libsqlite3-sys@0.27.0: In file included from sqlite3/sqlite3.c:28902:
#13 24.37 warning: libsqlite3-sys@0.27.0: /usr/include/pthread.h:733:6: error: 'regparm' is not valid on this platform
#13 24.37 warning: libsqlite3-sys@0.27.0: __cleanup_fct_attribute;
#13 24.37 warning: libsqlite3-sys@0.27.0: ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.37 warning: libsqlite3-sys@0.27.0: /usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.37 warning: libsqlite3-sys@0.27.0: # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.37 warning: libsqlite3-sys@0.27.0: ^ ~
#13 24.37 warning: libsqlite3-sys@0.27.0: In file included from sqlite3/sqlite3.c:28902:
#13 24.37 warning: libsqlite3-sys@0.27.0: /usr/include/pthread.h:746:3: error: 'regparm' is not valid on this platform
#13 24.37 warning: libsqlite3-sys@0.27.0: __cleanup_fct_attribute;
#13 24.37 warning: libsqlite3-sys@0.27.0: ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.37 warning: libsqlite3-sys@0.27.0: /usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.37 warning: libsqlite3-sys@0.27.0: # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.37 warning: libsqlite3-sys@0.27.0: ^ ~
#13 24.37 warning: libsqlite3-sys@0.27.0: In file included from sqlite3/sqlite3.c:28902:
#13 24.37 warning: libsqlite3-sys@0.27.0: /usr/include/pthread.h:751:6: error: 'regparm' is not valid on this platform
#13 24.37 warning: libsqlite3-sys@0.27.0: __cleanup_fct_attribute __attribute__ ((__noreturn__))
#13 24.38 warning: libsqlite3-sys@0.27.0: ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.38 warning: libsqlite3-sys@0.27.0: /usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.38 warning: libsqlite3-sys@0.27.0: # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.38 warning: libsqlite3-sys@0.27.0: ^ ~
#13 24.38 warning: libsqlite3-sys@0.27.0: 5 errors generated.
#13 24.38
#13 24.38 error: failed to run custom build command for `libsqlite3-sys v0.27.0`
#13 24.38
#13 24.38 Caused by:
#13 24.38 process didn't exit successfully: `/tmp/cargo-install1Pjfnx/release/build/libsqlite3-sys-40d6f2a2955646f2/build-script-build` (exit status: 1)
#13 24.38 --- stdout
#13 24.38 cargo:rerun-if-env-changed=LIBSQLITE3_SYS_USE_PKG_CONFIG
#13 24.38 cargo:rerun-if-changed=sqlite3/sqlite3.c
#13 24.38 cargo:rerun-if-changed=sqlite3/wasm32-wasi-vfs.c
#13 24.38 cargo:rerun-if-env-changed=SQLITE_MAX_VARIABLE_NUMBER
#13 24.38 cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH
#13 24.38 cargo:rerun-if-env-changed=SQLITE_MAX_COLUMN
#13 24.38 cargo:rerun-if-env-changed=LIBSQLITE3_FLAGS
#13 24.38 TARGET = Some("aarch64-unknown-linux-musl")
#13 24.38 OPT_LEVEL = Some("3")
#13 24.38 HOST = Some("x86_64-unknown-linux-gnu")
#13 24.38 cargo:rerun-if-env-changed=CC_aarch64-unknown-linux-musl
#13 24.38 CC_aarch64-unknown-linux-musl = Some("clang -target aarch64-unknown-linux-musl -fuse-ld=mold")
#13 24.38 cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
#13 24.38 CRATE_CC_NO_DEFAULTS = None
#13 24.38 DEBUG = Some("false")
#13 24.38 cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-linux-musl
#13 24.38 CFLAGS_aarch64-unknown-linux-musl = None
#13 24.38 cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_linux_musl
#13 24.38 CFLAGS_aarch64_unknown_linux_musl = None
#13 24.38 cargo:rerun-if-env-changed=TARGET_CFLAGS
#13 24.38 TARGET_CFLAGS = None
#13 24.38 cargo:rerun-if-env-changed=CFLAGS
#13 24.38 CFLAGS = None
#13 24.38 running: "clang" "-target" "aarch64-unknown-linux-musl" "-fuse-ld=mold" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-unknown-linux-musl" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/tmp/cargo-install1Pjfnx/aarch64-unknown-linux-musl/release/build/libsqlite3-sys-de3696f7792b01b2/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c"
#13 24.38 cargo:warning=clang: warning: argument unused during compilation: '-fuse-ld=mold' [-Wunused-command-line-argument]
#13 24.38
#13 24.38 cargo:warning=In file included from sqlite3/sqlite3.c:28902:
#13 24.38
#13 24.38 cargo:warning=/usr/include/pthread.h:698:6: error: 'regparm' is not valid on this platform
#13 24.38
#13 24.38 cargo:warning= __cleanup_fct_attribute;
#13 24.38
#13 24.38 cargo:warning= ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.38
#13 24.38 cargo:warning=/usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.38
#13 24.38 cargo:warning=# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.38
#13 24.38 cargo:warning= ^ ~
#13 24.38
#13 24.38 cargo:warning=In file included from sqlite3/sqlite3.c:28902:
#13 24.38
#13 24.38 cargo:warning=/usr/include/pthread.h:710:3: error: 'regparm' is not valid on this platform
#13 24.38
#13 24.38 cargo:warning= __cleanup_fct_attribute;
#13 24.38
#13 24.38 cargo:warning= ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.38
#13 24.38 cargo:warning=/usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.38
#13 24.38 cargo:warning=# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.38
#13 24.38 cargo:warning= ^ ~
#13 24.38
#13 24.38 cargo:warning=In file included from sqlite3/sqlite3.c:28902:
#13 24.38
#13 24.38 cargo:warning=/usr/include/pthread.h:733:6: error: 'regparm' is not valid on this platform
#13 24.38
#13 24.38 cargo:warning= __cleanup_fct_attribute;
#13 24.38
#13 24.38 cargo:warning= ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.38
#13 24.38 cargo:warning=/usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.38
#13 24.38 cargo:warning=# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.38
#13 24.38 cargo:warning= ^ ~
#13 24.38
#13 24.38 cargo:warning=In file included from sqlite3/sqlite3.c:28902:
#13 24.38
#13 24.38 cargo:warning=/usr/include/pthread.h:746:3: error: 'regparm' is not valid on this platform
#13 24.38
#13 24.38 cargo:warning= __cleanup_fct_attribute;
#13 24.38
#13 24.38 cargo:warning= ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.38
#13 24.38 cargo:warning=/usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.38
#13 24.38 cargo:warning=# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.38
#13 24.38 cargo:warning= ^ ~
#13 24.38
#13 24.38 cargo:warning=In file included from sqlite3/sqlite3.c:28902:
#13 24.38
#13 24.38 cargo:warning=/usr/include/pthread.h:751:6: error: 'regparm' is not valid on this platform
#13 24.38
#13 24.38 cargo:warning= __cleanup_fct_attribute __attribute__ ((__noreturn__))
#13 24.38
#13 24.38 cargo:warning= ^~~~~~~~~~~~~~~~~~~~~~~
#13 24.38
#13 24.38 cargo:warning=/usr/include/bits/pthreadtypes-arch.h:52:50: note: expanded from macro '__cleanup_fct_attribute'
#13 24.38
#13 24.38 cargo:warning=# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
#13 24.38
#13 24.38 cargo:warning= ^ ~
#13 24.38
#13 24.38 cargo:warning=5 errors generated.
#13 24.38
#13 24.38 exit status: 1
#13 24.38
#13 24.38 --- stderr
#13 24.38
#13 24.38
#13 24.38 error occurred: Command "clang" "-target" "aarch64-unknown-linux-musl" "-fuse-ld=mold" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-unknown-linux-musl" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/tmp/cargo-install1Pjfnx/aarch64-unknown-linux-musl/release/build/libsqlite3-sys-de3696f7792b01b2/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c" with args "clang" did not execute successfully (status code exit status: 1).
#13 24.38
#13 24.38
#13 24.38 warning: build failed, waiting for other jobs to finish...
#13 26.45 error: failed to compile `anki-sync-server v0.0.0 (https://github.com/ankitects/anki.git?tag=23.12.1#1a1d4d54)`, intermediate artifacts can be found at `/tmp/cargo-install1Pjfnx`.
#13 26.45 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
#13 ERROR: process "/bin/bash -uo pipefail -c cargo install --locked --target \"$TARGET\" --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server" did not complete successfully: exit code: 101
------
> [builder 9/10] RUN cargo install --locked --target "aarch64-unknown-linux-musl" --git https://github.com/ankitects/anki.git --tag 23.12.1 anki-sync-server:
24.38
24.38 --- stderr
24.38
24.38
24.38 error occurred: Command "clang" "-target" "aarch64-unknown-linux-musl" "-fuse-ld=mold" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-unknown-linux-musl" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/tmp/cargo-install1Pjfnx/aarch64-unknown-linux-musl/release/build/libsqlite3-sys-de3696f7792b01b2/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c" with args "clang" did not execute successfully (status code exit status: 1).
24.38
24.38
24.38 warning: build failed, waiting for other jobs to finish...
26.45 error: failed to compile `anki-sync-server v0.0.0 (https://github.com/ankitects/anki.git?tag=23.12.1#1a1d4d54)`, intermediate artifacts can be found at `/tmp/cargo-install1Pjfnx`.
26.45 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
------
Dockerfile:18
--------------------
16 | RUN echo "build version ${version}"
17 | RUN
18 | >>> RUN cargo install --locked --target "$TARGET" --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server
19 | RUN ldd /usr/local/cargo/bin/anki-sync-server
20 |
--------------------
ERROR: failed to solve: process "/bin/bash -uo pipefail -c cargo install --locked --target \"$TARGET\" --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server" did not complete successfully: exit code: 101