vezel-dev / zig-sdk

An MSBuild SDK for building Zig, C, and C++ projects using the Zig compiler.
https://docs.vezel.dev/zig-sdk
BSD Zero Clause License
69 stars 2 forks source link

Use response files as command lines can get very long #18

Open alexrp opened 3 years ago

alexrp commented 3 years ago

Running into some weird and inexplicable FileNotFound errors. Will need to investigate more and file a Zig bug. This probably won't make Zig 0.8.1, so changing milestone.

alexrp commented 3 years ago

See: ~https://github.com/ziglang/zig/pull/9456~ https://github.com/ziglang/zig/pull/9654

alexrp commented 2 years ago

The fix for this should be in Zig 0.10.0.

alexrp commented 6 months ago

Basically just need to move most of the logic to generate command line arguments from GenerateCommandLineCommands() to GenerateResponseFileCommands() and MSBuild will take care of the rest. There are a few arguments that we want to keep in GenerateCommandLineCommands(), such as the verb (cc, c++, etc) and -fdiagnostics-format=msvc.

alexrp commented 3 months ago
         ld.lld : error : cannot open -target: No such file or directory [/home/alexrp/Source/vezel-dev/zig-sdk/src/samples/cexe/cexe.cproj]
         ld.lld : error : cannot open arm-linux.3.10-gnueabihf.2.17: No such file or directory [/home/alexrp/Source/vezel-dev/zig-sdk/src/samples/cexe/cexe.cproj]

The process is being invoked as zig cc -fdiagnostics-format=msvc @/path/to/flags.rsp as expected. The response file contains the flags as expected. It works fine in a normal shell. Super confused about this, honestly.