Skip to content
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

embuild shouldn't require git or .git to exist in order to build the project #81

Closed
svelterust opened this issue Oct 11, 2023 · 39 comments · Fixed by #95
Closed

embuild shouldn't require git or .git to exist in order to build the project #81

svelterust opened this issue Oct 11, 2023 · 39 comments · Fixed by #95

Comments

@svelterust
Copy link

When trying following in NixOS, it fails because this crate expects .git to exist for $ESP_IDF: https://github.com/knarkzel/hello-esp32c3

hello-esp32c3 via nix-shell-env ❯ cargo build
   Compiling esp-idf-sys v0.33.2
The following warnings were emitted during compilation:

warning: Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2, esp32h2, esp32c5]; explicitly specify an MCU to resolve this ambiguity

error: failed to run custom build command for `esp-idf-sys v0.33.2`

Caused by:
  process didn't exit successfully: `/home/odd/source/hello-esp32c3/target/debug/build/esp-idf-sys-c7e3a3706a45d51d/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:warning=Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2, esp32h2, esp32c5]; explicitly specify an MCU to resolve this ambiguity

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: None,
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: None,
      mcu: None,
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.1.1",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: Some(
              "/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1",
          ),
          extra_components: [],
          esp_idf_components: None,
      },
      esp_idf_sys_root_crate: None,
  }
  fatal: not a git repository (or any of the parent directories): .git
  fatal: not a git repository (or any of the parent directories): .git
  Error: '/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1' is not a git respository

  Caused by:
      0: command 'cd "/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1" && LANGUAGE="" LC_ALL="C.UTF-8" "git" "rev-parse" "--show-toplevel"' exited with non-zero status code 128
      1: fatal: not a git repository (or any of the parent directories): .git
@ivmarkov
Copy link
Collaborator

ivmarkov commented Oct 12, 2023

Here's a pull request that was already reviewed and requires just a little love from somebody to get merged. (As in cargo fmt.) I guess the contributor lost interest as she is not replying.

If you would like to own it, we can have this issue fixed.

What I would suggest is to clone / fork embuild with the above PR applied and patch your build to use your forked version of embuild. Do the same for esp-idf-sys (see my comment below) and then try to build this combo for *nix. If it works, you can resubmit the PR with cargo fmt applied.

@ivmarkov
Copy link
Collaborator

And the corresponding PR to esp-idf-sys that I can merge once the above PR is merged.

@svelterust
Copy link
Author

Awesome, I'll give it a shot

@esp-rs esp-rs deleted a comment from svelterust Oct 13, 2023
@ivmarkov
Copy link
Collaborator

@knarkzel Sorry - I've deleted your post. You know it could be anything as to why the previous contributor has not reacted.

Let's concentrate on owning and fixing the PR instead. :)

@svelterust
Copy link
Author

Ait, so I tried out these patches:

[patch.crates-io]
esp-idf-sys = { git = "https://github.com/haileys/esp-idf-sys.git", rev = "211af868958ed5f5ceb2b7945a56bb131fd6ec11" }
embuild = { git = "https://github.com/haileys/embuild.git", rev = "5292871f5b3a0a78f398f80e8c159f47afb1df87" }

Output of cargo tree: https://pastebin.com/raw/f1rpDEwp

Still get the same error, am I missing something obvious?

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: None,
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: None,
      mcu: None,
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.1.1",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: Some(
              "/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1",
          ),
          extra_components: [],
          esp_idf_components: None,
          esp_idf_component_manager: None,
      },
      esp_idf_sys_root_crate: None,
  }
  fatal: not a git repository (or any of the parent directories): .git
  Using activated esp-idf v5.1.0 environment at '/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1'
  thread 'main' panicked at /home/odd/.cargo/git/checkouts/esp-idf-sys-47955e843e87bb38/211af86/build/native/cargo_driver.rs:261:13:
  tree must always be Git variant if is_managed_espidf is true
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is it this is_managed_espidf that must be set?

@svelterust
Copy link
Author

image

Need to run this custom path instead, what's the env variable for that?

@ivmarkov
Copy link
Collaborator

IDF_PATH

@svelterust
Copy link
Author

hello-esp32c3 via nix-shell-env ❯ echo $IDF_PATH
/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1

@svelterust
Copy link
Author

It still thinks it's managed despite having this.

@ivmarkov
Copy link
Collaborator

ivmarkov commented Oct 13, 2023

Well you might have to dig deeper. As in setting export RUST_BACKTRACE=1 and then re-running the build. This would give you an idea where exactly in the esp-idf-sys Rust build code fails, and you can look what is going on there.

@svelterust
Copy link
Author

@svelterust
Copy link
Author

Hmm lets see...

  tree must always be Git variant if is_managed_espidf is true
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/97c81e1b537088f1881c8894ee8579812ed9b6d1/library/std/sr     1: core::panicking::panic_fmt
               at /rustc/97c81e1b537088f1881c8894ee8579812ed9b6d1/library/core/s     2: build_script_build::native::cargo_driver::build
               at ./build/native/cargo_driver.rs:261:13
     3: build_script_build::native::build
               at ./build/native.rs:17:9
     4: build_script_build::main
               at ./build/build.rs:52:24
     5: core::ops::function::FnOnce::call_once
               at /rustc/97c81e1b537088f1881c8894ee8579812ed9b6d1/library/core/s

@svelterust
Copy link
Author

I must be failing to patch something because the PR looks good

@svelterust
Copy link
Author

Trying this:

image

Gives:

  fatal: not a git repository (or any of the parent directories): .git
  Using activated esp-idf v5.1.0 environment at '/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1'
  fatal: not a git repository (or any of the parent directories): .git
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources
  fatal: not a git repository (or any of the parent directories): .git
  fatal: not a git repository (or any of the parent directories): .git
  Built components: riscv, esp_ringbuf, efuse, driver, esp_pm, mbedtls, esp_app_format, bootloader_support, bootloader, esptool_py, partition_table, esp_partition, app_update, esp_mm, spi_flash, pthread, esp_system, esp_rom, hal, log, heap, soc, esp_hw_support, freertos, newlib, cxx, esp_common, esp_timer, app_trace, esp_event, nvs_flash, esp_phy, vfs, lwip, esp_netif_stack, esp_netif, wpa_supplicant, esp_coex, esp_wifi, bt, unity, cmock, console, http_parser, esp-tls, esp_adc, esp_eth, esp_gdbstub, esp_hid, tcp_transport, esp_http_client, esp_http_server, esp_https_ota, esp_https_server, esp_psram, esp_lcd, protobuf-c, protocomm, esp_local_ctrl, espcoredump, wear_levelling, sdmmc, fatfs, idf_test, ieee802154, json, mqtt, openthread, spiffs, ulp, usb, wifi_provisioning, main
  thread 'main' panicked at /home/odd/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.63.0/./lib.rs:2338:31:
  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: [])"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Adding clang, libclang with LIBCLANG_PATH = "${pkgs.libclang.lib}/lib" then gives:

  Caused by:
      clang diagnosed error: /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:145:5: error: function-like macro '__GLIBC_USE' is not defined
      /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:184:5: error: function-like macro '__GLIBC_USE' is not defined

@svelterust
Copy link
Author

   Compiling esp-idf-sys v0.33.2 (https://github.com/knarkzel/esp-idf-sys.git?branch=hailey#7c0fac0e)
The following warnings were emitted during compilation:

warning: Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2]; explicitly specify an MCU to resolve this ambiguity

error: failed to run custom build command for `esp-idf-sys v0.33.2 (https://github.com/knarkzel/esp-idf-sys.git?branch=hailey#7c0fac0e)`

Caused by:
  process didn't exit successfully: `/home/odd/source/nix/hello-esp32c3/target/debug/build/esp-idf-sys-26371692b110b770/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
  cargo:warning=Configuring first supported MCU 'esp32c3' derived from the build target 'riscv32imc-esp-espidf' supporting MCUs [esp32c3, esp32c2]; explicitly specify an MCU to resolve this ambiguity
  cargo:rerun-if-changed=/home/odd/source/nix/hello-esp32c3/sdkconfig.defaults
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = Some("/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0:/nix/store/yllcj971mwa0rvgwvd876a52391m8s9y-update-autotools-gnu-config-scripts-hook:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1:/nix/store/sc6xfalvvq13vb4s9pzn6vcp59sjjb91-clang-wrapper-11.1.0:/nix/store/jcjxfkwypgx5w559vqc1z8pnkvr530g3-binutils-wrapper-2.40:/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin:/nix/store/ld03l52xq2ssn4x0g5asypsxqls40497-glibc-2.37-8:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev:/nix/store/7y67h7q26mh2zwhilcpq82553s5bda21-clang-11.1.0-lib:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08:/nix/store/swprckq7jbx336bfcjvp7h9jdhid43d7-compiler-rt-libc-11.1.0-dev:/nix/store/ncm999fc8hxgazhgr0gswy2pxd0vs9sb-compiler-rt-libc-11.1.0")
  CMAKE_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build" && CMAKE_PREFIX_PATH="/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0:/nix/store/yllcj971mwa0rvgwvd876a52391m8s9y-update-autotools-gnu-config-scripts-hook:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1:/nix/store/sc6xfalvvq13vb4s9pzn6vcp59sjjb91-clang-wrapper-11.1.0:/nix/store/jcjxfkwypgx5w559vqc1z8pnkvr530g3-binutils-wrapper-2.40:/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin:/nix/store/ld03l52xq2ssn4x0g5asypsxqls40497-glibc-2.37-8:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev:/nix/store/7y67h7q26mh2zwhilcpq82553s5bda21-clang-11.1.0-lib:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08:/nix/store/swprckq7jbx336bfcjvp7h9jdhid43d7-compiler-rt-libc-11.1.0-dev:/nix/store/ncm999fc8hxgazhgr0gswy2pxd0vs9sb-compiler-rt-libc-11.1.0" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1" IDF_TARGET="esp32c3" PATH="/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/sc6xfalvvq13vb4s9pzn6vcp59sjjb91-clang-wrapper-11.1.0/bin:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0/bin:/nix/store/jcjxfkwypgx5w559vqc1z8pnkvr530g3-binutils-wrapper-2.40/bin:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/ncm999fc8hxgazhgr0gswy2pxd0vs9sb-compiler-rt-libc-11.1.0/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/sc6xfalvvq13vb4s9pzn6vcp59sjjb91-clang-wrapper-11.1.0/bin:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0/bin:/nix/store/jcjxfkwypgx5w559vqc1z8pnkvr530g3-binutils-wrapper-2.40/bin:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/ncm999fc8hxgazhgr0gswy2pxd0vs9sb-compiler-rt-libc-11.1.0/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev/bin:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/run/wrappers/bin:/home/odd/.nix-profile/bin:/home/odd/.local/state/nix/profile/bin:/etc/profiles/per-user/odd/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/5nbkkc6qng2lz3jgskxpigqirz0yzy0r-pciutils-3.10.0/bin" PROJECT_DIR="/home/odd/source/nix/hello-esp32c3" SDKCONFIG_DEFAULTS="/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/gen-sdkconfig.defaults;/home/odd/source/nix/hello-esp32c3/sdkconfig.defaults" "cmake" "/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools/cmake/toolchain-esp32c3.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin/python" "-DCMAKE_INSTALL_PREFIX=/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out" "-DCMAKE_C_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections -march=rv32imc_zicsr_zifencei -mabi=ilp32 -mcmodel=medany" "-DCMAKE_CXX_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections -march=rv32imc_zicsr_zifencei -mabi=ilp32 -mcmodel=medany" "-DCMAKE_ASM_FLAGS=  -ffunction-sections -fdata-sections -march=rv32imc_zicsr_zifencei -mabi=ilp32 -mcmodel=medany"
  -- Building ESP-IDF components for target esp32c3
  -- Checking Python dependencies...
  Python requirements are satisfied.
  Requirement files:
   - /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools/requirements/requirements.core.txt
  Python being checked: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/python-env/bin/python
  -- Project sdkconfig file /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/sdkconfig
  Loading defaults file /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/gen-sdkconfig.defaults...
  Loading defaults file /home/odd/source/nix/hello-esp32c3/sdkconfig.defaults...
  -- App "libespidf" version: d560b27-dirty
  -- Adding linker script /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/esp-idf/esp_system/ld/memory.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_system/ld/esp32c3/sections.ld.in
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.api.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.libgcc.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.newlib.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.version.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/soc/esp32c3/ld/esp32c3.peripherals.ld
  -- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash openthread partition_table protobuf-c protocomm pthread riscv sdmmc soc spi_flash spiffs tcp_transport ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant
  -- Component paths: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/app_trace /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/app_update /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader_support /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bt /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/cmock /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/console /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/cxx /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/efuse /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp-tls /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_adc /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_app_format /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_coex /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_common /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_eth /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_event /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_gdbstub /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_hid /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_http_client /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_http_server /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_https_ota /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_https_server /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_hw_support /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_lcd /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_local_ctrl /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_mm /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_netif /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_netif_stack /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_partition /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_phy /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_pm /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_psram /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_ringbuf /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_system /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_timer /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_wifi /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/espcoredump /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esptool_py /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/fatfs /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/freertos /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/hal /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/heap /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/http_parser /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/idf_test /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/ieee802154 /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/json /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/log /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/lwip /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/main /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/mbedtls /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/mqtt /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/newlib /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/nvs_flash /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/openthread /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/partition_table /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/protobuf-c /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/protocomm /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/pthread /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/riscv /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/sdmmc /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/soc /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/spi_flash /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/spiffs /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/tcp_transport /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/ulp /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/unity /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/usb /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/vfs /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/wear_levelling /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/wifi_provisioning /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/wpa_supplicant
  -- Configuring done (1.1s)
  -- Generating done (0.1s)
  -- Build files have been written to: /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build
  running: cd "/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build" && EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1" IDF_TARGET="esp32c3" PATH="/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/sc6xfalvvq13vb4s9pzn6vcp59sjjb91-clang-wrapper-11.1.0/bin:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0/bin:/nix/store/jcjxfkwypgx5w559vqc1z8pnkvr530g3-binutils-wrapper-2.40/bin:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/ncm999fc8hxgazhgr0gswy2pxd0vs9sb-compiler-rt-libc-11.1.0/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/sc6xfalvvq13vb4s9pzn6vcp59sjjb91-clang-wrapper-11.1.0/bin:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0/bin:/nix/store/jcjxfkwypgx5w559vqc1z8pnkvr530g3-binutils-wrapper-2.40/bin:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/ncm999fc8hxgazhgr0gswy2pxd0vs9sb-compiler-rt-libc-11.1.0/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/c46mqx6v66daf2hvm22bczc6vnl02wq8-clang-11.1.0-dev/bin:/nix/store/71xzjk8qi1cjkwr8lv9rvk7s0zjiipzm-clang-11.1.0/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/nix/store/ay0p9mbw1w3zkvwzx3c94xq7x8jrn9wq-patchelf-0.15.0/bin:/nix/store/18bs92p6yf6w2wwxhbplgx02y6anq092-gcc-wrapper-12.3.0/bin:/nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/bin:/nix/store/f6in5kb2y5v06zinz1a6xy6cyg67q026-glibc-2.37-8-bin/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin:/nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin:/nix/store/7smkn8cidx17la9ny5vfvghrwfxwbrny-git-2.42.0/bin:/nix/store/g7hr76vc0bi7lb0qf9izvrblf0vh94m2-wget-1.21.4/bin:/nix/store/5rdxplg3cczslq4banvk3449ry5k9hx7-gnumake-4.4.1/bin:/nix/store/vlvzar852vc5i73hsr2gljh75lyjrpcp-flex-2.6.4/bin:/nix/store/0v0b4pcb7fcjz693kqqhaci14l4zhrpr-gnum4-1.4.19/bin:/nix/store/9jxcg001xr5h60r34zwdwmwkz7av1grb-bison-3.8.2/bin:/nix/store/s15h6hdgzf60vqh2rp77vnbg58p1lv8i-gperf-3.1/bin:/nix/store/5daca24rn22c65ff25lc6z0g0imfphvr-pkg-config-wrapper-0.29.2/bin:/nix/store/yi235g10sp8jx939zpfli0s74154ph3v-cmake-3.26.4/bin:/nix/store/ilgv1hna6y3cdsbi3vq87gvp7jpy6sqp-ninja-1.11.1/bin:/nix/store/w0mmh06q0daxh4h544y1vdwqxbbgfmc1-ncurses-abi5-compat-6.4-dev/bin:/nix/store/19x177m8wcf7c3q3mbc6vj08pbpy6lpj-ncurses-abi5-compat-6.4/bin:/nix/store/7fnpn3lcf7wrwck9hrdkvr2913zykhij-dfu-util-0.11/bin:/nix/store/ldbqi0jlrk23p4b5a3cl6ma34r7gw33v-riscv32-esp-elf-esp-idf-v5.1/bin:/nix/store/bmmgfib1s1yl2fgkcvxwqhwzd4w6bwik-openocd-esp32-esp-idf-v5.1/bin:/nix/store/9mnn1z71jzb39c3n8gk7fcq7lxfvm1da-riscv32-esp-elf-gdb-esp-idf-v5.1/bin:/nix/store/63a68c8lz0ybq7mzyphx74g91ihqn90h-rust-default-1.75.0-nightly-2023-10-08/bin:/nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3/bin:/nix/store/b6izr8wh0p7dyvh3cyg14wq2rn8d31ik-findutils-4.9.0/bin:/nix/store/q56n7lhjw724i7b33qaqra61p7m7c0cd-diffutils-3.10/bin:/nix/store/x23by79p38ll0js1alifmf3y56vqfs49-gnused-4.9/bin:/nix/store/xafzciap7acqhfx84dvqkp18bg4lrai3-gnugrep-3.11/bin:/nix/store/8kkn44iwdbgqkrj661nr4cjcpmrqqmx8-gawk-5.2.2/bin:/nix/store/89s3w7b4g78989kpzc7sy4phv0nqfira-gnutar-1.35/bin:/nix/store/2a9na7bp4r3290yqqzg503325dwglxyq-gzip-1.13/bin:/nix/store/gxknjk51s7q86llkbzpaqv43kflj9d8j-bzip2-1.0.8-bin/bin:/nix/store/2jp6cv2q4cgh91f5lp57p945rq98ldhr-gnumake-4.4.1/bin:/nix/store/xdqlrixlspkks50m9b0mpvag65m3pf2w-bash-5.2-p15/bin:/nix/store/c15ama0p8jr4mn0943yjk4rpa2hxk7ml-patch-2.7.6/bin:/nix/store/sb3sxnp4g40gfw758a0m4sjm7slvmax9-xz-5.4.4-bin/bin:/nix/store/xfjqspcc9442hi0lm0szv3sw75zswvml-file-5.45/bin:/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools:/run/wrappers/bin:/home/odd/.nix-profile/bin:/home/odd/.local/state/nix/profile/bin:/etc/profiles/per-user/odd/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/nix/store/mc6q3cdz5s0p1aj4y586bglsfsnsf2k8-binutils-wrapper-2.40/bin:/nix/store/5nbkkc6qng2lz3jgskxpigqirz0yzy0r-pciutils-3.10.0/bin" PROJECT_DIR="/home/odd/source/nix/hello-esp32c3" SDKCONFIG_DEFAULTS="/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/gen-sdkconfig.defaults;/home/odd/source/nix/hello-esp32c3/sdkconfig.defaults" "cmake" "--build" "." "--config" "MinSizeRel" "--parallel" "32"
  [1/7] Performing build step for 'bootloader'
  [0/1] Re-running CMake...
  fatal: not a git repository (or any of the parent directories): .git
  -- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
  -- Building ESP-IDF components for target esp32c3
  -- Project sdkconfig file /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/sdkconfig
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/soc/esp32c3/ld/esp32c3.peripherals.ld
  -- App "bootloader" version: 1
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.api.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.libgcc.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom/esp32c3/ld/esp32c3.rom.newlib.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld
  -- Adding linker script /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader/subproject/main/ld/esp32c3/bootloader.rom.ld
  -- Components: bootloader bootloader_support efuse esp_app_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table riscv soc spi_flash
  -- Component paths: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader_support /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/efuse /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_app_format /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_common /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_hw_support /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_rom /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_system /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esptool_py /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/freertos /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/hal /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/log /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader/subproject/main /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/bootloader/subproject/components/micro-ecc /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/newlib /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/partition_table /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/riscv /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/soc /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/spi_flash
  -- Configuring done (0.5s)
  -- Generating done (0.0s)
  -- Build files have been written to: /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/bootloader
  [1/1] cd /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/bootloader/esp-idf/esptool_py && /nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin/python /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/bootloader/bootloader.bin
  Bootloader binary size 0x5040 bytes. 0x2fc0 bytes (37%) free.
  [2/7] No install step for 'bootloader'
  [3/7] Completed 'bootloader'
  [4/7] Generating ld/sections.ld
  [5/7] Linking CXX executable libespidf.elf
  [6/7] Generating binary image from built executable
  esptool.py v4.6.2
  Creating esp32c3 image...
  Merged 1 ELF section
  Successfully created esp32c3 image.
  Generated /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/libespidf.bin
  [7/7] cd /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/esp-idf/esptool_py && /nix/store/x3yahprgjd3arxxgbq4d3bxgl3hbghcg-python3-3.10.12-env/bin/python /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/partition_table/partition-table.bin /home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/build/libespidf.bin
  libespidf.bin binary size 0x25610 bytes. Smallest app partition is 0x100000 bytes. 0xda9f0 bytes (85%) free.
  cargo:root=/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out
  cargo:rerun-if-changed=/home/odd/.cargo/git/checkouts/esp-idf-sys-94ae8668c507e489/7c0fac0/src/include/esp-idf/bindings.h
  cargo:rustc-env=EMBUILD_GENERATED_BINDINGS_FILE=/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/bindings.rs

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: None,
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: None,
      mcu: None,
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.1.1",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: Some(
              "/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1",
          ),
          extra_components: [],
          esp_idf_components: None,
          esp_idf_component_manager: None,
      },
      esp_idf_sys_root_crate: None,
  }
  fatal: not a git repository (or any of the parent directories): .git
  Using activated esp-idf v5.1.0 environment at '/nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1'
  fatal: not a git repository (or any of the parent directories): .git
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources
  fatal: not a git repository (or any of the parent directories): .git
  fatal: not a git repository (or any of the parent directories): .git
  Built components: riscv, esp_ringbuf, efuse, driver, esp_pm, mbedtls, esp_app_format, bootloader_support, bootloader, esptool_py, partition_table, esp_partition, app_update, esp_mm, spi_flash, pthread, esp_system, esp_rom, hal, log, heap, soc, esp_hw_support, freertos, newlib, cxx, esp_common, esp_timer, app_trace, esp_event, nvs_flash, esp_phy, vfs, lwip, esp_netif_stack, esp_netif, wpa_supplicant, esp_coex, esp_wifi, bt, unity, cmock, console, http_parser, esp-tls, esp_adc, esp_eth, esp_gdbstub, esp_hid, tcp_transport, esp_http_client, esp_http_server, esp_https_ota, esp_https_server, esp_psram, esp_lcd, protobuf-c, protocomm, esp_local_ctrl, espcoredump, wear_levelling, sdmmc, fatfs, idf_test, ieee802154, json, mqtt, openthread, spiffs, ulp, usb, wifi_provisioning, main
  /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:145:5: error: function-like macro '__GLIBC_USE' is not defined
  /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:184:5: error: function-like macro '__GLIBC_USE' is not defined
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/spi_flash/include/esp_spi_flash.h:6:2: warning: esp_spi_flash.h is deprecated, please use spi_flash_mmap.h instead [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_adc/deprecated/include/esp_adc_cal.h:17:2: warning: "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h" [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/adc.h:19:2: warning: "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/i2s.h:27:2: warning: "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/periph_ctrl.h:7:2: warning: driver/periph_ctrl.h header is no longer used, and will be removed in future versions. [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/rmt.h:18:2: warning: "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h" [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/rtc_cntl.h:7:2: warning: driver/rtc_cntl.h header is no longer used, and will be removed in future versions. [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/sigmadelta.h:15:2: warning: "The legacy sigma-delta driver is deprecated, please use driver/sdm.h" [-W#warnings]
  /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/timer.h:16:2: warning: "legacy timer group driver is deprecated, please migrate to driver/gptimer.h" [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/spi_flash/include/esp_spi_flash.h:6:2: warning: esp_spi_flash.h is deprecated, please use spi_flash_mmap.h instead [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/esp_adc/deprecated/include/esp_adc_cal.h:17:2: warning: "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h" [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/adc.h:19:2: warning: "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/i2s.h:27:2: warning: "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/periph_ctrl.h:7:2: warning: driver/periph_ctrl.h header is no longer used, and will be removed in future versions. [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/rmt.h:18:2: warning: "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h" [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/rtc_cntl.h:7:2: warning: driver/rtc_cntl.h header is no longer used, and will be removed in future versions. [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/sigmadelta.h:15:2: warning: "The legacy sigma-delta driver is deprecated, please use driver/sdm.h" [-W#warnings]
  clang diag: /nix/store/bmckqqb26qy16agaql75m5w1bwi4kp51-esp-idf-v5.1/components/driver/deprecated/driver/timer.h:16:2: warning: "legacy timer group driver is deprecated, please migrate to driver/gptimer.h" [-W#warnings]
  Error: failed to generate bindings in file '/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-cc9e614875941005/out/bindings.rs'

  Caused by:
      clang diagnosed error: /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:145:5: error: function-like macro '__GLIBC_USE' is not defined
      /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:184:5: error: function-like macro '__GLIBC_USE' is not defined

@svelterust
Copy link
Author

It seems the pull request fixed one issue, but there's several other places that must be fixed

@ivmarkov
Copy link
Collaborator

Maybe the relevant question here is... is ESP IDF itself supporting a build where "it" is not a GIT repository? Because if it doesn't, we should forget about this change altogether.

@ivmarkov
Copy link
Collaborator

By the way... what is it with *nix that I cannot automatically clone a git repo and then just use it?

@svelterust
Copy link
Author

It's possible, just not recommended. Everything in /nix/store is immutable. I tried quickly, but ran into some issue.

@svelterust
Copy link
Author

I'll take another look later

@svelterust
Copy link
Author

Got the same issue (with managed disabled) when using shell that lets esp-idf-sys build from scratch:

  /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:145:5: error: function-like macro '__GLIBC_USE' is not defined
  /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:184:5: error: function-like macro '__GLIBC_USE' is not defined
  /home/odd/source/nix/hello-esp32c3/.embuild/espressif/esp-idf/v4.4/components/freertos/port/riscv/include/freertos/portmacro.h:439:20: warning: section does not match previous declaration [-Wsection]
  /home/odd/source/nix/hello-esp32c3/.embuild/espressif/esp-idf/v4.4/components/freertos/port/riscv/include/freertos/portmacro.h:271:20: note: previous attribute is here
  /home/odd/source/nix/hello-esp32c3/.embuild/espressif/esp-idf/v4.4/components/esp_hw_support/include/soc/esp_spiram.h:1:2: warning: esp_spiram.h has been replaced by esp32/spiram.h, please include esp32/spiram.h instead [-W#warnings]
  clang diag: /home/odd/source/nix/hello-esp32c3/.embuild/espressif/esp-idf/v4.4/components/freertos/port/riscv/include/freertos/portmacro.h:439:20: warning: section does not match previous declaration [-Wsection]
  clang diag: /home/odd/source/nix/hello-esp32c3/.embuild/espressif/esp-idf/v4.4/components/esp_hw_support/include/soc/esp_spiram.h:1:2: warning: esp_spiram.h has been replaced by esp32/spiram.h, please include esp32/spiram.h instead [-W#warnings]
  Error: failed to generate bindings in file '/home/odd/source/nix/hello-esp32c3/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-b669bb536e7636c2/out/bindings.rs'

  Caused by:
      clang diagnosed error: /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:145:5: error: function-like macro '__GLIBC_USE' is not defined
      /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/limits.h:184:5: error: function-like macro '__GLIBC_USE' is not defined

@svelterust
Copy link
Author

This is the shell:

{
  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.llvmPackages.libclang.lib}/lib
      '';
    };
  };
}

@svelterust
Copy link
Author

Might've forgotten to remove the patch, trying again.. 😆

@ivmarkov
Copy link
Collaborator

Maybe the relevant question here is... is ESP IDF itself supporting a build where "it" is not a GIT repository? Because if it doesn't, we should forget about this change altogether.

I think you should try to confirm/deny this first.

@svelterust
Copy link
Author

Tried it where I let embuild download esp-idf, but I got to the same errors: esp-rs/esp-idf-sys#184 (comment)

@ivmarkov
Copy link
Collaborator

You need to git clone esp idf ONLY and then try to build something with it. Like a C program. If this does not work out of the box on *nix, whatever else we try to do in the Rust crates won't work either, as they automate exactly that.

@denbeigh2000
Copy link
Contributor

Hi @ivmarkov,

I'm interested in seeing this issue resolved, would you be open to reviewing another iteration of #80/#82 that's been rebased and formatted?

@ivmarkov
Copy link
Collaborator

Hi @ivmarkov,

I'm interested in seeing this issue resolved, would you be open to reviewing another iteration of #80/#82 that's been rebased and formatted?

Sure, but it is not just about rebasing and formatting. Someone has to confirm that it actually does work.

@denbeigh2000
Copy link
Contributor

Hi @ivmarkov,
I'm interested in seeing this issue resolved, would you be open to reviewing another iteration of #80/#82 that's been rebased and formatted?

Sure, but it is not just about rebasing and formatting. Someone has to confirm that it actually does work.

Okay, I'll attempt a validation build of esp-idf-hal with my fork this week.

@denbeigh2000
Copy link
Contributor

@ivmarkov I've confirmed some success here.

I have cloned esp-idf-sys, and updated it to use my own embuild fork. There are definitely some cleanups that could be done, but hopefully it'll serve as a proof-of-concept.

I tried to build an example in that repo: The crate itself compiles and locates the IDF_* paths from my environment - however, cmake appears to perform the same rev-parse --show-toplevel check when invoked, which then fails.

Collapsed cargo output
$ MCU=esp32 cargo espflash flash --target xtensa-esp32-espidf --example std_basics

...

   Compiling cargo-platform v0.1.8
   Compiling envy v0.4.2
   Compiling cargo_metadata v0.18.1
   Compiling embuild v0.32.0 (https://github.com/denbeigh2000/embuild?rev=b8b924b7a5bdbe947d5fff252cd24f61bda00074#b8b924b7)
   Compiling proc_macro v0.0.0 (/nix/store/pbwyjfkxd4vw7wgmmzrlsnz1qzcijrds-rust-esp-v1.82.0.3/lib/rustlib/src/rust/library/proc_macro)
   Compiling const_format v0.2.33
   Compiling esp-idf-sys v0.35.0 (/Users/denbeigh/dev/esp-idf-sys)
The following warnings were emitted during compilation:

warning: [email protected]: (esp-idf-sys) Removed env vars that might affect the ESP IDF C build: `CC=clang;CXX=clang++`

error: failed to run custom build command for `esp-idf-sys v0.35.0 (/Users/denbeigh/dev/esp-idf-sys)`

Caused by:
  process didn't exit successfully: `/Users/denbeigh/dev/esp-idf-sys/target/debug/build/esp-idf-sys-b7d144c692d6a5ef/build-script-build` (exit status: 101)
  --- stdout
  cargo:warning=(esp-idf-sys) Removed env vars that might affect the ESP IDF C build: `CC=clang;CXX=clang++`
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
  cargo:rerun-if-changed=/Users/denbeigh/dev/esp-idf-sys/.github/configs/sdkconfig.defaults
  CMAKE_PREFIX_PATH_xtensa-esp32-espidf = None
  CMAKE_PREFIX_PATH_xtensa_esp32_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_xtensa-esp32-espidf = None
  CMAKE_xtensa_esp32_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/Users/denbeigh/dev/esp-idf-sys/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-4a843b26a86fe601/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/nix/store/yfi52smvpn84vz4wxa0jh5na9yihd9hb-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42" IDF_TARGET="esp32" PATH="/nix/store/pbwyjfkxd4vw7wgmmzrlsnz1qzcijrds-rust-esp-v1.82.0.3/bin:/nix/store/63f4im3v1vwr9hv3akppn1i5l8p0mpcc-python3-3.12.7-env/bin:/nix/store/w5rggkxjd7z2cjk4fia9za7gb485pydw-git-2.47.0/bin:/nix/store/3hfdiifrid2mf5v5w8va194bhgj08i57-wget-1.25.0/bin:/nix/store/0gqbh56qwj0cxmvl7dajic9mkbc26ilc-gnumake-4.4.1/bin:/nix/store/p7wqpzz9dprq33fbs70dlj1haac26871-flex-2.6.4/bin:/nix/store/2sk7w1y6pmz8b51290fj7jvglqb55skx-gnum4-1.4.19/bin:/nix/store/kykd5x1fc167yhf87pnsqyd17j6xaksk-bison-3.8.2/bin:/nix/store/154nqi968xpkrd6xk8vycyv9pgkpgawp-gperf-3.1/bin:/nix/store/c6v2ngygy55zamyz17z94brbz2vrsi1z-pkg-config-wrapper-0.29.2/bin:/nix/store/aw70f6alsbf7cgn5qwqbpgd1w208i3v9-cmake-3.30.5/bin:/nix/store/hj6jb9m7rp59bgj7r2jpbqw9yip8fapr-ninja-1.12.1/bin:/nix/store/33lq0qgjciw7h4x9zg5ws3mpk6d89wfc-ncurses-abi5-compat-6.4.20221231-dev/bin:/nix/store/h6bs7szrrdngpw5hy7w0wlvmdvi6yz7q-ncurses-abi5-compat-6.4.20221231/bin:/nix/store/m5fni2vq69nwb3w5ks1mzkw0ajcmsilj-dfu-util-0.11/bin:/nix/store/0ixmcknpjhjxbnys9bkv68rr44ljvf11-esp-clang-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin:/nix/store/jxi8kf9isy6jhzx2kq81csccifpydpwq-xtensa-esp-elf-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin:/nix/store/5qrqmkwcx48wg0bfcy77xlp7dzbmdk44-esp32ulp-elf-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin:/nix/store/0ycmpdkasf51xmjlp4l78grqx5dip9h6-openocd-esp32-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin:/nix/store/4zz75akpch21wypfv092gh6j3iz69bm6-xtensa-esp-elf-gdb-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin:/nix/store/n1zwfydcicy7az4xhmfzjsrqcdc6qmrx-openssl-3.3.2-bin/bin:/nix/store/v39c0h6xv6hvki2k1bsyp5n090q8y2bp-clang-wrapper-16.0.6/bin:/nix/store/44hqr4414m3jldixkm4cq47q5pnpy83d-clang-16.0.6/bin:/nix/store/5g6np23z9q7vwwp1s5pxkgn8f8wrmihh-coreutils-9.5/bin:/nix/store/jqy6x4li0s729q6q97qmzrqwjfi567bv-cctools-binutils-darwin-wrapper-1010.6/bin:/nix/store/c02f0lj5xqjaw1c6hg9a9sv1b024mi8q-cctools-binutils-darwin-1010.6/bin:/nix/store/3a99nvsn1jh7h3vklnd8py5jplls9q41-xcbuild-0.1.1-unstable-2019-11-20-xcrun/bin:/nix/store/iwbpxcjz1s816d80sqg0mxg5p8m0dqak-libiconv-107/bin:/nix/store/5g6np23z9q7vwwp1s5pxkgn8f8wrmihh-coreutils-9.5/bin:/nix/store/zxz2b4dlg9zz8dcrwa2my1bpyxpfcchj-findutils-4.10.0/bin:/nix/store/xnm74pr7sl0jvn2q8fcr4jy3vrdgyqrn-diffutils-3.10/bin:/nix/store/9m372k9wy0f9aj54zhvsr65w2p9ndwnj-gnused-4.9/bin:/nix/store/ay0r3wrwbv5rq3mg3vhla045yjr49gka-gnugrep-3.11/bin:/nix/store/5q48fvg6grf5zsk106cm0k0hbfc1dfp2-gawk-5.3.1/bin:/nix/store/41dh2jr0d4ixcbjvkw72hqvrj0kv3mfh-gnutar-1.35/bin:/nix/store/jnnmwj5nsh4y8avg72q23nshq5z74pck-gzip-1.13/bin:/nix/store/5vs5hn675fwynba3didxxyvk8v0ji2bl-bzip2-1.0.8-bin/bin:/nix/store/0gqbh56qwj0cxmvl7dajic9mkbc26ilc-gnumake-4.4.1/bin:/nix/store/sk8z3kdy6iaky6sg972k6fkh3iw2rn3d-bash-5.2p37/bin:/nix/store/i8yd551zdvdx0gg9mxg5ky6znqaflnkd-patch-2.7.6/bin:/nix/store/kv4wl884saw5jjch5kg4zvcrpff6dlh9-xz-5.6.3-bin/bin:/nix/store/92imkakl854dfvqjl1z8jmsxjrg1mh6f-file-5.45/bin:/nix/store/yfi52smvpn84vz4wxa0jh5na9yihd9hb-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/tools:/nix/store/yfi52smvpn84vz4wxa0jh5na9yihd9hb-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/components/espcoredump:/nix/store/yfi52smvpn84vz4wxa0jh5na9yihd9hb-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/components/partition_table:/nix/store/yfi52smvpn84vz4wxa0jh5na9yihd9hb-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/components/app_update:/nix/store/c1ib07kj7baid3s3wf5m98hcpbvgs8mk-clang-wrapper-16.0.6/bin:/Users/denbeigh/bin:/Users/denbeigh/.local/bin:/Users/denbeigh/.nix-profile/bin:/etc/profiles/per-user/denbeigh/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/denbeigh/dev/go/bin" PROJECT_DIR="/Users/denbeigh/dev/esp-idf-sys" SDKCONFIG_DEFAULTS="/Users/denbeigh/dev/esp-idf-sys/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-4a843b26a86fe601/out/gen-sdkconfig.defaults;/Users/denbeigh/dev/esp-idf-sys/.github/configs/sdkconfig.defaults" "cmake" "/Users/denbeigh/dev/esp-idf-sys/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-4a843b26a86fe601/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/nix/store/yfi52smvpn84vz4wxa0jh5na9yihd9hb-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/tools/cmake/toolchain-esp32.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/nix/store/63f4im3v1vwr9hv3akppn1i5l8p0mpcc-python3-3.12.7-env/bin/python" "-DCMAKE_INSTALL_PREFIX=/Users/denbeigh/dev/esp-idf-sys/target/xtensa-esp32-espidf/debug/build/esp-idf-sys-4a843b26a86fe601/out" "-DCMAKE_C_FLAGS= -mlongcalls -Wno-frame-address -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -ffunction-sections -fdata-sections --target=xtensa-none-elf" "-DCMAKE_CXX_FLAGS= -mlongcalls -Wno-frame-address -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -ffunction-sections -fdata-sections --target=xtensa-none-elf" "-DCMAKE_ASM_FLAGS= -mlongcalls -ffunction-sections -fdata-sections --target=xtensa-none-elf"
  -- Found Git: /nix/store/w5rggkxjd7z2cjk4fia9za7gb485pydw-git-2.47.0/bin/git (found version "2.47.0")
  -- git rev-parse returned 'fatal: not a git repository (or any parent up to mount point /)
  Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).'
  -- The C compiler identification is GNU 14.2.0
  -- The CXX compiler identification is GNU 14.2.0
  -- The ASM compiler identification is GNU
  -- Found assembler: /nix/store/jxi8kf9isy6jhzx2kq81csccifpydpwq-xtensa-esp-elf-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin/xtensa-esp32-elf-gcc
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /nix/store/jxi8kf9isy6jhzx2kq81csccifpydpwq-xtensa-esp-elf-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin/xtensa-esp32-elf-gcc
  -- Check for working C compiler: /nix/store/jxi8kf9isy6jhzx2kq81csccifpydpwq-xtensa-esp-elf-esp-idf-f420609c332fbd2d2f7f188c6579d046c9560e42/bin/xtensa-esp32-elf-gcc - broken
  -- Configuring incomplete, errors occurred!

What validation would you like to see? Is there a more isolated test I can do that would validate this work before similar changes are made in cmake tooling?

@ivmarkov
Copy link
Collaborator

@ivmarkov I've confirmed some success here.

I have cloned esp-idf-sys, and updated it to use my own embuild fork. There are definitely some cleanups that could be done, but hopefully it'll serve as a proof-of-concept.

I tried to build an example in that repo: The crate itself compiles and locates the IDF_* paths from my environment - however, cmake appears to perform the same rev-parse --show-toplevel check when invoked, which then fails.

Collapsed cargo output
What validation would you like to see? Is there a more isolated test I can do that would validate this work before similar changes are made in cmake tooling?

Before merging this, I would like to see a successful build, even if that means forking the cmake-rs repo and doing the necessary changes there. :)

In fact, having a very clear picture what changes (if any? are we 100% sure we need to make changes to cmake-rs itself, and we cannot just drive it with configuration so that it does not do the GIT check?) is very important, because upstreaming changes to cmake-rs is a very long process.

We just waited ~ 1 month for a 3-lines' change to make it in there.

@denbeigh2000
Copy link
Contributor

denbeigh2000 commented Nov 26, 2024

@ivmarkov I've confirmed some success here.
I have cloned esp-idf-sys, and updated it to use my own embuild fork. There are definitely some cleanups that could be done, but hopefully it'll serve as a proof-of-concept.
I tried to build an example in that repo: The crate itself compiles and locates the IDF_* paths from my environment - however, cmake appears to perform the same rev-parse --show-toplevel check when invoked, which then fails.
Collapsed cargo output
What validation would you like to see? Is there a more isolated test I can do that would validate this work before similar changes are made in cmake tooling?

Before merging this, I would like to see a successful build, even if that means forking the cmake-rs repo and doing the necessary changes there. :)

In fact, having a very clear picture what changes (if any? are we 100% sure we need to make changes to cmake-rs itself, and we cannot just drive it with configuration so that it does not do the GIT check?) is very important, because upstreaming changes to cmake-rs is a very long process.

We just waited ~ 1 month for a 3-lines' change to make it in there.

Okay, seems reasonable - I'll dig in more this week and see what I come up with.

Hoping my changes can be kept to esp-idf 🤞

@denbeigh2000
Copy link
Contributor

denbeigh2000 commented Nov 29, 2024

@ivmarkov: Okay! I've confirmed that with these changes, I can successfully build the std_basics example from esp-idf-sys in both scenarios:

  • IDF_PATH etc use a path that is not a valid git repository
  • IDF_PATH etc are unset

I used a fresh Ubuntu container that followed the installation instructions from the Rust on ESP book. I've put my build configuration/output in the collapsed blocks below:

`IDF_PATH` -> Invalid git repository
validation@d11c501155b9:~/esp-idf-sys$ cargo clean
     Removed 2989 files, 1.2GiB total
validation@d11c501155b9:~/esp-idf-sys$ env | grep IDF
IDF_PYTHON_ENV_PATH=/home/validation/.espressif/python_env/idf5.1_py3.12_env
IDF_PATH=/home/validation/esp/esp-idf
ESP_IDF_VERSION=5.1
IDF_DEACTIVATE_FILE_PATH=/tmp/tmpfzxdlsruidf_108858
IDF_TOOLS_EXPORT_CMD=/home/validation/esp/esp-idf/export.sh
IDF_TOOLS_INSTALL_CMD=/home/validation/esp/esp-idf/install.sh
validation@d11c501155b9:~/esp-idf-sys$ git log --pretty=oneline -1
b9df9f16d6dcc1efd086b5fb84cf672a77f12300 (HEAD -> denbeigh/forked-embuild, origin/denbeigh/forked-embuild) validation: use forked embuild
validation@d11c501155b9:~/esp-idf-sys$ pushd $IDF_PATH; git status; popd
~/esp/esp-idf ~/esp-idf-sys
fatal: not a git repository (or any of the parent directories): .git
~/esp-idf-sys
validation@d11c501155b9:~/esp-idf-sys$ MCU=esp32 cargo build --target xtensa-esp32-espidf --example std_basics
   Compiling proc-macro2 v1.0.92
   Compiling compiler_builtins v0.1.123
   Compiling unicode-ident v1.0.14
   Compiling core v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core)
   Compiling memchr v2.7.4
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.215
   Compiling libc v0.2.166
   Compiling bitflags v2.6.0
   Compiling libc v0.2.158
   Compiling regex-syntax v0.8.5
   Compiling crossbeam-utils v0.8.20
   Compiling glob v0.3.1
   Compiling rustix v0.38.41
   Compiling cfg_aliases v0.2.1
   Compiling memchr v2.5.0
   Compiling rustversion v1.0.18
   Compiling nix v0.29.0
   Compiling prettyplease v0.2.25
   Compiling syn v1.0.109
   Compiling log v0.4.22
   Compiling linux-raw-sys v0.4.14
   Compiling serde_json v1.0.133
   Compiling minimal-lexical v0.2.1
   Compiling either v1.13.0
   Compiling same-file v1.0.6
   Compiling thiserror v1.0.69
   Compiling shlex v1.3.0
   Compiling walkdir v2.5.0
   Compiling libloading v0.8.5
   Compiling aho-corasick v1.1.3
   Compiling bstr v1.11.0
   Compiling nom v7.1.3
   Compiling clang-sys v1.8.1
   Compiling cvt v0.1.2
   Compiling semver v1.0.23
   Compiling quote v1.0.37
   Compiling crossbeam-epoch v0.9.18
   Compiling ryu v1.0.18
   Compiling syn v2.0.89
   Compiling crossbeam-deque v0.8.5
   Compiling once_cell v1.20.2
   Compiling heck v0.4.1
   Compiling home v0.5.9
   Compiling anyhow v1.0.93
   Compiling camino v1.1.9
   Compiling bindgen v0.69.5
   Compiling itoa v1.0.14
   Compiling autocfg v1.4.0
   Compiling std v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std)
   Compiling cc v1.2.1
   Compiling itertools v0.12.1
   Compiling bitflags v1.3.2
   Compiling normpath v1.3.0
   Compiling rustc-hash v1.1.0
   Compiling fastrand v2.2.0
   Compiling lazycell v1.3.0
   Compiling lazy_static v1.5.0
   Compiling unicode-xid v0.2.6
   Compiling iana-time-zone v0.1.61
   Compiling const_format_proc_macros v0.2.33
   Compiling num-traits v0.2.19
   Compiling cmake v0.1.52
   Compiling regex-automata v0.4.9
   Compiling filetime v0.2.25
   Compiling which v4.4.2
   Compiling cexpr v0.6.0
   Compiling tempfile v3.14.0
   Compiling chrono v0.4.38
   Compiling fs_at v0.2.1
   Compiling remove_dir_all v0.8.4
   Compiling strum_macros v0.24.3
   Compiling globset v0.4.15
   Compiling regex v1.11.1
   Compiling ignore v0.4.23
   Compiling strum v0.24.1
   Compiling globwalk v0.8.1
   Compiling serde_derive v1.0.215
   Compiling thiserror-impl v1.0.69
   Compiling build-time v0.1.3
   Compiling rustc-std-workspace-core v1.99.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/alloc)
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.24
   Compiling unwind v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/unwind)
   Compiling cargo-platform v0.1.9
   Compiling envy v0.4.2
   Compiling cargo_metadata v0.18.1
   Compiling embuild v0.32.0 (https://github.com/denbeigh2000/embuild?rev=b8b924b7a5bdbe947d5fff252cd24f61bda00074#b8b924b7)
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_abort v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_unwind)
   Compiling gimli v0.29.0
   Compiling hashbrown v0.14.5
   Compiling object v0.36.2
   Compiling std_detect v0.1.5 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling miniz_oxide v0.7.4
   Compiling addr2line v0.22.0
   Compiling esp-idf-sys v0.35.0 (/home/validation/esp-idf-sys)
   Compiling proc_macro v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/proc_macro)
   Compiling const_format v0.2.33
warning: unexpected `cfg` condition name: `esp_idf_version`
   --> examples/std_basics.rs:116:11
    |
116 | #[cfg(not(esp_idf_version = "4.3"))]
    |           ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(esp_idf_version, values("4.3"))'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(esp_idf_version, values(\"4.3\"))");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `esp_idf_version`
  --> examples/std_basics.rs:31:15
   |
31 |     #[cfg(not(esp_idf_version = "4.3"))]
   |               ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(esp_idf_version, values("4.3"))'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(esp_idf_version, values(\"4.3\"))");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: `esp-idf-sys` (example "std_basics") generated 2 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 58.46s
`IDF_PATH` -> unset
validation@d11c501155b9:~/esp-idf-sys$ cargo clean
     Removed 2989 files, 1.2GiB total
validation@d11c501155b9:~/esp-idf-sys$ env | grep IDF
validation@d11c501155b9:~/esp-idf-sys$ MCU=esp32 cargo build --target xtensa-esp32-espidf --example std_basics
   Compiling proc-macro2 v1.0.92
   Compiling compiler_builtins v0.1.123
   Compiling unicode-ident v1.0.14
   Compiling core v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core)
   Compiling memchr v2.7.4
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.215
   Compiling libc v0.2.166
   Compiling libc v0.2.158
   Compiling bitflags v2.6.0
   Compiling regex-syntax v0.8.5
   Compiling crossbeam-utils v0.8.20
   Compiling cfg_aliases v0.2.1
   Compiling glob v0.3.1
   Compiling rustix v0.38.41
   Compiling rustversion v1.0.18
   Compiling linux-raw-sys v0.4.14
   Compiling nix v0.29.0
   Compiling log v0.4.22
   Compiling syn v1.0.109
   Compiling memchr v2.5.0
   Compiling prettyplease v0.2.25
   Compiling serde_json v1.0.133
   Compiling thiserror v1.0.69
   Compiling shlex v1.3.0
   Compiling same-file v1.0.6
   Compiling either v1.13.0
   Compiling minimal-lexical v0.2.1
   Compiling walkdir v2.5.0
   Compiling aho-corasick v1.1.3
   Compiling bstr v1.11.0
   Compiling cvt v0.1.2
   Compiling clang-sys v1.8.1
   Compiling libloading v0.8.5
   Compiling anyhow v1.0.93
   Compiling nom v7.1.3
   Compiling once_cell v1.20.2
   Compiling quote v1.0.37
   Compiling crossbeam-epoch v0.9.18
   Compiling itoa v1.0.14
   Compiling ryu v1.0.18
   Compiling bindgen v0.69.5
   Compiling syn v2.0.89
   Compiling std v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/std)
   Compiling autocfg v1.4.0
   Compiling crossbeam-deque v0.8.5
   Compiling home v0.5.9
   Compiling heck v0.4.1
   Compiling camino v1.1.9
   Compiling semver v1.0.23
   Compiling itertools v0.12.1
   Compiling cc v1.2.1
   Compiling fastrand v2.2.0
   Compiling normpath v1.3.0
   Compiling rustc-hash v1.1.0
   Compiling lazycell v1.3.0
   Compiling bitflags v1.3.2
   Compiling lazy_static v1.5.0
   Compiling unicode-xid v0.2.6
   Compiling iana-time-zone v0.1.61
   Compiling const_format_proc_macros v0.2.33
   Compiling num-traits v0.2.19
   Compiling regex-automata v0.4.9
   Compiling cexpr v0.6.0
   Compiling which v4.4.2
   Compiling tempfile v3.14.0
   Compiling filetime v0.2.25
   Compiling cmake v0.1.52
   Compiling chrono v0.4.38
   Compiling fs_at v0.2.1
   Compiling remove_dir_all v0.8.4
   Compiling strum_macros v0.24.3
   Compiling globset v0.4.15
   Compiling regex v1.11.1
   Compiling ignore v0.4.23
   Compiling strum v0.24.1
   Compiling globwalk v0.8.1
   Compiling serde_derive v1.0.215
   Compiling thiserror-impl v1.0.69
   Compiling build-time v0.1.3
   Compiling rustc-std-workspace-core v1.99.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/alloc)
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.24
   Compiling unwind v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/unwind)
   Compiling cargo-platform v0.1.9
   Compiling envy v0.4.2
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_abort v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/panic_unwind)
   Compiling embuild v0.32.0 (https://github.com/denbeigh2000/embuild?rev=b8b924b7a5bdbe947d5fff252cd24f61bda00074#b8b924b7)
   Compiling cargo_metadata v0.18.1
   Compiling gimli v0.29.0
   Compiling object v0.36.2
   Compiling hashbrown v0.14.5
   Compiling std_detect v0.1.5 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling miniz_oxide v0.7.4
   Compiling addr2line v0.22.0
   Compiling esp-idf-sys v0.35.0 (/home/validation/esp-idf-sys)
   Compiling proc_macro v0.0.0 (/home/validation/.rustup/toolchains/esp/lib/rustlib/src/rust/library/proc_macro)
   Compiling const_format v0.2.33
warning: unexpected `cfg` condition name: `esp_idf_version`
   --> examples/std_basics.rs:116:11
    |
116 | #[cfg(not(esp_idf_version = "4.3"))]
    |           ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(esp_idf_version, values("4.3"))'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(esp_idf_version, values(\"4.3\"))");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `esp_idf_version`
  --> examples/std_basics.rs:31:15
   |
31 |     #[cfg(not(esp_idf_version = "4.3"))]
   |               ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(esp_idf_version, values("4.3"))'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(esp_idf_version, values(\"4.3\"))");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: `esp-idf-sys` (example "std_basics") generated 2 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 04s

If you're happy with this, I'll PR these changes.

After that, I can also PR the necessary changes to esp-idf-sys (after tidying them up).

@ivmarkov
Copy link
Collaborator

@denbeigh2000 OK, good!

Next step is to open PRs against the embuild and sys repos that contain your changes - once you feel ready with those.

Would be good to also explain shortly how you did workaround the failure in the CMake build. If I'm not mistaken, the original plan was to do changes to cmake-rs? Apparently, it is no longer mecessary, but also I can't see in your changes how exactly you silenced cmake not to complain that the ESP IDF dir is not a GIT repo?

@denbeigh2000
Copy link
Contributor

@denbeigh2000 OK, good!

Next step is to open PRs against the embuild and sys repos that contain your changes - once you feel ready with those.

No problem, I'll get those up today.

Would be good to also explain shortly how you did workaround the failure in the CMake build. If I'm not mistaken, the original plan was to do changes to cmake-rs? Apparently, it is no longer mecessary, but also I can't see in your changes how exactly you silenced cmake not to complain that the ESP IDF dir is not a GIT repo?

Sure - I think the actual problem in my initial validation was user error, I misconfigured my environment variables while trying to package my toolchain. 😅


The idea was never to tackle cmake-rs, but rather just the cmake configuration in esp-idf (if it was necessary).

This is the specific error I was hitting in my output: (git rev-parse returned 'fatal: not a git repository (or any parent up to mount point /))

Going in further, I found this should only be evaluated if my env vars are unset. Once I realised that, I decided to just test the problem on its own.

Confusingly, IDF still attempts to call git several times - the output still pollutes stdout/stderr, but the compilation succeeds (there have been a few recent changes to IDF to make this non-fatal). This isn't seen in a successful cargo build because cargo hides stdout/stderr from successful builds.


Turns out compiler toolchains are hard, and solving just one problem at once made life a lot easier 😄

@denbeigh2000
Copy link
Contributor

denbeigh2000 commented Nov 29, 2024

After doing some more thorough testing, I'd like one more day to consider these changes.

Namely, I want to fix the interaction between these functions. Currently, they both need to be aware of if IDF_PATH is externally provided, which feels wrong.


My changes to esp-idf-sys will need to be updated, and I will need to submit a change to esp-idf.

I found that I was not invoking try_from_env correctly here, which meant embuild was always managing my esp-idf checkout.

When I fixed this, I found that this check in openthread also causes a build failure.

IMHO the nicest way to fix would be applying this change in esp-idf, which will avoid any changes to openbuild:

diff --git a/components/openthread/CMakeLists.txt b/components/openthread/CMakeLists.txt
index 455b346924..5b538c2d57 100644
--- a/components/openthread/CMakeLists.txt
+++ b/components/openthread/CMakeLists.txt
@@ -168,20 +168,26 @@ execute_process(
     COMMAND git rev-parse --short HEAD
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     OUTPUT_VARIABLE IDF_VERSION_FOR_OPENTHREAD_PACKAGE OUTPUT_STRIP_TRAILING_WHITESPACE
 )

 execute_process(
     COMMAND git rev-parse --short HEAD
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/openthread
     OUTPUT_VARIABLE OPENTHREAD_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
 )
+if (STATUS AND NOT STATUS EQUAL 0)
+    # If this is not a valid git checkout, eagerly set OT_PACKAGE_VERSION for openthread.
+    # If this is unset, openthread's compilation process will invoke git to set this variable,
+    # causing a build failure.
+    set(OT_PACKAGE_VERSION "development" CACHE STRING "OpenThread Package Version")
+endif()

 string(TIMESTAMP OT_BUILD_TIMESTAMP " %Y-%m-%d %H:%M:%S UTC" UTC)
 string(CONCAT OT_FULL_VERSION_STRING
        "openthread-esp32/"
        "${IDF_VERSION_FOR_OPENTHREAD_PACKAGE}-${OPENTHREAD_VERSION}\; "
        "${CONFIG_IDF_TARGET}\; ${OT_BUILD_TIMESTAMP}")

 idf_component_register(SRC_DIRS "${src_dirs}"
                        EXCLUDE_SRCS "${exclude_srcs}"
                        INCLUDE_DIRS "${public_include_dirs}"

That's the only change I've needed to make to ensure a successful compilation without esp-idf being a valid git repo.

@ivmarkov
Copy link
Collaborator

Yes - sure - take your time. Non-GIT build support was in the queue for so long time, that even if it needs a couple of extra weeks, no big deal I guess.

I suggest you just mark one or both of your PRs as "Draft" until you feel they are ready for submission and review, and then you can un-"draft" them.

@denbeigh2000
Copy link
Contributor

denbeigh2000 commented Dec 1, 2024

I got pretty caught out by failures that were difficult to reproduce after the first successful build yesterday, so I reconsidered my approach to testing and made it a lot more repeatable.

I'm confident after thorough testing that this change is doing the right thing, and I've included annotated stderr of all my builds for proper validation.


Interestingly enough, I did run into the same issue with openthread performing git operations in its' own build script, but it didn't seem to cause a failure. I've lost the original stderr of the build I found that issue on, but I can do repeated successful builds with that configuration in my testing harness, so 🤷.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants