-
Notifications
You must be signed in to change notification settings - Fork 125
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
Fails to build on Nix #184
Comments
Make sure that |
Ok, I've changed the shell now: {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
esp-dev = {
url = "github:thiskappaisgrey/nixpkgs-esp-dev-rust";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
esp-dev,
}: let
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ esp-dev.overlay ];
};
in {
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = with pkgs; [
gcc-riscv32-esp32c3-elf-bin
openocd-esp32-bin
# Tools required to use ESP-IDF.
git
wget
gnumake
flex
bison
gperf
pkg-config
cmake
ninja
ncurses5
python3
python3Packages.pip
python3Packages.virtualenv
];
shellHook = ''
export ESP_IDF_VERSION="v4.4"
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [ pkgs.libxml2 pkgs.zlib pkgs.stdenv.cc.cc.lib ]}"
export LIBCLANG_PATH=${pkgs.libclang.lib}/lib
'';
};
};
} Now I get this:
|
@knarkzel I am trying to make esp-idf for rust work on nix, same as you. I took a step back and side-stepped the issue of the idf source not being a git repo, by unsetting IDF_PATH and letting esp-idf-sys download it at runtime (in a nix develop session). Then, I stumbled on this __GLIBC_USE issue. I think it has to do with nix wrapping clang and adding include paths to it. But esp-idf does not want to pull in host system headers, which are being mixed up with headers from the cross compiler. So I removed clang from the shell inputs (but kept libclang), and it worked! It would still be nice to be able to use the esp toolchain from the nix store though. |
This is something I'm trying to get working too. I've bumped a Flake I forked with the ESP-IDF, but encountering a Git repo error. I think this will take some work..... |
Does anyone have a working flake? I'm also getting the |
@ChocolateLoverRaj i do with the dependencies of the flake above (actually without openocd-esp32-bin, flex, bison and gperf) but i put them in an FHS env with nix because the build process tried to execute it's own non-nix executables. |
Its a two part process: The first part is us installing essential stuff like the python virt_env + cmake + ninja + either riscv or xtensa gcc compiler needed for the specific ESP_IDF version, That could be more or less statically provided under the assumption that it follows the same layout ESP_IDF expacts. The second part and the bigger problem is that ESP_IDF also uses pip and a bunch of python dependancys e.g kconfig wrapper and esp-idf-component manager written in python, that depends on other stuff it pulls in via pip. Keep in mind that upstream has this deeply coupled inside there system so just providing something similar is not enough, it will just fail on certain test that are run inline when the cmake buildsystem is executed. So a complete solution would need to tackle the second part, the first part is more trivial. |
@auroraanna can u provide your |
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs
}: let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
fhs = pkgs.buildFHSUserEnv {
name = "fhs-shell";
targetPkgs = pkgs: with pkgs; [
gcc
pkg-config
libclang.lib
gnumake
cmake
ninja
git
wget
rustup
cargo-generate
espflash
python3
python3Packages.pip
python3Packages.virtualenv
];
};
in {
devShells.${pkgs.system}.default = fhs.env;
};
} |
oh noes, just tried to delete all the build directories and see if it still works but somehow there's no compiler |
updated the flake now and it works. it seems that with |
I tried your flake.nix but this is the error I get:
|
why is your toolchain for x86_64 |
Maybe because I have |
Hi all, hitting a similar issue, can't install using the toolchain provided with my Nix devenv. It seems to be due to the fact that the folder where I have Code can be found here mostly under The error log:
|
I managed to make it work, here is a write-up of what was necessary: nix-community/fenix#58 (comment) Hope it helps! |
I removed {
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs
}: let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
fhs = pkgs.buildFHSUserEnv {
name = "fhs-shell";
targetPkgs = pkgs: with pkgs; [
gcc
pkg-config
libclang.lib
gnumake
cmake
ninja
git
wget
rustup
cargo-generate
espflash
python3
python3Packages.pip
python3Packages.virtualenv
ldproxy
];
};
in {
devShells.${pkgs.system}.default = fhs.env;
};
} it's nice how your solution doesn't need to set any environmental variables so I'll be using it instead of my previous flake. Another nice thing is that now I removed |
Awesome stuff, seems to be solved for now then? Basically get an environment able to build esp-idf right? |
I have everything setup except for the esp-idf which this crate should handle. However, when attempting to build, I get following:
All the code is located here.
The text was updated successfully, but these errors were encountered: