Can't build zig nightly on mac M1 with homebrew
Zig Version
nightly
Steps to Reproduce
❯ brew install zig --HEAD
Running brew update --auto-update...
==> Auto-updated Homebrew!
==> Updated Homebrew from 3be7a6548 to 241533912.
Updated 3 taps (homebrew/core, homebrew/cask and aws/tap).
You have 92 outdated formulae and 20 outdated casks installed. You can upgrade them with brew upgrade or list them with brew outdated.
==> Cloning https://github.com/ziglang/zig.git Updating /Users/ryoppippi/Library/Caches/Homebrew/zig--git ==> Checking out branch master Already on 'master' Your branch is up to date with 'origin/master'. HEAD is now at 1ce71c86b std.debug: implement support for DWARFv5 ==> cmake . -DZIG_STATIC_LLVM=ON ==> make install Last 15 lines from /Users/ryoppippi/Library/Logs/Homebrew/zig/02.make: :: argv[1]: build :: argv[2]: --zig-lib-dir :: argv[3]: /tmp/zig-20220823-22479-bzcqlr/lib :: argv[4]: -Dlib-files-only :: argv[5]: --prefix :: argv[6]: /opt/homebrew/Cellar/zig/HEAD-1ce71c8_1 :: argv[7]: -Dconfig_h=/tmp/zig-20220823-22479-bzcqlr/config.h :: argv[8]: install :: CMake Error at cmake/install.cmake:36 (message): Call Stack (most recent call first): cmake_install.cmake:63 (include)
make: *** [install] Error 1
Do not report this issue to Homebrew/brew or Homebrew/core!
Please create pull requests instead of asking for help on Homebrew's GitHub, Twitter or any other official channels.
Expected Behavior
install successfully
Actual Behavior
cannot install
I saw my building log, and I found these lines
/tmp/zig-20220823-47467-qrsbe1/lib/std/debug.zig:1574:35: error: expected type '?[]const u8', found '?macho.section_64'
/tmp/zig-20220823-47467-qrsbe1/lib/std/debug.zig:1574:35: note: optional type child 'macho.section_64' cannot cast into optional type child '[]const u8'
/tmp/zig-20220823-47467-qrsbe1/lib/std/macho.zig:738:31: note: struct declared here
I build from source and I got this error
[ 98%] Linking CXX executable zig0
[ 98%] Built target zig0
[ 98%] Building self-hosted component /tmp/zig/build/zig1.o
/tmp/zig/lib/std/debug.zig:1574:35: error: expected type '?[]const u8', found '?std.macho.section_64'
.debug_loclists = opt_debug_loclists,
^
/tmp/zig/lib/std/debug.zig:1574:35: note: optional type child 'std.macho.section_64' cannot cast into optional type child '[]const u8'
.debug_loclists = opt_debug_loclists,
^
/tmp/zig/lib/std/macho.zig:738:24: note: std.macho.section_64 declared here
pub const section_64 = extern struct {
^
make[2]: *** [zig1.o] Error 1
make[1]: *** [CMakeFiles/zig.dir/all] Error 2
make: *** [all] Error 2
yes master is currently broken. apologies for any inconveniences. the CI statuses on https://github.com/ziglang/zig will return green shortly
I rolled back to my zig version. Thank you for your hard works!!
I hope it is ok to add my recent experience using brew install zig --HEAD
the error I got is
==> cmake --build build
Last 15 lines from /Users/drgo/Library/Logs/Homebrew/zig/02.cmake:
^
???:?:?: 0x10b136a4f in ___zig_fail_unwrap (???)
/private/tmp/zig-20221015-50950-qq1tny/src/stage1.zig:56:43: 0x1009c086b in main (zig2)
stage2.mainArgs(gpa, arena, args) catch unreachable;
^
???:?:?: 0x112cbd08b in ??? (???)
???:?:?: 0xe55effffffffffff in ??? (???)
error: zig...
Could you try with 0.10 released, is it possible to build it with Homebrew now?
==> Installing zig --HEAD
==> cmake -S . -B build -DZIG_STATIC_LLVM=ON
==> cmake --build build
==> cmake --install build==> Installing zig --HEAD
==> cmake -S . -B build -DZIG_STATIC_LLVM=ON
==> cmake --build build
==> cmake --install build
🍺 /opt/homebrew/Cellar/zig/HEAD-b40fc70: 13,837 files, 360.8MB, built in 6 minutes 23 seconds
~/local/bin> zig version
0.11.0-dev.38+b40fc7018
~/local/bin> uname -a
Darwin drlab 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
Nice work. Thanks
The most recent commit also have trouble installing on Mac M1 but I am guessing it is a different issue
==> cmake -S . -B build -DZIG_STATIC_LLVM=ON
==> cmake --build build
==> cmake --install build
Last 15 lines from ~/Library/Logs/Homebrew/zig/03.cmake:
:: argv[4]: -Dconfig_h=/tmp/zig-20230320-39109-a07gkk/build/config.h
:: argv[5]: -Denable-llvm
:: argv[6]: -Drelease
:: argv[7]: -Dstrip
:: argv[8]: -Dtarget=native
:: argv[9]: -Dcpu=native
:: argv[10]: -Dversion-string=0.11.0-dev.2191+30427ff79
:: argv[11]: --prefix
:: argv[12]: /opt/homebrew/Cellar/zig/HEAD-30427ff
::
CMake Error at cmake/install.cmake:26 (message):
Call Stack (most recent call first):
build/cmake_install.cmake:57 (include)
Could you provide full error printout? It's difficult to work out what is going wrong from the submitted trace.
@kubkon ,
This is all the log that show when i run brew command
brew reinstall zig
==> Fetching zig
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/f53bbad9f7fa8ba7f3a3a030663186c4ace2635f/Formula/zig.rb
Already downloaded: ~/Library/Caches/Homebrew/downloads/7f9c500b1a8fce1bbb6478b86ebbba1370d1ef40180399aba8a592e2d7824ae8--zig.rb
==> Cloning https://github.com/ziglang/zig.git
Updating ~/Library/Caches/Homebrew/zig--git
From https://github.com/ziglang/zig
5df31f3ef..626a75bbc master -> origin/master
==> Checking out branch master
Already on 'master'
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
HEAD is now at 626a75bbc std.Build.RunStep: fix control flow with qemu+glibc logic
==> Reinstalling zig
==> cmake -S . -B build -DZIG_STATIC_LLVM=ON
==> cmake --build build
==> cmake --install build
Last 15 lines from ~/Library/Logs/Homebrew/zig/03.cmake:
:: argv[4]: -Dconfig_h=/tmp/zig-20230320-53845-1capekv/build/config.h
:: argv[5]: -Denable-llvm
:: argv[6]: -Drelease
:: argv[7]: -Dstrip
:: argv[8]: -Dtarget=native
:: argv[9]: -Dcpu=native
:: argv[10]: -Dversion-string=0.11.0-dev.2194+626a75bbc
:: argv[11]: --prefix
:: argv[12]: /opt/homebrew/Cellar/zig/HEAD-626a75b
::
CMake Error at cmake/install.cmake:26 (message):
Call Stack (most recent call first):
build/cmake_install.cmake:57 (include)
Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!
zig's formula was built from an unstable upstream --HEAD.
This build failure is expected behaviour.
Do not create issues about this on Homebrew's GitHub repositories.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
More log details:
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
/Users/llew/Library/Logs/Homebrew/zig/03.cmake...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-202303:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
install transitive failure
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
install transitive failure
+- install generated to doc/langref.html transitive failure
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
install transitive failure
+- install generated to doc/langref.html transitive failure
| +- run docgen (langref.html) failure
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
install transitive failure
+- install generated to doc/langref.html transitive failure
| +- run docgen (langref.html) failure
| +- zig build-exe docgen Debug native success 1s MaxRSS:261M
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
install transitive failure
+- install generated to doc/langref.html transitive failure
| +- run docgen (langref.html) failure
| +- zig build-exe docgen Debug native success 1s MaxRSS:261M
+- install lib/ success
:...skipping...
2023-03-26 17:14:19 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230326-17140-1oxas15/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib -lc
/private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1847:13: 0x102bcdbef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:287:5: 0x102bea40f in parseError__anon_6012 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:1453:29: 0x102be0ffb in genHtml__anon_4027 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230326-17140-1oxas15/doc/docgen.zig:104:5: 0x102bf42d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/107c43a7300a6d8129b179b08f92fc33/docgen --zig /private/tmp/zig-20230326-17140-1oxas15/build/zig2 --zig-lib-dir /tmp/zig-20230326-17140-1oxas15/lib /private/tmp/zig-20230326-17140-1oxas15/doc/langref.html.in /private/tmp/zig-20230326-17140-1oxas15/zig-cache/o/7e9357d244fe9fcda075035f5031ab8c/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
install transitive failure
+- install generated to doc/langref.html transitive failure
| +- run docgen (langref.html) failure
| +- zig build-exe docgen Debug native success 1s MaxRSS:261M
+- install lib/ success
+- install zig success
I get this today:
2023-03-27 07:09:09 +0000
cmake
--install
build
-- Install configuration: "Release"
run docgen (langref.html): error:
The following command crashed:
/private/tmp/zig-20230327-16118-ybj3ad/build/zig2 build-exe --name cImport_builtin --color on --enable-cache docgen_tmp/cImport_builtin.zig --zig-lib-dir /tmp/zig-20230327-16118-ybj3ad/lib -lc
/private/tmp/zig-20230327-16118-ybj3ad/doc/langref.html.in:10726:20: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230327-16118-ybj3ad/doc/docgen.zig:1847:13: 0x104ba9bef in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230327-16118-ybj3ad/doc/docgen.zig:287:5: 0x104bc640f in parseError__anon_6013 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230327-16118-ybj3ad/doc/docgen.zig:1453:29: 0x104bbcffb in genHtml__anon_4028 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230327-16118-ybj3ad/doc/docgen.zig:104:5: 0x104bd02d7 in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
^
run docgen (langref.html): error: the following command exited with error code 1:
/private/tmp/zig-20230327-16118-ybj3ad/zig-cache/o/20d0feb2939744eb4672fda74994f340/docgen --zig /private/tmp/zig-20230327-16118-ybj3ad/build/zig2 --zig-lib-dir /tmp/zig-20230327-16118-ybj3ad/lib /private/tmp/zig-20230327-16118-ybj3ad/doc/langref.html.in /private/tmp/zig-20230327-16118-ybj3ad/zig-cache/o/d1fd95bd367b49e5ffb09f5e50d9823d/langref.html
Build Summary: 5/8 steps succeeded; 1 failed (disable with -fno-summary)
install transitive failure
+- install generated to doc/langref.html transitive failure
| +- run docgen (langref.html) failure
| +- zig build-exe docgen Debug native success 1s MaxRSS:270M
+- install lib/ success
+- install zig success
+- zig build-exe zig ReleaseFast native cached 31ms MaxRSS:31M
+- options cached
error: the following build command failed with exit code 1:
/private/tmp/zig-20230327-16118-ybj3ad/zig-cache/o/6c3e6d80070c6adeae1d5cc4dc8231a8/build /private/tmp/zig-20230327-16118-ybj3ad/build/zig2 /private/tmp/zig-20230327-16118-ybj3ad /private/tmp/zig-20230327-16118-ybj3ad/zig-cache /private/tmp/zig-20230327-16118-ybj3ad/.brew_home/.cache/zig --zig-lib-dir /tmp/zig-20230327-16118-ybj3ad/lib -Dconfig_h=/tmp/zig-20230327-16118-ybj3ad/build/config.h -Denable-llvm -Drelease -Dstrip -Dtarget=native -Dcpu=native -Dversion-string=0.11.0-dev.2287+1de64dba2 --prefix /opt/homebrew/Cellar/zig/HEAD-1de64db
::
:: ERROR: 1
:: (execute_process)
::
:: argv: /tmp/zig-20230327-16118-ybj3ad/build/zig2 build --zig-lib-dir /tmp/zig-20230327-16118-ybj3ad/lib -Dconfig_h=/tmp/zig-20230327-16118-ybj3ad/build/config.h -Denable-llvm -Drelease -Dstrip -Dtarget=native -Dcpu=native -Dversion-string=0.11.0-dev.2287+1de64dba2 --prefix /opt/homebrew/Cellar/zig/HEAD-1de64db
::
:: argv[0]: /tmp/zig-20230327-16118-ybj3ad/build/zig2
:: argv[1]: build
:: argv[2]: --zig-lib-dir
:: argv[3]: /tmp/zig-20230327-16118-ybj3ad/lib
:: argv[4]: -Dconfig_h=/tmp/zig-20230327-16118-ybj3ad/build/config.h
:: argv[5]: -Denable-llvm
:: argv[6]: -Drelease
:: argv[7]: -Dstrip
:: argv[8]: -Dtarget=native
:: argv[9]: -Dcpu=native
:: argv[10]: -Dversion-string=0.11.0-dev.2287+1de64dba2
:: argv[11]: --prefix
:: argv[12]: /opt/homebrew/Cellar/zig/HEAD-1de64db
::
CMake Error at cmake/install.cmake:26 (message):
Call Stack (most recent call first):
build/cmake_install.cmake:57 (include)
HOMEBREW_VERSION: 4.0.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 584588afb4ab557bcc0536f2794b4d043c333bb9
Last commit: 7 days ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 7162d832e61fa1c303c24e83a010aa1baf58e8fe
Core tap last commit: 3 weeks ago
Core tap branch: master
Core tap JSON: 27 Mar 06:43 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_BOOTSNAP: set
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.37.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.6.1-arm64
CLT: 14.2.0.0.1.1668646533
Xcode: 14.2
Rosetta 2: false
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j10
CMAKE_PREFIX_PATH: /opt/homebrew/opt/llvm@15:/opt/homebrew
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /opt/homebrew/opt/lz4/lib/pkgconfig:/opt/homebrew/opt/xz/lib/pkgconfig:/opt/homebrew/opt/zstd/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/12
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
ACLOCAL_PATH: /opt/homebrew/share/aclocal
PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/opt/homebrew/opt/cmake/bin:/opt/homebrew/opt/llvm@15/bin:/opt/homebrew/opt/lz4/bin:/opt/homebrew/opt/xz/bin:/opt/homebrew/opt/zstd/bin:/usr/bin:/bin:/usr/sbin:/sbin
I am having the same error.
got the same error
I was able to fix it by downloading https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/zig.rb and modifying from:
args = ["-DZIG_STATIC_LLVM=ON"]
to:
args = ["-DZIG_STATIC_LLVM=ON", "-DZIG_NO_LANGREF=ON"]
which skips the autodoc build, then install build using:
brew install --build-from-source ./zig.rb --HEAD
Should this workaround e merged into homebrew, or is it a bigger problem?
it is likely a bigger bug
I don't know why I can't reproduce this if I just try to compile it with cmake
I'm struggling with this issue also; not building the langref seems to temporarily fix this and makes brew capable of compile zig from head as @asafyish mentions.
Any new clues on this issue?
I can only guess it's because some sort of a dependency is not installed, causing the build to fail on our systems. Other workaround, if you don't really need to build zig, is to download the latest nightly from https://ziglang.org/download/, I tried building only because I missed the download nightly thing.
That's sad, lets hope we can get a solution. Meanwhile I think I can live without the langref
hrm still getting this error, is there any way to just fix the langref and get this error fixed?
Do we know what exactly is going wrong with building the langref?
I tracked down this as much as possible. First, make sure brew drops you to a shell after failure:
$ brew install --HEAD zig --debug --keep-tmp
Next, create this minimal zig doc template:
{#code_begin|exe|cImport_builtin#}
{#link_libc#}
const c = @cImport({
@cDefine("_NO_CRT_STDIO_INLINE", "1");
@cInclude("stdio.h");
});
pub fn main() void {
_ = c.printf("hello\n");
}
{#code_end#}
Next, try to docgen this (folders will be different):
$ /private/tmp/zig-20230620-18601-2vsb3r/zig-cache/o/ecd0acaa44a31f5c5da87df49a6f1a78/docgen --zig /private/tmp/zig-20230620-18601-2vsb3r/build/zig2 --zig-lib-dir /tmp/zig-20230620-18601-2vsb3r/lib test.html.in test.html
An error like so will occur:
The following command crashed:
/private/tmp/zig-20230620-18601-2vsb3r/build/zig2 build-exe --name cImport_builtin --color on cImport_builtin.zig --zig-lib-dir /tmp/zig-20230620-18601-2vsb3r/lib -lc
test.html.in:2:14: error: example failed to compile
{#link_libc#}
error: ParseError
/private/tmp/zig-20230620-18601-2vsb3r/doc/docgen.zig:1868:13: 0x100478b17 in exec (docgen)
return error.ChildCrashed;
^
/private/tmp/zig-20230620-18601-2vsb3r/doc/docgen.zig:287:5: 0x100495a2f in parseError__anon_6183 (docgen)
return error.ParseError;
^
/private/tmp/zig-20230620-18601-2vsb3r/doc/docgen.zig:1473:29: 0x10048c79f in genHtml__anon_4290 (docgen)
return parseError(tokenizer, code.source_token, "example failed to compile", .{});
^
/private/tmp/zig-20230620-18601-2vsb3r/doc/docgen.zig:104:5: 0x10049bbeb in main (docgen)
try genHtml(allocator, &tokenizer, &toc, buffered_writer.writer(), zig_exe, opt_zig_lib_dir, do_code_tests);
Note that it's the build command that fails, not docgen. If you try to compile this example:
const c = @cImport({
@cDefine("_NO_CRT_STDIO_INLINE", "1");
@cInclude("stdio.h");
});
pub fn main() void {
_ = c.printf("hello\n");
}
You get this:
% /private/tmp/zig-20230620-18601-2vsb3r/build/zig2 build-exe --name cImport_builtin --color on test.zig --zig-lib-dir /tmp/zig-20230620-18601-2vsb3r/lib -lc
zsh: bus error /private/tmp/zig-20230620-18601-2vsb3r/build/zig2 build-exe --name --color o
I'd love to help out with this but I cannot get as far as any of you. On a fresh copy of homebrew, this is what I get:
$ brew install zig --HEAD
==> Fetching dependencies for zig: llvm@15
==> Fetching llvm@15
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/15/manifests/15.0.7
Already downloaded: /Users/kubkon/Library/Caches/Homebrew/downloads/07d6b5a728fda40fb890ce488f96df4ad9896f32eef6f5ab4aa053d753c06614--llvm@15-15.0.7.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/llvm/15/blobs/sha256:fd420324c3289bcd91b85e13ece10818363cf0d82fc2
Already downloaded: /Users/kubkon/Library/Caches/Homebrew/downloads/9f60ddffe9c0e234b85e4ed1300becfff2eb8017f0a242d346e1e4c2bd8b09fc--llvm@15--15.0.7.arm64_ventura.bottle.tar.gz
==> Fetching zig
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/c5e08a255ec19ffafb65b468f340d35228bafe1a/
Already downloaded: /Users/kubkon/Library/Caches/Homebrew/downloads/414f72b31bfae7c976f81629980e3c7fd8f1f71cabd62af79672d360d0b70476--zig.rb
==> Cloning https://github.com/ziglang/zig.git
Updating /Users/kubkon/Library/Caches/Homebrew/zig--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 9eb008717 std: prevent random CI failures
==> Installing dependencies for zig: mpdecimal, ca-certificates, [email protected], readline, sqlite, [email protected], six, z3 and llvm
==> Installing zig dependency: mpdecimal
==> Pouring mpdecimal--2.5.1.arm64_ventura.bottle.tar.gz
Error: No such file or directory @ rb_sysopen - /Users/kubkon/Library/Caches/Homebrew/downloads/6bf6539627b31c17765f4bcfbe8be8996f3505d3342804531f114c13e64a5a9e--mpdecimal--2.5.1.arm64_ventura.bottle.tar.gz
I don't even understand why brew pulls LLVM15 when Zig master (HEAD) depends on LLVM16. Any help with this would be appreciated - if I can repro the issues mentioned in this PR, I should be able to fix it for y'all.
This is a Homebrew issue. Please open a Homebrew issue. If you do that, then we can re-open this as a tracking issue for the Homebrew issue.
Do not report this issue to Homebrew/brew or Homebrew/core!
Please create pull requests instead of asking for help on Homebrew's GitHub, Twitter or any other official channels.
It looks like Homebrew does not accept issues, I don't know why you would even use this software then. I suggest to follow Homebrew's instructions, and go fix Homebrew if you want to use Homebrew.
If you just want a working Zig on macOS, download it or build it from source.
iirc that message appears either because theyre passing --HEAD (ie untested to brew) or because theyre on a deprecated version of macOS