buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.15k stars 31 forks source link

build error zig 11 #209

Closed ThanosYeah closed 8 months ago

ThanosYeah commented 8 months ago

I use zig 11 and use nix-os,when i try to zig build run --game-of-life.buzz it shows this:/buzz/build.zig:527:8: error: member function expected 2 argument(s), found 1 lib.addCSourceFiles(


/nix/store/6vgflg2gmqs0cn6n3h2npimfcybizwwp-zig-0.11.0/lib/zig/std/Build/Step/Compile.zig:891:5: note: function declared here
pub fn addCSourceFiles(self: *Compile, files: []const []const u8, flags: []const []const u8) void {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    build: /home/debian/Desktop/CustomCli/buzz/build.zig:269:27
    runBuild__anon_7165: /nix/store/6vgflg2gmqs0cn6n3h2npimfcybizwwp-zig-0.11.0/lib/zig/std/Build.zig:1639:37
    remaining reference traces hidden; use '-freference-trace' to see all reference traces note(i have already done everything that is says for building/developing in the landing page of the repo)
giann commented 8 months ago

You have to use the nightly build of zig.

build.zig should have complained about it.

ThanosYeah commented 8 months ago

Sorry,(I am new to zig,the question may sound dumb)how to use the nightly build of zig(i have installed the

zig-linux-x86_64-0.12.0-dev.899+027aabf49.tar.xz --) is it nightly or do i have to do something else

giann commented 8 months ago

Yes you take the download under the "master" section

giann commented 8 months ago

If you're under linux x86_64 a binary of buzz is available on the 0.3.0 release

ThanosYeah commented 8 months ago

i did install it from there and then did the same command and it shows me the same error(what to do? I am using the latest zig version),Also you should make the binary which the user can download in tag 3.0 nix friendly cause it might be hard-coded,it shows this:Warning: execve: No such file or directory which is a common sign of hard-coded program

giann commented 8 months ago

I don't know what you mean by hard-coded?

If you have the same error you must not be using the correct version of zig still: you can see here that addCSourceFiles expects 1 argument.

ThanosYeah commented 8 months ago

I don't know what you mean by hard-coded?

If you have the same error you must not be using the correct version of zig still: you can see here that addCSourceFiles expects 1 argument.

What version of zig do you use? Also when I say it is hard coded it links to files that nix doesn't have but other Linux have more detailed for full explanation:https://discourse.nixos.org/t/dolphin-cant-find-execvp-and-bash-cant-find-the-script-i-ask-it-to-execute/21338

giann commented 8 months ago

I use the one you mentioned: 0.12.0-dev.899+027aabf49

ThanosYeah commented 8 months ago

I use the one you mentioned: 0.12.0-dev.899+027aabf49

I don't know why,I will try to compile zig myself and use a vm.Should I close the issue?

giann commented 8 months ago

Can you try outside of nix? Seems like you installed zig 0.11 and then 0.12 but it's still using 0.11?

We can continue the discussion on Discord if you want.

ThanosYeah commented 8 months ago

Resolved:use nix shell 'github:mitchellh/zig-overlay#master' it installs latest zig version including nightly