"Fake" build error: unable to open library directory

I have a zig project that depends on 2 C system libraries. When i run zig build, I get the following:

$ zig build
install
└─ install vulkan
   └─ zig build-exe vulkan Debug native failure
error: warning: unable to open library directory '/usr/local/lib64': FileNotFound
warning: unable to open library directory '/usr/lib/x86_64-linux-gnu': FileNotFound
warning: unable to open library directory '/lib/x86_64-linux-gnu': FileNotFound

“vulkan” is the name of my exe, not the vulkan library itself.

The strange part is that this still produces a working binary, so it’s not really a failure at all, but zig still reports it as a failure due to the warnings, which I assume come from when it’s searching for the C header files(?)

The zig build-exe logs three warnings. There are no errors.

The problem here is the error: label, added before the first warning, when the logged warnings are detected by zig build.


What are the contents of /etc/ld.so.conf and /etc/ld.so.conf.d/*?
These must be existing directories. See also man ldconfig.

I know there isn’t actually an error, but zig still reports a build failure, so is this a bug?

$ cat /etc/ld.so.conf /etc/ld.so.conf.d/*
# Dynamic linker/loader configuration.
# See ld.so(8) and ldconfig(8) for details.

include /etc/ld.so.conf.d/*.conf
include /usr/lib/ld.so.conf.d/*.conf
/usr/lib/R/lib

/usr/lib32

I don’t consider this a bug. But it will be better to not print error: for warnings.


Does your files in /usr/lib/ld.so.conf.d/*.conf list the three paths mentioned in warnings?

No, none of them are listed.