Skip to content

"zig cc" always fails if it can't write to the cache directory #5341

@arp242

Description

@arp242

I modified some files in /usr/lib/go/src/runtime/cgo to debug some issues I'm having to get zig cc working with Go, however I now have:

[~/cc]% CC="zig cc" ./go build -v
runtime/cgo
# runtime/cgo
unable to check cache when compiling C object: access denied

The error message doesn't have a lot of detail, but I created and set permissions on /usr/lib/go/src/runtime/cgo/zig-cache and that fixed it.

I tried adding --cache off, but I can't get that to work:

[~/cc]% zig cc --cache off z.c
Unknown Clang option: '--cache'

[~/cc]% zig --cache off cc z.c
Unrecognized command: cc

I think it would be helpful if the error message could at least include the path it's trying to read/write (took me some time to figure that out), but a warning that the cache can't be written and continuing might be better.

This is with zig 0.6.0 on Linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    zig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions