Skip to content

the first line of .d files is ambiguous due to clang's output format #2046

@andrewrk

Description

@andrewrk

zig/src/cache_hash.cpp

Lines 431 to 432 in fec4555

// skip first line
SplitIterator_next(&it);

But here's an example file:

test.o: test.c b/foo.h

In this example there are 2 files on the first line. The dep file parsing probably needs to gain a real tokenizer, and support any number of items on any line. For example it also doesn't look for multiple files on the same line if there are double quotes.

I also haven't managed to find documentation for this file format. It would be nice to find a reference. Supposedly it's "NMake or Jom" format.

Finally, audit the places that call cache_add_dep_file and make sure they don't redundantly add the main source file, since it's contained in the dep file as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.upstreamAn issue with a third party project that Zig uses.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