Choosing a Target

Back again trying to get my little project off the ground.

I run in a rocky9 vagrant machine and all is well, but I have a tester who wants to build in their docker devcontainer.

This results in the following errors.

Attempting to build server and client.
warning: Encountered error: UnexpectedEndOfFile, falling back to default ABI and dynamic linker.
warning: Encountered error: UnexpectedEndOfFile, falling back to default ABI and dynamic linker.
install
└─ install completion
   └─ zig build-exe completion ReleaseFast native 2 errors
error: unable to build libcxx: SubCompilationFailed
error: unable to build libcxxabi: SubCompilationFailed

Did some digging and I found this

I’m assuming it’s something weird with docker.

Teach me how to fish?

A target is defined by three components:

  1. Architecture (x86_64, aarch64, …)
  2. Operating System (linux, windows, …)
  3. Application Binary Interface (musl, gnu, msvc, …)

target examples are: x86_64-linux-musl, aarch64-linux-gnu
The command zig targets displays JSON with all the available target options.

zig targets | jq .arch shows all the available architectures
zig targets | jq .os shows all the supported operating systems
zig targets | jq .abi shows all ABI
zig targets | jq .libc shows the targets for all included std C libraries

see: Targets in Zig Reference

3 Likes

So

Chipset → os → (gnu???)

Gnu because they build with gcc?

I’m not an expert here but I don’t think gcc is used for anything. It’s all Clang/LLVM.