ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
34.07k stars 2.49k forks source link

CI failing on Windows test-standalone issue_11595 #12419

Open andrewrk opened 2 years ago

andrewrk commented 2 years ago

Related: #12380 #12381

D:\\a\\1\\s\\test\\standalone\\issue_11595\\test.c:1:1: error: unable to build C object: Unexpected
error: zigtest...
error: The following command exited with error code 1:
D:\a\1\s\build\dist\bin\zig.exe build-exe @D:\a\1\s\test\standalone\issue_11595\zig-cache\args\630588031f7c4788fc4b93c39d253b3b36b1a709cfee50eb078d1917e375c2ba 
hdorio commented 2 years ago

I don't know if this can help but changing this line (test/standalone/issue_11595/build.zig#L30) from 1000 iterations to 368 makes this test pass on Windows 11 and Zig 0.10.0-dev.3524+74673b7f6.

andrewrk commented 2 years ago

If you look at #11595, you can see the title of the issue:

Macro defines lose double-quotes if sum of all source filenames + macros exceed certain length

So your suggestion would make the test pass because it would no longer check the condition that the test exists in order to check.

hdorio commented 2 years ago

So your suggestion would make the test pass because it would no longer check the condition that the test exists in order to check.

Thanks.

Just to clarify, I was not suggesting changing the number of iterations, I was just pointing out the exact length for which the test passes and that the length seems to still be the issue.

hdorio commented 2 years ago

My understanding of this bug is that

Maybe updateCObject() also needs a mechanism to build a "compiler response file" to pass to zig clang?

Example of a `zig clang` command line ``` C:\work\zig\build\dist\bin\zig.exe clang -fno-caret-diagnostics -target x86_64-unknown-windows-gnu -nostdinc -fno-spell-checking -isystem C:\\work\\zig\\lib\include -isystem C:\\work\\zig\\lib\libc\include\x86_64-windows-gnu -isystem C:\\work\\zig\\lib\libc\include\generic-mingw -isystem C:\\work\\zig\\lib\libc\include\x86_64-windows-any -isystem C:\\work\\zig\\lib\libc\include\any-windows-any -Xclang -target-cpu -Xclang haswell -Xclang -target-feature -Xclang -16bit-mode -Xclang -target-feature -Xclang -32bit-mode -Xclang -target-feature -Xclang -3dnow -Xclang -target-feature -Xclang -3dnowa -Xclang -target-feature -Xclang +64bit -Xclang -target-feature -Xclang -adx -Xclang -target-feature -Xclang +aes -Xclang -target-feature -Xclang -amx-bf16 -Xclang -target-feature -Xclang -amx-int8 -Xclang -target-feature -Xclang -amx-tile -Xclang -target-feature -Xclang +avx -Xclang -target-feature -Xclang +avx2 -Xclang -target-feature -Xclang -avx512bf16 -Xclang -target-feature -Xclang -avx512bitalg -Xclang -target-feature -Xclang -avx512bw -Xclang -target-feature -Xclang -avx512cd -Xclang -target-feature -Xclang -avx512dq -Xclang -target-feature -Xclang -avx512er -Xclang -target-feature -Xclang -avx512f -Xclang -target-feature -Xclang -avx512fp16 -Xclang -target-feature -Xclang -avx512ifma -Xclang -target-feature -Xclang -avx512pf -Xclang -target-feature -Xclang -avx512vbmi -Xclang -target-feature -Xclang -avx512vbmi2 -Xclang -target-feature -Xclang -avx512vl -Xclang -target-feature -Xclang -avx512vnni -Xclang -target-feature -Xclang -avx512vp2intersect -Xclang -target-feature -Xclang -avx512vpopcntdq -Xclang -target-feature -Xclang -avxvnni -Xclang -target-feature -Xclang +bmi -Xclang -target-feature -Xclang +bmi2 -Xclang -target-feature -Xclang -branchfusion -Xclang -target-feature -Xclang -cldemote -Xclang -target-feature -Xclang -clflushopt -Xclang -target-feature -Xclang -clwb -Xclang -target-feature -Xclang -clzero -Xclang -target-feature -Xclang +cmov -Xclang -target-feature -Xclang +crc32 -Xclang -target-feature -Xclang +cx16 -Xclang -target-feature -Xclang +cx8 -Xclang -target-feature -Xclang -enqcmd -Xclang -target-feature -Xclang +ermsb -Xclang -target-feature -Xclang +f16c -Xclang -target-feature -Xclang +false-deps-lzcnt-tzcnt -Xclang -target-feature -Xclang +false-deps-popcnt -Xclang -target-feature -Xclang -fast-11bytenop -Xclang -target-feature -Xclang +fast-15bytenop -Xclang -target-feature -Xclang -fast-7bytenop -Xclang -target-feature -Xclang -fast-bextr -Xclang -target-feature -Xclang -fast-gather -Xclang -target-feature -Xclang -fast-hops -Xclang -target-feature -Xclang -fast-lzcnt -Xclang -target-feature -Xclang -fast-movbe -Xclang -target-feature -Xclang +fast-scalar-fsqrt -Xclang -target-feature -Xclang -fast-scalar-shift-masks -Xclang -target-feature -Xclang +fast-shld-rotate -Xclang -target-feature -Xclang +fast-variable-crosslane-shuffle -Xclang -target-feature -Xclang +fast-variable-perlane-shuffle -Xclang -target-feature -Xclang -fast-vector-fsqrt -Xclang -target-feature -Xclang -fast-vector-shift-masks -Xclang -target-feature -Xclang +fma -Xclang -target-feature -Xclang -fma4 -Xclang -target-feature -Xclang +fsgsbase -Xclang -target-feature -Xclang -fsrm -Xclang -target-feature -Xclang +fxsr -Xclang -target-feature -Xclang -gfni -Xclang -target-feature -Xclang -hreset -Xclang -target-feature -Xclang -idivl-to-divb -Xclang -target-feature -Xclang +idivq-to-divl -Xclang -target-feature -Xclang +invpcid -Xclang -target-feature -Xclang -kl -Xclang -target-feature -Xclang -lea-sp -Xclang -target-feature -Xclang -lea-uses-ag -Xclang -target-feature -Xclang -lvi-cfi -Xclang -target-feature -Xclang -lvi-load-hardening -Xclang -target-feature -Xclang -lwp -Xclang -target-feature -Xclang +lzcnt -Xclang -target-feature -Xclang +macrofusion -Xclang -target-feature -Xclang +mmx -Xclang -target-feature -Xclang +movbe -Xclang -target-feature -Xclang -movdir64b -Xclang -target-feature -Xclang -movdiri -Xclang -target-feature -Xclang -mwaitx -Xclang -target-feature -Xclang +nopl -Xclang -target-feature -Xclang -pad-short-functions -Xclang -target-feature -Xclang +pclmul -Xclang -target-feature -Xclang -pconfig -Xclang -target-feature -Xclang -pku -Xclang -target-feature -Xclang +popcnt -Xclang -target-feature -Xclang -prefer-128-bit -Xclang -target-feature -Xclang -prefer-256-bit -Xclang -target-feature -Xclang -prefer-mask-registers -Xclang -target-feature -Xclang -prefetchwt1 -Xclang -target-feature -Xclang -prfchw -Xclang -target-feature -Xclang -ptwrite -Xclang -target-feature -Xclang -rdpid -Xclang -target-feature -Xclang +rdrnd -Xclang -target-feature -Xclang -rdseed -Xclang -target-feature -Xclang -retpoline -Xclang -target-feature -Xclang -retpoline-external-thunk -Xclang -target-feature -Xclang -retpoline-indirect-branches -Xclang -target-feature -Xclang -retpoline-indirect-calls -Xclang -target-feature -Xclang -rtm -Xclang -target-feature -Xclang +sahf -Xclang -target-feature -Xclang -serialize -Xclang -target-feature -Xclang -seses -Xclang -target-feature -Xclang -sgx -Xclang -target-feature -Xclang -sha -Xclang -target-feature -Xclang -shstk -Xclang -target-feature -Xclang +slow-3ops-lea -Xclang -target-feature -Xclang -slow-incdec -Xclang -target-feature -Xclang -slow-lea -Xclang -target-feature -Xclang -slow-pmaddwd -Xclang -target-feature -Xclang -slow-pmulld -Xclang -target-feature -Xclang -slow-shld -Xclang -target-feature -Xclang -slow-two-mem-ops -Xclang -target-feature -Xclang -slow-unaligned-mem-16 -Xclang -target-feature -Xclang -slow-unaligned-mem-32 -Xclang -target-feature -Xclang -soft-float -Xclang -target-feature -Xclang +sse -Xclang -target-feature -Xclang +sse2 -Xclang -target-feature -Xclang +sse3 -Xclang -target-feature -Xclang +sse4.1 -Xclang -target-feature -Xclang +sse4.2 -Xclang -target-feature -Xclang -sse4a -Xclang -target-feature -Xclang -sse-unaligned-mem -Xclang -target-feature -Xclang +ssse3 -Xclang -target-feature -Xclang -tagged-globals -Xclang -target-feature -Xclang -tbm -Xclang -target-feature -Xclang -tsxldtrk -Xclang -target-feature -Xclang -uintr -Xclang -target-feature -Xclang -use-aa -Xclang -target-feature -Xclang -use-glm-div-sqrt-costs -Xclang -target-feature -Xclang -use-slm-arith-costs -Xclang -target-feature -Xclang -vaes -Xclang -target-feature -Xclang -vpclmulqdq -Xclang -target-feature -Xclang +vzeroupper -Xclang -target-feature -Xclang -waitpkg -Xclang -target-feature -Xclang -wbnoinvd -Xclang -target-feature -Xclang -widekl -Xclang -target-feature -Xclang +x87 -Xclang -target-feature -Xclang -xop -Xclang -target-feature -Xclang +xsave -Xclang -target-feature -Xclang -xsavec -Xclang -target-feature -Xclang +xsaveopt -Xclang -target-feature -Xclang -xsaves -Wno-pragma-pack -g -gcodeview -fsanitize=undefined -fsanitize-trap=undefined -mred-zone -fno-omit-frame-pointer -D_DEBUG -O0 -fstack-protector-strong --param ssp-buffer-size=4 -funwind-tables -MD -MV -MF C:\\work\\zig\\test\\standalone\\issue_11595\\zig-cache\tmp\b765e0e1bfec42f1-test.obj.d -D AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -D AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -D AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -D [...] AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -D FOO=42 -D "BAR=\"BAR\"" -D "BAZ=\"\\\"BAZ\\\"\"" -D "QUX=\"Q\" \"UX\"" -D "QUUX=\"QU\\\"UX\"" -c -o C:\\work\\zig\\test\\standalone\\issue_11595\\zig-cache\tmp\b765e0e1bfec42f1-test.obj C:\\work\\zig\\test\\standalone\\issue_11595\\test.c ```
andrewrk commented 1 year ago

The fix was reverted in 9bcd48e40e272408879a442b21099ea5ab6b85b4 due to usage of realpath.