Skip to content

zig build fails with 'no member named use_stage1' #633

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

Closed
ysgard opened this issue Sep 7, 2022 · 11 comments
Closed

zig build fails with 'no member named use_stage1' #633

ysgard opened this issue Sep 7, 2022 · 11 comments

Comments

@ysgard
Copy link

ysgard commented Sep 7, 2022

On Linux (Fedora 36) using zig 0.9.1, using a completely fresh copy of zls.

➜  git clone --recurse-submodules https://github.com/zigtools/zls
Cloning into 'zls'...
<snip>cd zls
➜  zig build -Drelease-safe
./build.zig:12:8: error: no member named 'use_stage1' in struct 'std.build.LibExeObjStep'
    exe.use_stage1 = true;
       ^
@truemedian
Copy link
Contributor

zls only builds with the master branch of zig, zls does not work with 0.9.1

@ysgard
Copy link
Author

ysgard commented Sep 7, 2022

Ah 🤦 I missed that part. Thank you, and I'm sorry.

@ysgard ysgard closed this as completed Sep 7, 2022
@annymosse
Copy link

Hello there, I'm a new user and I'm using zig in my android device for playground tests, zls isn't working and provide same error, @truemedian what do you advice me to do to make it work ?
(Note : zls work very well in my PC).

@nektro
Copy link
Contributor

nektro commented Oct 17, 2022

by using a newer zig as mentioned above https://ziglang.org/download/

@annymosse
Copy link

@nektro https://ziglang.org/download/ doesn't include armv7a architecture for (version 0.10.x) so I can't build current zls master with zig 0.9.1 from my Android device.

@nektro
Copy link
Contributor

nektro commented Oct 20, 2022

in that case you'd have to cross compile zig on your desktop or wait for the 0.10.0 release happening on nov 1

@annymosse
Copy link

annymosse commented Oct 20, 2022

@nektro I'm so excited to start using it, Hopefully zigtools/zls will provide a pre-built version of zls for arm archs in the future.

(Edited: Currently can't compile it in my laptop of 8GB RAM 😅)

@Vexu
Copy link
Contributor

Vexu commented Oct 20, 2022

Note that you don't need an armv7a zig binary to build an armv7a zls binary, if you have some other device available you should be able to cross-compile zls by passing -Dtarget=arm-linux

@annymosse
Copy link

annymosse commented Oct 20, 2022

@Vexu ohh my bad 🤦🏻‍♂️ ; I forgot that I can use my laptop to compile zls to arm arch using already pre-built zig version 0.10.0, @Vexu thank you to remind me so much.

Edit: I have tried to buid zls using the current version of zig-linux-x86_64-0.10.0-dev.4474+b41b35f57, then it failed with the following log:

 /tmp/zig10/zig build -Dtarget=arm-linux
LLVM Emit Object... error: zls...
error: The following command terminated unexpectedly:
/tmp/zig10/zig build-exe -fstage1 /tmp/zls/src/main.zig --cache-dir /tmp/zls/zig-cache --global-cache-dir /home/annymosse/.cache/zig --name zls -target arm-linux -mcpu baseline --pkg-begin build_options /tmp/zls/zig-cache/options/6icK0MghLeT7w1pKyvgdBIO3ku-ZVtk_hS3MNC_c5qpy6eESj2vvJNLoLuuGXklb --pkg-end --pkg-begin known-folders /tmp/zls/src/known-folders/known-folders.zig --pkg-end --enable-cache 
error: the following build command failed with exit code 5:
/tmp/zls/zig-cache/o/82a3bc9b0c853e6a0e94c44fed935a19/build /tmp/zig10/zig /tmp/zls /tmp/zls/zig-cache /home/annymosse/.cache/zig -Dtarget=arm-linux

@DavidTheBugWriter
Copy link

I'm also having this issue, however my Zig version is 0.11.0-dev.617+1310ef757. I assume zls still only builds against Master. However a previous error for installing against zig 0.10.0 said

thread 8725807 panic: Your Zig version v0.10.0 does not meet the minimum build requirement of v0.11.0-dev.399+44ee1c885
/Users/david/projects/learning_language/zig/zls/build.zig:10:62: 0x1086c5720 in build (build)
if (current_zig.order(min_zig).compare(.lt)) @Panic(b.fmt("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig }));
^
/usr/local/Cellar/zig/0.10.0/lib/zig/build_runner.zig:231:38: 0x1086b5ec0 in runBuild (build)
.ErrorUnion => try root.build(builder),
^
/usr/local/Cellar/zig/0.10.0/lib/zig/build_runner.zig:212:17: 0x1086b269f in main (build)
try runBuild(builder);
^
/usr/local/Cellar/zig/0.10.0/lib/zig/std/start.zig:606:37: 0x1086b6264 in main (build)
const result = root.main() catch |err| {
^
???:?:?: 0x108a2b52d in ??? (???)
???:?:?: 0x0 in ??? (???)
error: the following build command crashed:
/Users/david/projects/learning_language/zig/zls/zig-cache/o/b1626255d8050f0ae864bf7bcd41ec60/build /usr/local/Cellar/zig/0.10.0/bin/zig /Users/david/projects/learning_language/zig/zls /Users/david/projects/learning_language/zig/zls/zig-cache /Users/david/.cache/zig -Drelease-fast


Soooo I'm a bit stuck.

@SuperAuguste
Copy link
Member

See ziglang/zig#13560. I'll fix this tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants