Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tried compiling zig master from source using the lastest compiled zig version. Got a bunch of sub-compilation errors #21055

Closed
BurdujaAdrian opened this issue Aug 12, 2024 · 1 comment
Labels
question No questions on the issue tracker, please.

Comments

@BurdujaAdrian
Copy link

Zig Version

0.14.0-dev.1021+fc2924080

Steps to Reproduce and Observed Behavior

  1. Use zig-windows-x86_64-0.14.0-dev.1021+fc2924080
  2. git clone https://github.com/ziglang/zig

  3. cd zig

  4. zig build run

Output:
error: sub-compilation of zig_libc failed
C:\zig\lib\std\zig\tokenizer.zig:1553:22: note: expected expression, found 'invalid token'
try testTokenize(
^
C:\zig\lib\std\zig\system\linux.zig:111:79: note: expected expression, found 'invalid token'
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
^
C:\zig\lib\std\zig\system\darwin\macos.zig:306:1: note: expected ',' after initializer
\ ProductBuildVersion
^
C:\zig\lib\std\macho.zig:205:77: note: expected type expression, found 'invalid token'
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
^
C:\zig\lib\std\crypto\ml_kem.zig:680:5: note: expected statement, found 'invalid token'
// m := ((x mod R) q') mod R
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: sub-compilation of compiler_rt failed
C:\zig\lib\std\zig\tokenizer.zig:1553:22: note: expected expression, found 'invalid token'
try testTokenize(
^
C:\zig\lib\std\zig\system\darwin\macos.zig:306:1: note: expected ',' after initializer
\ ProductBuildVersion
^
C:\zig\lib\std\zig\system\linux.zig:111:79: note: expected expression, found 'invalid token'
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
^
C:\zig\lib\std\macho.zig:205:77: note: expected type expression, found 'invalid token'
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
^
C:\zig\lib\std\crypto\ml_kem.zig:680:5: note: expected statement, found 'invalid token'
// m := ((x mod R) q') mod R
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\zig\lib\std\zig\tokenizer.zig:1553:22: error: expected expression, found 'invalid token'
try testTokenize(
^
C:\zig\lib\std\zig\system\linux.zig:111:79: error: expected expression, found 'invalid token'
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
^
C:\zig\lib\std\zig\system\darwin\macos.zig:306:1: error: expected ',' after initializer
\ ProductBuildVersion
^
C:\zig\lib\std\macho.zig:205:77: error: expected type expression, found 'invalid token'
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
^
C:\zig\lib\std\crypto\ml_kem.zig:680:5: error: expected statement, found 'invalid token'
// m := ((x mod R) q') mod R
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\zig-master\zig>zig_m
'zig_m' is not recognized as an internal or external command,
operable program or batch file.

C:\zig-master\zig>zig build --help
error: sub-compilation of zig_libc failed
C:\zig\lib\std\zig\tokenizer.zig:1553:22: note: expected expression, found 'invalid token'
try testTokenize(
^
C:\zig\lib\std\zig\system\linux.zig:111:79: note: expected expression, found 'invalid token'
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
^
C:\zig\lib\std\zig\system\darwin\macos.zig:306:1: note: expected ',' after initializer
\ ProductBuildVersion
^
C:\zig\lib\std\macho.zig:205:77: note: expected type expression, found 'invalid token'
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
^
C:\zig\lib\std\crypto\ml_kem.zig:680:5: note: expected statement, found 'invalid token'
// m := ((x mod R) q') mod R
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: sub-compilation of compiler_rt failed
C:\zig\lib\std\zig\tokenizer.zig:1553:22: note: expected expression, found 'invalid token'
try testTokenize(
^
C:\zig\lib\std\zig\system\linux.zig:111:79: note: expected expression, found 'invalid token'
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
^
C:\zig\lib\std\zig\system\darwin\macos.zig:306:1: note: expected ',' after initializer
\ ProductBuildVersion
^
C:\zig\lib\std\macho.zig:205:77: note: expected type expression, found 'invalid token'
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
^
C:\zig\lib\std\crypto\ml_kem.zig:680:5: note: expected statement, found 'invalid token'
// m := ((x mod R) q') mod R
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\zig\lib\std\zig\tokenizer.zig:1553:22: error: expected expression, found 'invalid token'
try testTokenize(
^
C:\zig\lib\std\zig\system\linux.zig:111:79: error: expected expression, found 'invalid token'
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
^
C:\zig\lib\std\zig\system\darwin\macos.zig:306:1: error: expected ',' after initializer
\ ProductBuildVersion
^
C:\zig\lib\std\macho.zig:205:77: error: expected type expression, found 'invalid token'
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
^
C:\zig\lib\std\crypto\ml_kem.zig:680:5: error: expected statement, found 'invalid token'
// m := ((x mod R) q') mod R
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected Behavior

Zig is successfully compiled from source

@BurdujaAdrian BurdujaAdrian added the bug Observed behavior contradicts documented or intended behavior label Aug 12, 2024
@ianprime0509
Copy link
Contributor

ianprime0509 commented Aug 12, 2024

Which commit of the Zig repository are you trying to build? The errors you're getting all look related to changes made in #20885, suggesting that you're trying to use Zig 0.14.0-dev.1021+fc2924080 (which came after that change) to compile a commit of Zig made before that change, which will not work due to the breaking change in the tokenizer.

More information on how to build Zig from source is available here: https://github.com/ziglang/zig/wiki/Building-Zig-From-Source

I also recommend that, for any difficulties building Zig from source for the first time, you reach out for help in one of the Zig communities since there will likely be follow-up questions during the process which would be better suited for one of the community spaces than the issue tracker.

@andrewrk andrewrk added question No questions on the issue tracker, please. and removed bug Observed behavior contradicts documented or intended behavior labels Aug 13, 2024
@andrewrk andrewrk closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question No questions on the issue tracker, please.
Projects
None yet
Development

No branches or pull requests

3 participants