Skip to content

zig cc -MD fails when an explicit filename is given #9948

@marler8997

Description

@marler8997

Steps to Reproduce

$ echo "int main() { }" > example.c
$ zig cc -Wp,-MD,deps.d example.c
example.c:1:1: error: unable to build C object: FileNotFound

Error goes away if no deps filename is given (i.e. -Wp,-MD without the deps.d).

Tracked the error to this line:

const dep_file_contents = try dir.readFileAlloc(self.cache.gpa, dep_file_basename, manifest_file_size_max);

zig tries to open the deps file from the cache but it's not there because it was redirected to another filename on the command-line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorzig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions