Comments (2)
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.
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)
- `CARGO_MANIFEST_LINKS` environment variable missing in build environment HOT 1
- Specify the toolchain used to build the main project HOT 6
- Panic when running `crate2nix generate` HOT 6
- crate2nix stumbles over arbitrary #[cfg] conditionals HOT 4
- error inheriting `version` from workspace root manifest's `workspace.package.version` HOT 1
- Set custom environment variables in `packages` and `devShells` HOT 1
- rustc 1.73 breaks crate2nix cross compilation HOT 5
- Cargo.nix includes references to ./crate2nix-sources with cargo workspaces HOT 1
- nixpkgs update breaks empty_cross test due to missing `rust` arguement HOT 7
- rstests adds a stray "/sources" to all globbed #[files] HOT 1
- Support path to Cargo.toml/Cargo.lock in fetched sources
- Tarball issue when building or trying to use template. HOT 1
- Error with dep that has a local dep
- Some sort of support for .cargo/config.toml ? HOT 1
- Overriding `crateConfig` for generated `Cargo.nix`
- Crate hash loading from Cargo.lock is broken in Rust 1.77
- Respect cargo profiles / enable debug info in release mode HOT 1
- Allow some crates to access more files than just those in their folder
- IFD is crazy slow due to copying the entire tree HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crate2nix.