3 Sep 2024 |
emily | which people can use with rust-overlay/fenix | 16:25:40 |
emily | er, the non-dupe, rather. the [v2] one. | 16:25:49 |
Alyssa Ross | I do not think it is our responsibility to support years old Rust compilers | 16:26:27 |
emily | agreed | 16:26:33 |
emily | so, I'm a little confused about the FODs | 16:27:49 |
emily | do we not use the .cargo/config that fetch-cargo-tarball outputs at all? | 16:27:58 |
emily | it seems like we'd need to mv or ln them to avoid the warning unless they're just totally unused as part of the Rust builds? | 16:28:13 |
Alyssa Ross | that's what I'm wondering | 16:28:17 |
emily | yet more reason opaque FOD bundles with computed stuff that can never be changed are bad :'( | 16:30:06 |
| * emily bumps Rust rework a couple places up her to-do list | 16:30:17 |
Alyssa Ross | although everything in this PR seems good anyway | 16:31:04 |
Alyssa Ross | worst case it only fixes some of the warnings | 16:31:11 |
emily | yes, I think we could just merge it and sort out the rest later | 16:31:16 |
emily | but it'd be good to understand what's going on and @mmlb probably knows that better than me :) | 16:31:46 |
Ilan Joselevich (Kranzes) | In reply to @ultranix:matrix.org I guess crate2nix wont be able to build with something like this https://github.com/paritytech/polkadot-sdk/blob/master/substrate/utils/wasm-builder/src/builder.rs#L54 that reaches out to the root workspace manifest right? https://github.com/nix-community/crate2nix/commit/14d9c68123ae2d7ee94f91da28f3bf278c5cff0b can always do some patching and overriding | 17:33:34 |
emily | is there any way to .overrideAttrs a Rust package in practice? I've overridden src and cargoDeps but it just complains about the lock file being out of date for reasons I can't fathom. | 20:05:24 |
emily | doing the equivalent patch to the original package file works. | 20:05:33 |
ghpzin | How did you override cargoDeps ? | 20:11:39 |
emily | I tried cargoDeps = prevAttrs.cargoDeps.overrideAttrs { src = <the new src>; outputHash = "…"; } and it was behaving weird. now I'm trying cargoDeps = pkgs.rustPlatform.fetchCargoTarball { … } and it seems like it might be working? | 20:15:03 |
emily | ah, I think I figured out what was going wrong. (flake input overrides acting weirdly.) | 20:19:30 |
emily | is there a nice way to run clippy in nix flake check ? | 23:19:20 |
4 Sep 2024 |
getchoo | stdenv.mkDerivation {
name = "check-clippy";
inherit (aRustPackage) src cargoDeps;
nativeBuildInputs = [ cargo clippy rustPlatform.cargoSetupHook ];
buildPhase = "cargo clippy";
}
with aRustPackage being a derivation for the project you're running clippy on
| 01:51:59 |
getchoo | there are probably ways to do this better/re-use more stuff from the parent package like it's native/buildInputs but | 01:53:24 |
getchoo | hopefully you get the idea lol | 01:53:29 |
getchoo | * stdenv.mkDerivation {
name = "check-clippy";
inherit (aRustPackage) src cargoDeps;
nativeBuildInputs = [ cargo clippy rustPlatform.cargoSetupHook ];
buildPhase = "cargo clippy | tee $out";
}
with aRustPackage being a derivation for the project you're running clippy on
| 01:53:55 |
emily | right, I ended up doing something like that with runCommandCC since asking :) | 01:58:10 |
emily | was just hoping there was something more "native" | 01:58:14 |
emily | I considered doing an .overrideAttrs and changing all the phases too | 01:58:38 |
getchoo | it's not a bad option i just hate disabling some other stuff like the install step lol | 02:03:27 |
emily | yeah it's annoying | 02:04:04 |