-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo install espup
fails on NixOS
#433
Comments
Apparently there's a nix package for espup: https://search.nixos.org/packages?channel=24.05&show=espup UPD: no, this breaks down the line due to seemingly different components being installed in different ways. Looks like either everything needs to be installed by cargo or everything needs to be installed by nixos, othewise problems happen. I don't think I know what I'm doing at this point. |
Pretty much every crate that depends on openssl fails to build. I created a new clean
Currently I'm trying this in my
openssl seems to be really determined to read from |
Omg I figured it out. Apparently the Anyway, that's not the end of my woes. There's also lots of out-of-space errors because nix-shell uses the wrong directory for temporary files or something. Anyway, that's seemingly fixed by adding to
To be honesty I don't understand why setting an environment variable affects a So if somebody else finds this, here's my { pkgs ? import <nixpkgs> {} }:
let
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
libPath = with pkgs; lib.makeLibraryPath [
# load external libraries that you need in your rust project here
];
in
pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [
];
buildInputs = with pkgs; [
pkg-config
llvmPackages.bintools
rustup
perl
#udev
#udev.dev
];
RUSTC_VERSION = overrides.toolchain.channel;
# https://github.com/rust-lang/rust-bindgen#environment-variables
LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ];
shellHook = ''
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
'';
# Add precompiled library to rustc search path
RUSTFLAGS = (builtins.map (a: ''-L ${a}/lib'') [
# add libraries here (e.g. pkgs.libvmi)
]);
NIX_LD = builtins.readFile "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
#NIX_LD_LIBRARY_PATH = libPath;
#LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.openssl ];
# Add glibc, clang, glib, and other headers to bindgen search path
BINDGEN_EXTRA_CLANG_ARGS =
# Includes normal include path
(builtins.map (a: ''-I"${a}/include"'') [
# add dev libraries here (e.g. pkgs.libvmi.dev)
pkgs.glibc.dev
])
# Includes with special directory paths
++ [
''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"''
''-I"${pkgs.glib.dev}/include/glib-2.0"''
''-I${pkgs.glib.out}/lib/glib-2.0/include/''
];
} |
The environment variable should be due to Thanks for sharing your process and the working setup! I'll be closing the issue, if any other issue arises, feel free to reopen. |
Bug description
Running `cargo install espup' under nixos fails with the following error:
To Reproduce
Steps to reproduce the behavior:
rustup
to configuration.nixcargo install espup
Expected behavior
My understanding is that it's not supposed to break
Screenshots
Environment
Additional context
The text was updated successfully, but these errors were encountered: