!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

708 Members
Rust160 Servers

Load older messages


SenderMessageTime
20 Feb 2025
@charles:computer.surgeryCharles ⚡️another rust release, another waiting an extra 12+ hours for fenix to update to be able to use it18:10:10
@niklaskorz:korz.devNiklas Korzrust-overlay already has it18:26:33
@charles:computer.surgeryCharles ⚡️overlays are too big a hammer for this imo19:13:00
@charles:computer.surgeryCharles ⚡️maybe the solution is to use rust-overlay and import nixpkgs twice19:13:29
@charles:computer.surgeryCharles ⚡️or make my own replacement for fenix19:13:48
@emilazy:matrix.orgemilyhuh?19:13:50
@emilazy:matrix.orgemilyrust-ovelray has almost an identical interface to fenix19:13:55
@emilazy:matrix.orgemilyyou can use it without actually overlaying19:14:01
@niklaskorz:korz.devNiklas Korzyou don't have to use rust-overlay as an overlay, yeah19:14:07
@charles:computer.surgeryCharles ⚡️what, how19:14:12
@charles:computer.surgeryCharles ⚡️manual, relay instructions19:15:11
* @charles:computer.surgeryCharles ⚡️ checks for docs19:15:16
@niklaskorz:korz.devNiklas Korz it also exposes packages 19:15:57
@niklaskorz:korz.devNiklas Korz * it also exposes packages on its flake 19:16:01
@niklaskorz:korz.devNiklas Korz packages.${system}.default is the latest stable rust, so 1.85.0 now 19:16:21
@charles:computer.surgeryCharles ⚡️i would like to not use flakes19:17:07
@charles:computer.surgeryCharles ⚡️ the default.nix is just the overlay 19:17:15
@niklaskorz:korz.devNiklas Korzin that case you could probably just copy mkRustBin from flake.nix:19:18:24
@niklaskorz:korz.devNiklas Korz
    # Builder to construct `rust-bin` interface on an existing `pkgs`.
    # This would be immutable, non-intrusive and (hopefully) can benefit from
    # flake eval-cache.
    #
    # Note that this does not contain compatible attrs for mozilla-overlay.
    mkRustBin =
      { distRoot ? defaultDistRoot }:
      pkgs:
      lib.fix (rust-bin: import ./lib/rust-bin.nix {
        inherit lib pkgs;
        inherit (rust-bin) nightly;
        manifests = mkManifests distRoot;
      });
19:18:27
@niklaskorz:korz.devNiklas Korz well, of course you'll have to replace ./lib/rust-bin.nix with ${rust-overlay}/lib/rust-bin.nix here 19:18:46
@charles:computer.surgeryCharles ⚡️that would work i guess but is unfortunate19:19:43
@niklaskorz:korz.devNiklas Korz

then you can do something like

rust-stable = (mkRustBin { } pkgs).stable.latest.default
19:20:15
@niklaskorz:korz.devNiklas Korz *

then you can do something like

rust-stable = (mkRustBin { } pkgs).stable.latest.default;
19:20:19
@charles:computer.surgeryCharles ⚡️ actually it would probably be easiest to just import lib/rust-bin.nix directly 19:20:35
@charles:computer.surgeryCharles ⚡️since i would already have a nixpkgs at the point i would need to call this19:20:55
21 Feb 2025
@amihsekai:matrix.orgthou-vow joined the room.05:49:50
@niklaskorz:korz.devNiklas KorzConcerning https://github.com/NixOS/nixpkgs/pull/383717#issuecomment-2673988082 : Was the linker setting in .cargo/config.toml previously ignored and now it's somehow picked up by buildRustPackage?09:32:47
@niklaskorz:korz.devNiklas Korz Or was clang previously accidentally exposed to buildRustPackage? 🤔 09:36:47
@kraem:ne.bul.aekraem

i'm using crane to build dependencies and the finaly binary in two different steps.
after building the dependencies i'm exporting the closure using nix-store --export $(nix-store --query --requisites ./result).
since that doesn't include the cargo-deps-.drv-files and their outputs, when i run nix-store --import and building the final binary (on a different host for example) the final-binary-step builds them, creating double work.
when trying to export them as well, some of the drv-files aren't present:

export drvs=$(nix-store -q --requisites $(nix-store --query --deriver ./result/) | grep cargo-package)
export outputs$(nix-store -q --outputs $(nix-store -q --requisites $drvs)) # <- this errors since some of the drv-files aren't present in the nix store

how can i make sure to export all the drv-files and their outputs when exporting a nix store closure?

12:58:43
@kraem:ne.bul.aekraem *

i'm using crane to build dependencies and the finaly binary in two different steps.
after building the dependencies i'm exporting the closure using nix-store --export $(nix-store --query --requisites ./result).
since that doesn't include the cargo-deps-.drv-files and their outputs, when i run nix-store --import and building the final binary (on a different host for example) the final-binary-step builds them, creating double work.
when trying to export them as well, some of the drv-files aren't present:

export drvs=$(nix-store -q --requisites $(nix-store --query --deriver ./result/) | grep cargo-package)
export outputs$(nix-store -q --outputs $(nix-store -q --requisites $drvs)) 
# the line above errors since some of the drv-files aren't present in the nix store,
# even though i'm running this after building the final closure successfully

how can i make sure to export all the drv-files and their outputs when exporting a nix store closure?

13:00:04

Show newer messages


Back to Room ListRoom Version: 6