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

Failed to open metadata error #169

Open
prescientmoon opened this issue Sep 23, 2024 · 1 comment
Open

Failed to open metadata error #169

prescientmoon opened this issue Sep 23, 2024 · 1 comment

Comments

@prescientmoon
Copy link

prescientmoon commented Sep 23, 2024

I have the following flake

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/release-24.05";
    flake-utils.url = "github:numtide/flake-utils";
    fenix.url = "github:nix-community/fenix";
    fenix.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs =
    { ... }@inputs:
    inputs.flake-utils.lib.eachSystem (with inputs.flake-utils.lib.system; [ x86_64-linux ]) (
      system:
      let
        pkgs = inputs.nixpkgs.legacyPackages.${system}.extend inputs.fenix.overlays.default;
        inherit (pkgs) lib;
      in
      {
        devShell = pkgs.mkShell rec {
          packages = with pkgs; [
            (fenix.complete.withComponents [
              "cargo"
              "clippy"
              "rust-src"
              "rustc"
              "rustfmt"
              "rust-analyzer"
            ])
            ruff
            imagemagick
            fontconfig
            freetype

            clang
            llvmPackages.clang
            pkg-config

            leptonica
            tesseract
            openssl
            sqlite
          ];

          LD_LIBRARY_PATH = lib.makeLibraryPath packages;
          LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
        };
      }
    );
}

Trying to run cargo check --all-targets on a project split into a lib and a bunch of binaries yields errors like failed to open rmeta metadata: '/home/.../projects/.../target/debug/deps/libtoml_edit-966d927d27fec036.rmeta'. This looks like the same issue as this crane FAQ entry, although I'm installing all the things together, so I'm confused as to why it happens.

@prescientmoon
Copy link
Author

I have narrowed it down to it only happening when both --bin and --lib are passed at the same time. Still haven't found a fix.

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

1 participant