!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

707 Members
Rust158 Servers

Load older messages


SenderMessageTime
11 Feb 2025
@rosssmyth:matrix.orgrosssmyth *

Hello. How am I supposed to use makeRustPlatform? I have code like this:

      msrv_toolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
      rustPlatform = pkgs.makeRustPlatform {
        cargo = msrv_toolchain;
        rustc = msrv_toolchain;
      };
...
    mypackage = pkgs.callPackage mkThing { inherit rustPlatform };

and I am getting an error that says

  error: attribute 'buildPackage' missing
       at /nix/store/njnqqp2qgx2jfzk8jbfxghhm8x3gb4vl-source/flake.nix:37:7:
           36|     in
           37|       rustPlatform.buildPackage {

The package is just something like

    {
      pkgs,
      rustPlatform,
      ...
    }:
      rustPlatform.buildPackage {
          ...
      }
15:38:59
@rosssmyth:matrix.orgrosssmythAnd I can't use the debugger cause it just segfaults upon hitting any breakpoints 🥲15:40:45
@rosssmyth:matrix.orgrosssmythStupid mistake #2 this week. Ignore the above. 🥲19:00:52
12 Feb 2025
@maounomusume:matrix.orgmaounomusume joined the room.00:02:06
@glepage:matrix.orgGaétan Lepage Hey, I was not able to find how to specify build features when using Maturin.
I tried buildFeatures but it didn't propagate into maturin's flags.
08:58:02
@glepage:matrix.orgGaétan Lepage Seems like the best way is maturinBuildFlags. 09:45:14
@kira:jakira.spaceKira changed their display name from kira to Kira.19:59:40
@cleverca22:matrix.orgcleverca22 when using rustPlatform.buildRustPackage, is there a way to set the version in nix automatically from the cargo lock file? 20:36:07
@marcel:envs.net@marcel:envs.netDo you mean something like that? https://github.com/dd-ix/sflow_exporter/blob/main/package.nix#L820:36:39
@cleverca22:matrix.orgcleverca22ah, that looks good, let me try it20:37:06
@cleverca22:matrix.orgcleverca22
In reply to @marcel:envs.net
Do you mean something like that?
https://github.com/dd-ix/sflow_exporter/blob/main/package.nix#L8
yep, that works perfectly!
20:38:21
@cleverca22:matrix.orgcleverca22now to do the same thing on nodejs, thats far simpler, but also basically identical to the above!20:46:50
@cleverca22:matrix.orgcleverca22 manifest = pkgs.lib.importJSON ./package.json; and done! 20:48:54
13 Feb 2025
@sandro:supersandro.deSandro 🐧 Niklas Korz Alyssa Ross do you have any idea how I can myself bring the mitmproxy update forward? My rust compiler building skills are not enough to implement what you suggested above... 14:28:37
@qyliss:fairydust.spaceAlyssa RossThe issue still hasn't really been properly reported upstream14:31:36
@qyliss:fairydust.spaceAlyssa RossOnly in a comment14:31:38
@qyliss:fairydust.spaceAlyssa RossSo I think the next step would be to properly report the issue upstream14:31:54
@qyliss:fairydust.spaceAlyssa Ross

but ultimately rustc's build system needs to be fixed by someone

14:32:06
@qyliss:fairydust.spaceAlyssa Rossthere's not even anything in the compiler that needs to be fixed, just its build system14:32:36
@niklaskorz:korz.devNiklas Korz
In reply to @qyliss:fairydust.space
there's not even anything in the compiler that needs to be fixed, just its build system
Yeah I still haven't quite understood what needs to be fixed unfortunately
14:35:59
@niklaskorz:korz.devNiklas Korz I digged through the docs part of the build chain and that seemed to have handling for no std targets already 14:36:21
@niklaskorz:korz.devNiklas Korz * I digged through the docs part of the build chain and that seemed to have handling for no_std targets already 14:36:38
@niklaskorz:korz.devNiklas KorzBut I might have been looking in the wrong corner of rustc14:36:59
@qyliss:fairydust.spaceAlyssa RossIIRC the problem was that it didn't accomodate the possibility that you'd be building std and no_std targets at the same time.14:37:22
@emilazy:matrix.orgemily Alyssa Ross: does this look like anything familiar? https://hydra.nixos.org/build/288008080/nixlog/1 looks like it broke when the useFetchCargoVendor cycle landed 14:38:20
@emilazy:matrix.orgemily(going to investigate myself at some point since I theoretically maintain it, but maybe it's something obvious/known)14:38:39
@emilazy:matrix.orgemily cc Toma 14:38:51
@niklaskorz:korz.devNiklas Korz
In reply to @qyliss:fairydust.space
IIRC the problem was that it didn't accomodate the possibility that you'd be building std and no_std targets at the same time.
I'll have another look if I can nail it down
14:40:33
@tomasajt:matrix.orgToma
In reply to @emilazy:matrix.org
Alyssa Ross: does this look like anything familiar? https://hydra.nixos.org/build/288008080/nixlog/1 looks like it broke when the useFetchCargoVendor cycle landed

finalAttrs.cargoDeps.patches is no longer valid (maybe null, idk can't check rn), since patches gets passed into cargoDeps.vendorStaging

there should probably be a way to pass attrs to the non-staging drv. Though, in this case we actually need to pass to the staging FOD.
So the fix is probably just using finalAttrs.cargoDeps.vendorStaging.patches

15:31:23
@tomasajt:matrix.orgToma--- Btw are we still considering renaming fetchCargoVendor? If yes, we probably need a better name than .vendorStaging. Ideas: .staging, .stage, .fod anyone have better names?15:35:55

Show newer messages


Back to Room ListRoom Version: 6