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

Error in DocumentStore.zig during installation due to new ZonGen changes #2167

Closed
gusvianadev opened this issue Feb 5, 2025 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@gusvianadev
Copy link

Zig Version

0.14.0-dev.3046+08d661fcf

ZLS Version

d3d11a0

Client / Code Editor / Extensions

No response

Steps to Reproduce and Observed Behavior

I think this error happens because of the latest zig master changes. std.zig.ZonGen.generate now receives 3 parameters instead of 2.

The error:

last 25 log lines:
       >       (0mq(B run lsp-codegen (lsp_types.zig)
       >          (0mq(B zig build-exe lsp-codegen Debug native failure
       > error: warning: Encountered error: FileNotFound, falling back to default ABI and dynamic linker.
       >
       > install
       > (0mq(B install zls
       >    (0mq(B zig build-exe zls ReleaseSafe native-native 1 errors
       > src/DocumentStore.zig:489:50: error: expected 3 argument(s), found 2
       >                     var zoir = try std.zig.ZonGen.generate(self.impl.allocator, self.tree);
       >                                    ~~~~~~~~~~~~~~^~~~~~~~~
       > /nix/store/kvsvwj6k2icdqj2camwgrfqwisx04124-zig-0.14.0-dev.3046+08d661fcf/lib/std/zig/ZonGen.zig:25:5: note: function declared here
       > pub fn generate(gpa: Allocator, tree: Ast, options: Options) Allocator.Error!Zoir {
       > ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > error: warning: Encountered error: FileNotFound, falling back to default ABI and dynamic linker.
       > warning: Encountered error: FileNotFound, falling back to default ABI and dynamic linker.
       > warning: Encountered error: FileNotFound, falling back to default ABI and dynamic linker.

flake.nix

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    zig-overlay = {
      inputs.nixpkgs.follows = "nixpkgs";
      url = "github:mitchellh/zig-overlay";
    };
    zls = {
      inputs = {
        nixpkgs.follows = "nixpkgs";
        zig-overlay.follows = "zig-overlay";
      };
      url = "github:zigtools/zls";
    };
  };
  outputs = { nixpkgs, zig-overlay, ... }@inputs: {
    devShells.x86_64-linux = let
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        overlays = [ zig-overlay.overlays.default ];
      };
      zls = inputs.zls.packages.x86_64-linux.default;
    in {
      default = pkgs.mkShell { packages = with pkgs; [ zigpkgs.master zls ]; };
    };
  };
}

flake.lock

{
  "nodes": {
    "flake-compat": {
      "flake": false,
      "locked": {
        "lastModified": 1696426674,
        "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-utils": {
      "inputs": {
        "systems": "systems"
      },
      "locked": {
        "lastModified": 1705309234,
        "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "flake-utils_2": {
      "inputs": {
        "systems": "systems_2"
      },
      "locked": {
        "lastModified": 1731533236,
        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "gitignore": {
      "inputs": {
        "nixpkgs": [
          "zls",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1709087332,
        "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
        "type": "github"
      },
      "original": {
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1738680400,
        "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "799ba5bffed04ced7067a91798353d360788b30d",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "nixpkgs": "nixpkgs",
        "zig-overlay": "zig-overlay",
        "zls": "zls"
      }
    },
    "systems": {
      "locked": {
        "lastModified": 1681028828,
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
        "owner": "nix-systems",
        "repo": "default",
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default",
        "type": "github"
      }
    },
    "systems_2": {
      "locked": {
        "lastModified": 1681028828,
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
        "owner": "nix-systems",
        "repo": "default",
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default",
        "type": "github"
      }
    },
    "zig-overlay": {
      "inputs": {
        "flake-compat": "flake-compat",
        "flake-utils": "flake-utils",
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1738757495,
        "narHash": "sha256-pIWjN75ZMDQmj77GiT8yV3U3pFpQsv9An+xnK+UxhMI=",
        "owner": "mitchellh",
        "repo": "zig-overlay",
        "rev": "4dfa3d690edb7ae4cb332229b68dcf1ef30a1a03",
        "type": "github"
      },
      "original": {
        "owner": "mitchellh",
        "repo": "zig-overlay",
        "type": "github"
      }
    },
    "zls": {
      "inputs": {
        "flake-utils": "flake-utils_2",
        "gitignore": "gitignore",
        "nixpkgs": [
          "nixpkgs"
        ],
        "zig-overlay": [
          "zig-overlay"
        ]
      },
      "locked": {
        "lastModified": 1738368765,
        "narHash": "sha256-OyB1FF0PWGpejRVJ62SU71zFSpvNKZpq5bF/uQ+IMNw=",
        "owner": "zigtools",
        "repo": "zls",
        "rev": "d3d11a089d608014d50aca429fcb8bd82724fedf",
        "type": "github"
      },
      "original": {
        "owner": "zigtools",
        "repo": "zls",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

Expected Behavior

It should build

Relevant log output

@gusvianadev gusvianadev added the bug Something isn't working label Feb 5, 2025
nm-remarkable added a commit to nm-remarkable/zls that referenced this issue Feb 5, 2025
@Techatrix
Copy link
Member

fixed by #2172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants