Git Product home page Git Product logo

Comments (2)

pacak avatar pacak commented on June 29, 2024

I think rust version that gets passed to "${crate2nix}/tools.nix" is different from rust version you get when you nix run, try checking that.

from crate2nix.

Ten0 avatar Ten0 commented on June 29, 2024

That seems to not be the source of the issue.

nix run

When I nix run it uses cargo 1.76.0 as pinned in your nixpkgs, since nix derivation show github:nix-community/crate2nix shows /nix/store/8s7fd4c5r06d4x94vqbmgwsv05v2jmlb-cargo-1.76.0.drv, UNLESS there is also another cargo version in path, in which case it uses that one.
Either way (1.76.0 or my 1.77.0) I don't get any error when running crate2nix generate, and build then runs - although the generated files look different in that they don't use the same ID format.

IFD

I was doing (pkgs.callPackage "${crate2nix}/tools.nix" { }).generatedCargoNix, which had me override the pkgs, but I happened to also have 1.76 there (/nix/store/7ld12b9gmdziwrvjyb1lhf5y49b7l0nw-cargo-1.76.0.drv).
I also tried using crate2nix.tools.${system}.generatedCargoNix, which prevents me from overriding and instead uses the version that you're exporting, but that does result in the same error, despite it picking the exact same derivation as non-ifd: /nix/store/8s7fd4c5r06d4x94vqbmgwsv05v2jmlb-cargo-1.76.0.drv.

So it would look like that's not the source of the issue.

I also made sure to be generating the Cargo.lock on 1.76 if that matters.

Side note

  • When building afterwards - if I get to that point - and in the associated dev shell, I'm then using latest stable from oxalica:
          {
            buildRustCrateForPkgs = pkgs: pkgs.buildRustCrate.override (
              let rustToolchain = pkgs.rust-bin.stable.latest; in {
                # Use the latest stable rust version from oxalica overlay instead of the one in nixpkgs to build workspace packages
                # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md
                # https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/rust/build-rust-crate/default.nix#L12-L13
                rustc = rustToolchain.default;
                cargo = rustToolchain.cargo;
                # We need to override some dependencies/env variables... for some crates - that is specified in crate_overrides.nix
                defaultCrateOverrides = pkgs.callPackage ./crate_overrides.nix { inherit flake-inputs packages cargoNix; };
              }
            );
          };

That's currently pinned at 1.77.0 in the flake.
If it matters that this is the same version that we generate the Cargo.nix for (that Cargo.lock is generated with...), then I wonder how I could override tools.nix to have it use that version from my pkgs.rust-bin - there doesn't seem to be a corresponding argument.

from crate2nix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.