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

unrecognized argument: '--zig-lib-dir' #20628

Closed
jhert0 opened this issue Jul 14, 2024 · 1 comment
Closed

unrecognized argument: '--zig-lib-dir' #20628

jhert0 opened this issue Jul 14, 2024 · 1 comment
Labels
question No questions on the issue tracker, please.

Comments

@jhert0
Copy link
Contributor

jhert0 commented Jul 14, 2024

Zig Version

0.14.0-dev.244+0d79aa017

Steps to Reproduce and Observed Behavior

When I run the following command to try to build the latest version of zig:

zig build -p stage3 --search-prefix ../zig-bootstrap/out/x86_64-linux-gnu-baseline/ --zig-lib-dir lib -Dstatic-llvm

I get the following error:

unrecognized argument: '--zig-lib-dir'
  access the help menu with 'zig build -h'
error: the following build command failed with exit code 1:
/home/jeremy/src/zig/.zig-cache/o/04f409a5553650b211f747552cb2d319/build /home/jeremy/.local/bin/zig/zig /home/jeremy/src/zig /home/jeremy/src/zig/.zig-cache /home/jeremy/.cache/zig --seed 0x21503f73 -Ze77f9396bd147a4a -p stage3 --search-prefix ../zig-bootstrap/out/x86_64-linux-gnu-baseline/ --zig-lib-dir lib -Dstatic-llvm

If I run zig build -h it just starts building and does not display the help menu and I get the following error:

/home/jeremy/src/zig/build.zig:598:25: error: no field or member function named 'addUpdateSourceFiles' in 'Build'
    const copy_zig_h = b.addUpdateSourceFiles();
                       ~^~~~~~~~~~~~~~~~~~~~~
/home/jeremy/.local/bin/zig/lib/zig/std/Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
referenced by:
    build: /home/jeremy/src/zig/build.zig:535:26
    runBuild__anon_8843: /home/jeremy/.local/bin/zig/lib/zig/std/Build.zig:2156:43
    4 reference(s) hidden; use '-freference-trace=6' to see all references
/home/jeremy/src/zig/build.zig:1285:64: error: no field named 'zig_lib_directory' in struct 'Build.Graph'
        cmd.addArgs(&.{ "--zig-lib-dir", b.fmt("{}", .{b.graph.zig_lib_directory}) });
                                                               ^~~~~~~~~~~~~~~~~
/home/jeremy/.local/bin/zig/lib/zig/std/Build.zig:112:19: note: struct declared here
pub const Graph = struct {
                  ^~~~~~
/home/jeremy/src/zig/test/tests.zig:774:45: error: type '[]const u8' does not support struct initialization syntax
        const cleanup = b.addRemoveDirTree(.{ .cwd_relative = tmp_path });
                                           ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected Behavior

To build zig, I've used that command in the past to build it and it has worked but maybe something has changed and I've missed it.

@jhert0 jhert0 added the bug Observed behavior contradicts documented or intended behavior label Jul 14, 2024
@kcbanner
Copy link
Contributor

#20580 has changes to the build runner (it now takes a different set of arguments).

This means you'll have to build from source (ie. via CMake) to get a version of zig that can build itself.

@Vexu Vexu added question No questions on the issue tracker, please. and removed bug Observed behavior contradicts documented or intended behavior labels Jul 14, 2024
@Vexu Vexu closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 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