-
Notifications
You must be signed in to change notification settings - Fork 117
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 |
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: