!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

685 Members
Rust153 Servers

Load older messages


SenderMessageTime
2 Dec 2021
@ralith:ralith.comRalithyeah, I do all my dev in a shell00:00:46
@brendanzab:matrix.orgbrendanzabahh gotcha00:02:10
@brendanzab:matrix.orgbrendanzabthanks for the insights! can be a bit bewhildering hehe00:02:43
@brendanzab:matrix.orgbrendanzabknowing what to choose 😅00:02:58
@brendanzab:matrix.orgbrendanzabThis was what I ended up with: https://gist.github.com/brendanzab/eecc9d0b0e9c4042db1b736264e8c11c00:06:22
@brendanzab:matrix.orgbrendanzabalthough I think I might remove the packaging stuff and just keep the shell stuff, based on what folks have said00:06:53
@brendanzab:matrix.orgbrendanzabnow gotta figure out how to get VS Code to work with it 😰00:07:20
@brendanzab:matrix.orgbrendanzabhow do you work with different toolchains? as a library developer I often want to test against nightly, beta, stable, pinned toolchains. Do you just use the stable toolchain in your development flake, and then test different stuff on CI? Or are there better ways to switch between00:13:30
@brendanzab:matrix.orgbrendanzabRe. developing in a shell, do you do it on a per-package basis, or do you install cargo/rust globally? I know the latter probably isn't recommended, but seems like it could be easier for the random Rust project?00:24:41
@ralith:ralith.comRalithI have a shell per project; they tend to vary02:01:30
@ralith:ralith.comRalithyou can have a common shell that you reuse though02:01:46
@brendanzab:matrix.orgbrendanzabhow do you cope if a project is not using nix?02:05:01
@brendanzab:matrix.orgbrendanzabdo you make a personal project-specific nix thing?02:05:23
@brendanzab:matrix.orgbrendanzab * do you make a personal project-specific nix thing that you hide in your local ignores?02:05:36
@brendanzab:matrix.orgbrendanzabat any rate, this is what I ended up with: https://gist.github.com/brendanzab/8b9f1abfc28fca8fbdef745995be3a7602:06:22
@brendanzab:matrix.orgbrendanzabdunno if it can be simplified more02:06:50
@brendanzab:matrix.orgbrendanzabI've got an .envrc that loads it, and seems to work nicely with vs code02:07:23
@brendanzab:matrix.orgbrendanzab * I've got an .envrc that loads it, and seems to work nicely with vs code and rust-analyzer with no dramas02:07:36
@ralith:ralith.comRalithyeah I drop local shell.nixes in stuff all the time05:39:42
@patsakula:matrix.orgPatsakula Nikita joined the room.14:20:19
@patsakula:matrix.orgPatsakula Nikita Hello! I am nix-noobie and I need a little help:( I tried to use cargo2nix with my project and faced the problem: one of my dependencies using libclang.so and I figured out how to add it as a dependency, but I don't know how to inject shellHook (it don't see the path without it). I will be glad any hint! 14:30:09
@patsakula:matrix.orgPatsakula Nikita
            (pkgs.rustBuilder.rustLib.makeOverride {
              name = "librocksdb-sys";
              overrideAttrs = drv: {
                propagatedNativeBuildInputs = drv.propagatedNativeBuildInputs or [ ] ++ [
                  pkgs.llvmPackages_13.libclang
                ];
                # It didn't help:
                paths = [
                  pkgs.llvmPackages_13.libclang
                ];
              };
            })

My flake.nix ^

 >   thread 'main' panicked at 'Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', src/lib.rs:2144:31

Error message ^

14:42:03
@mikroskeem:d0.eeMark LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib" 18:00:37
@mikroskeem:d0.eeMarkPatsakula Nikita: that should do the trick18:00:59
@mikroskeem:d0.eeMarki'm using that for building a thing which is using librocksdb-sys18:01:27
@mikroskeem:d0.eeMarkthat's an attribute btw18:02:48
@mikroskeem:d0.eeMarkbut i'm not 100% sure if that'll work with this derivation, derivation i'm using this in is using rustPlatform.buildRustPackage18:04:06
@jonringer:matrix.orgjonringer cargo makes heavy usage of pkg-config. Usually adding that to nativeBuildInputs fixes most search logic 20:44:51
@mikroskeem:d0.eeMarklibrocksdb-sys is using rust-bindgen, which in turn is using libclang to parse C/C++ headers20:47:50
@mikroskeem:d0.eeMarkhaving pkg-config in nativeBuildInputs does not help getting rust-bindgen working unfortunately20:48:44

Show newer messages


Back to Room ListRoom Version: 6