Skip to content

zig cc does not support nested @ files: error: unable to parse command line parameters: NestedResponseFileΒ #24386

Open

Description

@cbarrete

Zig Version

0.14.1

Steps to Reproduce and Observed Behavior

Files

main.c

#include <stdio.h>

int main() {
    printf("Hello %s\n", ZIG);
    return 0;
}

flags

main.c
@nested-flags
@nested-flags

nested-flags

-DZIG=\"Zig\"

Commands

Working example using Clang 19.1.7

> clang @flags && ./a.out
Hello Zig

Build failure using zig cc

> zig cc @flags
error: unable to parse command line parameters: NestedResponseFile

Expected Behavior

The build should succeed despite the nested @ files.

For context, the error is raised at

zig/src/main.zig

Line 5818 in 7c709f9

if (self.root_args != null) return error.NestedResponseFile;
.

This was discovered at meta/buck2#1011. For context, there is some interest in using Zig to build hermetic toolchains using the Buck2 build system. The Buck2 "standard library" (called the prelude) has some support for Zig-based toolchains, but it has started using @ files more extensively as of late. This works fine with Clang and GCC, but breaks with zig cc.

Activity

  1. added
    bugObserved behavior contradicts documented or intended behavior
    on Jul 10, 2025
  2. added
    zig ccZig as a drop-in C compiler feature
    on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions