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

[Bug] not building with zig 0.14.0-dev #718

Open
1 task done
JonasFocke01 opened this issue Dec 7, 2024 · 2 comments
Open
1 task done

[Bug] not building with zig 0.14.0-dev #718

JonasFocke01 opened this issue Dec 7, 2024 · 2 comments
Labels
bug This issue or pull request discusses a bug

Comments

@JonasFocke01
Copy link

JonasFocke01 commented Dec 7, 2024

Pre-requisites

  • I have looked for any other duplicate issues

Ly version

current main branch

Observed behavior

I have never worked with zig before, so this might be just me being dumb. So any help is appreciated!

I cloned the repo, downloaded zig***.tar.gz (version 0.14.0), added zig to my path and ran $ zig build in the ly repo root directory. This build error came up after a few seconds:

~/Downloads/ly » zig build
/home/jonas/Downloads/ly/build.zig:93:48: error: expected type '*const fn (*Build.Step, Build.Step.MakeOptions) anyerror!void', found '*const fn (*Build.Step, Progress.Node) @typeInfo(@typeInfo(@TypeOf(build.ExeInstaller(true).make)).@"fn".return_type.?).error_union.error_set!void'
    installexe_step.makeFn = ExeInstaller(true).make;
                             ~~~~~~~~~~~~~~~~~~^~~~~
/home/jonas/Downloads/ly/build.zig:93:48: note: pointer type child 'fn (*Build.Step, Progress.Node) @typeInfo(@typeInfo(@TypeOf(build.ExeInstaller(true).make)).@"fn".return_type.?).error_union.error_set!void' cannot cast into pointer type child 'fn (*Build.Step, Build.Step.MakeOptions) anyerror!void'
/home/jonas/Downloads/ly/build.zig:93:48: note: parameter 1 'Progress.Node' cannot cast into 'Build.Step.MakeOptions'
/home/jonas/Downloads/zig-linux-x86_64-0.14.0-dev.2384+cbc05e0b1/lib/std/Build/Step.zig:71:25: note: struct declared here
pub const MakeOptions = struct {
                        ^~~~~~
/home/jonas/Downloads/zig-linux-x86_64-0.14.0-dev.2384+cbc05e0b1/lib/std/Progress.zig:80:18: note: struct declared here
pub const Node = struct {
                 ^~~~~~
referenced by:
    runBuild__anon_4410: /home/jonas/Downloads/zig-linux-x86_64-0.14.0-dev.2384+cbc05e0b1/lib/std/Build.zig:2296:44
    main: /home/jonas/Downloads/zig-linux-x86_64-0.14.0-dev.2384+cbc05e0b1/lib/compiler/build_runner.zig:339:29
    5 reference(s) hidden; use '-freference-trace=7' to see all references
/home/jonas/.cache/zig/p/122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b/build.zig:83:13: error: expected type '*const fn (*Build.Step, Build.Step.MakeOptions) anyerror!void', found '*const fn (*Build.Step, Progress.Node) anyerror!void'
            }
            ^
/home/jonas/.cache/zig/p/122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b/build.zig:83:13: note: pointer type child 'fn (*Build.Step, Progress.Node) anyerror!void' cannot cast into pointer type child 'fn (*Build.Step, Build.Step.MakeOptions) anyerror!void'
/home/jonas/.cache/zig/p/122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b/build.zig:83:13: note: parameter 1 'Progress.Node' cannot cast into 'Build.Step.MakeOptions'
/home/jonas/Downloads/zig-linux-x86_64-0.14.0-dev.2384+cbc05e0b1/lib/std/Build/Step.zig:71:25: note: struct declared here
pub const MakeOptions = struct {
                        ^~~~~~
/home/jonas/Downloads/zig-linux-x86_64-0.14.0-dev.2384+cbc05e0b1/lib/std/Progress.zig:80:18: note: struct declared here
pub const Node = struct {

Expected behavior

The build works as instructed from the readme

Steps to reproduce

Basically compile with zig 0.14.0

@JonasFocke01 JonasFocke01 added the bug This issue or pull request discusses a bug label Dec 7, 2024
@eirenicon
Copy link

Another zig 'novice' says the zig build instructions don't do as they ought...
Here's my error on Debian Sid:

mark@debian:~/ly$ zig build
./build.zig:27:21: error: container 'std' has no member called 'Build'
pub fn build(b: *std.Build) !void {
                    ^
/usr/lib/zig/0.6.0/lib/zig/std/special/build_runner.zig:131:35: note: referenced here
    switch (@typeInfo(@TypeOf(root.build).ReturnType)) {
                                  ^
./build.zig:11:24: error: container 'std' has no member called 'SemanticVersion'
    const min_zig = std.SemanticVersion.parse(min_zig_string) catch unreachable;

@wi2david
Copy link

Same problem here:

/home/wi2david/temp/ly/build.zig:93:48: error: expected type '*const fn (*Build.Step, Build.Step.MakeOptions) anyerror!void', found '*const fn (*Build.Step, Progress.Node) @typeInfo(@typeInfo(@TypeOf(build.ExeInstaller(true).make)).@"fn".return_type.?).error_union.error_set!void'
    installexe_step.makeFn = ExeInstaller(true).make;
                             ~~~~~~~~~~~~~~~~~~^~~~~
/home/wi2david/temp/ly/build.zig:93:48: note: pointer type child 'fn (*Build.Step, Progress.Node) @typeInfo(@typeInfo(@TypeOf(build.ExeInstaller(true).make)).@"fn".return_type.?).error_union.error_set!void' cannot cast into pointer type child 'fn (*Build.Step, Build.Step.MakeOptions) anyerror!void'
/home/wi2david/temp/ly/build.zig:93:48: note: parameter 1 'Progress.Node' cannot cast into 'Build.Step.MakeOptions'
/usr/local/src/zig-linux-x86_64-0.14.0-dev.2435+7575f2121/lib/std/Build/Step.zig:71:25: note: struct declared here
pub const MakeOptions = struct {
                        ^~~~~~
/usr/local/src/zig-linux-x86_64-0.14.0-dev.2435+7575f2121/lib/std/Progress.zig:80:18: note: struct declared here
pub const Node = struct {
                 ^~~~~~
referenced by:
    runBuild__anon_4253: /usr/local/src/zig-linux-x86_64-0.14.0-dev.2435+7575f2121/lib/std/Build.zig:2296:44
    main: /usr/local/src/zig-linux-x86_64-0.14.0-dev.2435+7575f2121/lib/compiler/build_runner.zig:339:29
    5 reference(s) hidden; use '-freference-trace=7' to see all references
/root/.cache/zig/p/122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b/build.zig:83:13: error: expected type '*const fn (*Build.Step, Build.Step.MakeOptions) anyerror!void', found '*const fn (*Build.Step, Progress.Node) anyerror!void'
            }
            ^
/root/.cache/zig/p/122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b/build.zig:83:13: note: pointer type child 'fn (*Build.Step, Progress.Node) anyerror!void' cannot cast into pointer type child 'fn (*Build.Step, Build.Step.MakeOptions) anyerror!void'
/root/.cache/zig/p/122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b/build.zig:83:13: note: parameter 1 'Progress.Node' cannot cast into 'Build.Step.MakeOptions'
/usr/local/src/zig-linux-x86_64-0.14.0-dev.2435+7575f2121/lib/std/Build/Step.zig:71:25: note: struct declared here
pub const MakeOptions = struct {
                        ^~~~~~
/usr/local/src/zig-linux-x86_64-0.14.0-dev.2435+7575f2121/lib/std/Progress.zig:80:18: note: struct declared here
pub const Node = struct {
                 ^~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request discusses a bug
Projects
None yet
Development

No branches or pull requests

3 participants