!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

703 Members
Rust156 Servers

Load older messages


SenderMessageTime
22 Mar 2025
@vaw:nlih.devaw joined the room.21:25:44
23 Mar 2025
@tomasajt:matrix.orgToma
In reply to @tomasajt:matrix.org
Some feedback would be appreciated for https://github.com/NixOS/nixpkgs/pull/390171
ideally, this should go into the current staging cycle

Looking for some feedback on this.

It un-breaks a few packages, including rustdesk*

10:37:54
@k900:0upti.meK900LGTM10:40:36
@k900:0upti.meK900But I don't understand it super well10:40:47
24 Mar 2025
@tomasajt:matrix.orgTomaBtw what do you all think about still keeping fetchCargoTarball around? Just in case fetchCargoVendor is incapable of doing something it might be useful. Though we'd probably want to make it clear that there are no hash stability guarantees.11:36:58
@k900:0upti.meK900I'd rather not have two ways of doing the same thing11:39:49
@k900:0upti.meK900If fetchCargoVendor can't do something, it should be fixed11:40:04
@emilazy:matrix.orgemilyI think it would be an attractive nuisance to keep11:42:03
@emilazy:matrix.orgemilyespecially since it'd probably require maintenance for future versions of the format anyway?11:42:53
@tomasajt:matrix.orgTomaI guess people can just copy the implementation out of tree if they really wanted to use it.13:03:22
@aloisw:julia0815.de@aloisw:julia0815.de joined the room.17:31:26
@aloisw:julia0815.de@aloisw:julia0815.de It seems that rustc.doc lost the standard library documentation somewhere in staging-next 2025-03-03. Is that issue known? 17:47:24
25 Mar 2025
@damccull:matrix.orgdamccull

Hello. Trying to set up a new bevy project in a flake. Getting this error:

target/debug/bevy-tut: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory

With this flake:

{
  inputs = {
    nixpkgs = {
      url = "github:nixos/nixpkgs/nixos-unstable";
    };
    flake-parts.url = "github:hercules-ci/flake-parts";
    rust-overlay.url = "github:oxalica/rust-overlay";
    surrealdb-gh.url = "github:surrealdb/surrealdb/v2.1.4";
  };
  outputs =
    inputs:
    inputs.flake-parts.lib.mkFlake { inherit inputs; } {
      systems = [ "x86_64-linux" ];
      perSystem =
        {
          config,
          self',
          pkgs,
          lib,
          system,
          ...
        }:
        let
          runtimeDeps = with pkgs; [
            alsa-lib
            libxkbcommon
            udev
            vulkan-loader
            wayland
            xorg.libX11
            xorg.libXcursor
            xorg.libXi
            xorg.libXrandr
          ];

          buildDeps = with pkgs; [
            clang
            lld
            lldb
            pkg-config
            rustPlatform.bindgenHook
            stdenv.cc.cc.lib
            # (wasm-bindgen-cli.overrideAttrs (oldAttrs: rec {
            #   version = "0.2.100";
            #   src = fetchCrate {
            #     pname = "wasm-bindgen-cli";
            #     version = version;
            #     hash = "sha256-3RJzK7mkYFrs7C/WkhW9Rr4LdP5ofb2FdYGz1P7Uxog=";
            #   };
            #
            #   cargoDeps = rustPlatform.fetchCargoVendor {
            #     inherit src;
            #     inherit (src) pname version;
            #     hash = "sha256-qsO12332HSjWCVKtf1cUePWWb9IdYUmT+8OPj/XP2WE=";
            #   };
            # }))
          ];

          devDeps =
            with pkgs;
            [
              # Libraries and programs needed for dev work; included in dev shell
              # NOT included in the nix build operation
              bacon
              bashInteractive
              bunyan-rs
              cargo-deny
              cargo-edit
              cargo-expand
              cargo-msrv
              cargo-nextest
              (cargo-whatfeatures.overrideAttrs (oldAttrs: rec {
                version = "0.9.13";
                src = fetchCrate {
                  pname = "cargo-whatfeatures";
                  version = "${version}";
                  hash = "sha256-Nbyr7u47c6nImzYJvPVLfbqgDvzyXqR1C1tOLximuHU=";
                };

                cargoDeps = rustPlatform.fetchCargoVendor {
                  inherit src;
                  inherit (src) pname version;
                  hash = "sha256-p95aYXsZM9xwP/OHEFwq4vRiXoO1n1M0X3TNbleH+Zw=";
                };
              }))
              gdb
              just
              nushell
              panamax
              zellij
            ]
            ++ [
              inputs.surrealdb-gh.packages.${system}.default
            ];

          cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
          msrv = cargoToml.package.rust-version;

          rustPackage =
            features:
            (pkgs.makeRustPlatform {
              cargo = pkgs.rust-bin.stable.latest.minimal;
              rustc = pkgs.rust-bin.stable.latest.minimal;
            }).buildRustPackage
              {
                inherit (cargoToml.package) name version;
                src = ./.;
                cargoLock.lockFile = ./Cargo.lock;
                buildFeatures = features;
                buildInputs = runtimeDeps;
                nativeBuildInputs = buildDeps;
                # Uncomment if your cargo tests require networking or otherwise
                # don't play nicely with the nix build sandbox:
                # doCheck = false;
              };

          ldpath = with pkgs; [
            stdenv.cc.cc.lib
          ];

          mkDevShell =
            rustc:
            pkgs.mkShell {
              shellHook = ''
                # TODO: figure out if it's possible to remove this or allow a user's preferred shell
                exec env SHELL=${pkgs.bashInteractive}/bin/bash zellij --layout ./zellij_layout.kdl
              '';
              LD_LIBRARY_PATH = lib.makeLibraryPath ldpath;

              GIO_MODULE_DIR = "${pkgs.glib-networking}/lib/gio/modules/";

              RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
              buildInputs = runtimeDeps;
              nativeBuildInputs = buildDeps ++ devDeps ++ [ rustc ];
            };

          rustTargets = [
            "x86_64-unknown-linux-gnu"
            "x86_64-linux-android"
            "aarch64-linux-android"
            "wasm32-unknown-unknown"
          ];

          rustExtensions = [
            "rust-analyzer"
            "rust-src"
          ];
        in
        {

          _module.args.pkgs = import inputs.nixpkgs {
            inherit system;
            overlays = [ (import inputs.rust-overlay) ];
            config = {
              allowUnfreePredicate =
                pkg:
                builtins.elem (lib.getName pkg) ([
                  "surrealdb"
                ]);
              android_sdk.accept_license = true;
            };
          };

          packages.default = self'.packages.base;
          devShells.default = self'.devShells.stable;

          packages.base = (rustPackage "");
          packages.bunyan = (rustPackage "bunyan");
          packages.tokio-console = (rustPackage "tokio-console");

          devShells.nightly = (
            mkDevShell (
              pkgs.rust-bin.selectLatestNightlyWith (
                toolchain:
                toolchain.default.override {
                  extensions = rustExtensions;
                  targets = rustTargets;
                }
              )
            )
          );
          devShells.stable = (
            mkDevShell (
              pkgs.rust-bin.stable.latest.default.override {
                extensions = rustExtensions;
                targets = rustTargets;
              }
            )
          );
          devShells.msrv = (
            mkDevShell (
              pkgs.rust-bin.stable.${msrv}.default.override {
                extensions = rustExtensions;
                targets = rustTargets;
              }
            )
          );
        };
    };
}

Really not sure why since I have udev in the place it's supposed to be according to bevy docs, and I've tried it in all the places I can think of anyways. Suggestions?

00:49:39
@damccull:matrix.orgdamccullAh, nevermind. It was an LD_PATH issue.01:23:03
@damccull:matrix.orgdamccull* Ah, nevermind. It was an LD_LIBRARY_PATH issue.01:23:16
@ralith:ralith.comRalithsounds like they're using dlopen when they should be linking02:45:09
@tomasajt:matrix.orgTomaThere are a few packages (around 3) still using the first cargo lockfile format in-tree, so I made this https://github.com/NixOS/nixpkgs/pull/39301612:41:11
@k900:0upti.meK900Can we just delete them instead lol 12:42:00
@emilazy:matrix.orgemilywe already removed tons of packages for that12:43:10
@emilazy:matrix.orgemilyare the remaining ones that important?12:43:20
@emilazy:matrix.orgemilykubernix looks like something that probably won't even work any more and that is likely using ancient/insecure versions if it does12:44:25
@tomasajt:matrix.orgTomaokay, I don't really care if it doesn't get merged, the main thing is that the PR exists so in case someone really wants it they can take the changes12:46:13
@k900:0upti.meK900What's the packages?12:46:44
@k900:0upti.meK900Do we have a list?12:46:52
@tomasajt:matrix.orgTomasee the linked issue12:46:51
@k900:0upti.meK900https://github.com/yxdunc/lipl has a v3 lockfile in master and hasn't been touched in 3 years otherwise12:47:56
@k900:0upti.meK900kubernix author is also its maintainer in nixpkgs12:48:40
@k900:0upti.meK900We can probably ask for a tag?12:48:43
@k900:0upti.meK900system-syzygy has a 1.0.2 tag with a v3 lockfile12:49:29
@k900:0upti.meK900I feel like we can just bump the two and ask the author about the third one 12:50:53

Show newer messages


Back to Room ListRoom Version: 6