Open kassane opened 12 months ago
docker run --rm -v $(pwd):/app -w /app kassany/ziglang:0.11.0 libc
Zig attempted to find the path to native system libc headers by executing this command:
cc -E -Wp,-v -xc /dev/null
error: unable to detect native libc: UnableToSpawnCCompiler
New update from busybox:
Works on C ABI, except C++ ABI (linux - musl only):
$> docker run --rm -v $(pwd):/app -w /app kassany/ziglang:latest run -lc hello.c -target native-native-musl
Hello C!!
$> docker run --rm -v $(pwd):/app -w /app kassany/ziglang:latest run hello.zig
Hello Zig!!
$> docker run --rm -it -v $(pwd):/app -w /app kassany/ziglang:latest run -lc++ hello.cpp -target native-native-musl
Compile C Objects [1344/1344] aio.c... error(compilation): clang failed with stderr: zig: error: unable to make temporary file: No such file or directory
Compile C Objects [1/10] UnwindLevel1.c... error(compilation): clang failed with stderr: zig: error: unable to make temporary file: No such file or directory
error: unable to build libunwind: SubCompilationFailed
## busybox
docker run --rm -it -v $(pwd):/app -w /app kassany/ziglang:latest c++ -v ###
clang version 16.0.6 (https://github.com/ziglang/zig-bootstrap 34644ad5032c58e39327d33d7f96d63d7c330003)
Target: x86_64-unknown-linux-musl
Thread model: posix
InstalledDir: /app
## debian
docker run --rm -it -v $(pwd):/app -w /app kassany/bookworm-ziglang:latest bash
ziguana@ade7867cd389:/app$ zig c++ -v ###
clang version 16.0.6 (https://github.com/ziglang/zig-bootstrap 34644ad5032c58e39327d33d7f96d63d7c330003)
Target: x86_64-unknown-linux-musl
Thread model: posix
InstalledDir: /app
## my host
zig c++ -v ###
clang version 16.0.6 (https://github.com/ziglang/zig-bootstrap 34644ad5032c58e39327d33d7f96d63d7c330003)
Target: x86_64-unknown-linux-musl
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.1
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Recently there has been an attempt to preload the abi cache. However, it's not done on busybox, but works on debian and alpine.
# force Global-Cache preload
RUN zig c++ -target native-native-musl /dev/null 2>/dev/null; \
zig c++ -target native-windows /dev/null 2>/dev/null; \
zig c++ -target native-macos /dev/null 2>/dev/null
## $HOME/.cache/zig (builded: llvm-libcxx/abi + llvm-libunwind + libcompiler-rt + OS-libc [musl/mingw/macos-libc])
0.602 error: download 'https://ziglang.org/download/0.12.0/zig-linux-x86_64-0.12.0.tar.xz' failed: failed to connect to the HTTP server with TlsInitializationFailed
https://github.com/kassane/docker-zig/actions/runs/9303280676/job/25605238505#step:9:153
Busybox
build-system with C ABI
Build works without Libc, but with warning!!