Skip to content

zig cc cannot compile from stdin #10389

@konsolas

Description

@konsolas

Zig Version

0.9.0

Steps to Reproduce

Running this command to compile a program from stdin

echo 'int main(){}' | zig cc -xc -

Expected Behavior

The same command succeeds with clang.

echo 'int main(){}' | clang -xc -

produces an executable a.out that does nothing.

Actual Behavior

zig cc gives the following output and nothing else:

error: FileNotFound

This means that zig cc is not a drop-in solution for projects that dynamically generate c/c++ source code during the build process which is directly piped to the compiler.

This issue was fixed previously but in a different context: #6271

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions