Open mirrexagon opened 2 years ago
There is also a similar problem when building a project - cannot use git describe
to get version information. I'm not sure if that is related to this, since the latter presumably is about the project, not ESP-IDF itself.
I cannot build rust project because it complains about absence of git repository. And I think I cannot force it to skip the check.
--- stderr
Build configuration: BuildConfig {
esp_idf_tools_install_dir: None,
esp_idf_sdkconfig: None,
esp_idf_sdkconfig_defaults: None,
mcu: Some(
"esp32c3",
),
native: NativeConfig {
esp_idf_version: Some(
Tag(
"v5.1",
),
),
esp_idf_repository: None,
esp_idf_cmake_generator: None,
idf_path: Some(
"/nix/store/g2s0fiybk9y5p9yiw9v3yvp2gyn7xi98-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/g2s0fiybk9y5p9yiw9v3yvp2gyn7xi98-esp-idf-v5.1' is not a git respository
Caused by:
0: command 'cd "/nix/store/g2s0fiybk9y5p9yiw9v3yvp2gyn7xi98-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
I entered the shell through nix develop github:mirrexagon/nixpkgs-esp-dev#esp32c6-idf
then did cargo generate esp-rs/esp-idf-template cargo
cd to a generated project and tried doing cargo build
and I am getting to the same not a git ...
error
It's a pity because this repo is so neatly laid out
I cannot build the hello_world example. Has anyone managed to do that yet? The idf complains about git describe
: Could not use 'git describe' to determine PROJECT_VER, as mentioned above.
Here's a full log:
torben@torbens-xps ~/i/idf-nix (main)> nix develop github:mirrexagon/nixpkgs-esp-dev#esp32-idf
[torben@torbens-xps:~/iot/idf-nix]$ cp $IDF_PATH/examples/get-started/hello_world -r .
[torben@torbens-xps:~/iot/idf-nix]$ cd hello_world/
[torben@torbens-xps:~/iot/idf-nix/hello_world]$ chmod +w .
[torben@torbens-xps:~/iot/idf-nix/hello_world]$ idf.py build
Executing action: all (aliases: build)
Running cmake in directory /home/torben/iot/idf-nix/hello_world/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/nix/store/k13a1nbhdnm607pk33mq3xzirmp11sk9-python3-3.10.12-env/bin/python3.10 -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/torben/iot/idf-nix/hello_world"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /nix/store/y0gvg44jdsbn8hnnr27ixjf102nk7a9x-git-2.41.0/bin/git (found version "2.41.0")
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
fatal: not a git repository (or any of the parent directories): .git
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /nix/store/804azw62j381cvy6c84dhrrxhlby1ly6-xtensa-esp32-elf-esp-idf-v5.1.2/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/804azw62j381cvy6c84dhrrxhlby1ly6-xtensa-esp32-elf-esp-idf-v5.1.2/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/804azw62j381cvy6c84dhrrxhlby1ly6-xtensa-esp32-elf-esp-idf-v5.1.2/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at build/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):
/home/torben/iot/idf-nix/hello_world/build/CMakeFiles/git-data/head-ref
Call Stack (most recent call first):
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/third_party/GetGitRevisionDescription.cmake:83 (include)
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/third_party/GetGitRevisionDescription.cmake:93 (get_git_head_revision)
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/project.cmake:78 (git_describe)
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/project.cmake:543 (__project_get_revision)
CMakeLists.txt:6 (project)
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file /home/torben/iot/idf-nix/hello_world/sdkconfig
Compiler supported targets: xtensa-esp32-elf
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Found Python3: /nix/store/k13a1nbhdnm607pk33mq3xzirmp11sk9-python3-3.10.12-env/bin/python3.10 (found version "3.10.12") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "hello_world" version: 1
-- Adding linker script /home/torben/iot/idf-nix/hello_world/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/soc/esp32/ld/esp32.peripherals.ld
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
-- 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 perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/app_trace /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/app_update /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/bootloader /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/bootloader_support /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/bt /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/cmock /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/console /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/cxx /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/driver /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/efuse /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp-tls /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_adc /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_app_format /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_coex /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_common /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_eth /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_event /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_gdbstub /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_hid /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_http_client /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_http_server /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_https_ota /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_https_server /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_hw_support /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_lcd /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_local_ctrl /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_mm /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_netif /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_netif_stack /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_partition /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_phy /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_pm /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_psram /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_ringbuf /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_rom /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_system /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_timer /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esp_wifi /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/espcoredump /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/esptool_py /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/fatfs /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/freertos /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/hal /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/heap /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/http_parser /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/idf_test /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/ieee802154 /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/json /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/log /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/lwip /home/torben/iot/idf-nix/hello_world/main /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/mbedtls /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/mqtt /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/newlib /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/nvs_flash /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/openthread /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/partition_table /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/perfmon /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/protobuf-c /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/protocomm /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/pthread /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/sdmmc /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/soc /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/spi_flash /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/spiffs /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/tcp_transport /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/ulp /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/unity /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/usb /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/vfs /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/wear_levelling /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/wifi_provisioning /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/wpa_supplicant /nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/components/xtensa
-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the /home/torben/iot/idf-nix/hello_world/build/log/idf_py_stderr_output_97101 and /home/torben/iot/idf-nix/hello_world/build/log/idf_py_stdout_output_97101
I don't know if this is applicable to other build error, but I notices that idf.py
fails if it's run in a git repo (i.e. .git
in a parent dir) that doesn't have any commits yet.
My workaround was to delete the .git
dir to git init
later, when I'm ready to commit.
I tried to reproduce this on manjaro, following the official install instructions, but there it seems to work fine in an empty git repo.
I filed a bug against this upstream in esp-idf, it might be something that could make sense to fix there, even if we can get a workaround on this side.
@torbeneims
I cannot build the hello_world example. Has anyone managed to do that yet? The idf complains about
git describe
: Could not use 'git describe' to determine PROJECT_VER, as mentioned above.Here's a full log:
[...]
Mostly the Git errors don't actually seem to stop the build, but in your case CMake throws an error that might be what stops the build:
CMake Error at build/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):
/home/torben/iot/idf-nix/hello_world/build/CMakeFiles/git-data/head-ref
Call Stack (most recent call first):
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/third_party/GetGitRevisionDescription.cmake:83 (include)
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/third_party/GetGitRevisionDescription.cmake:93 (get_git_head_revision)
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/project.cmake:78 (git_describe)
/nix/store/zw16dh8ns3brx9xx4jmqb731cr72dxa3-esp-idf-v5.1.2/tools/cmake/project.cmake:543 (__project_get_revision)
CMakeLists.txt:6 (project)
If I run the same commands you did on NixOS, I get a successful build, and that file git-data/head-ref
it complains about in your log doesn't exist for me at all after the build. Unfortunately I don't really know how this works - I'm looking through the other comments and related issues and PRs now, which might have some clues.
Thank you all for your work and input on this!
Running
idf.py --version
complains that Git can't get the version.Probably can be ultimately solved by using the
deepClone
option infetchFromGitHub
inpkgs/esp-idf/default.nix
(justleaveDotGit
doesn't work because no tags are present I think, Git "cannot describe anything") and making sure to copy the.git
directory to$out
, but that causes problems fetching/checking out the repository.This would change all the esp-idf hashes, so they have to be updated in:
pkgs/esp-idf/default.nix
examples/shell-override-versions.nix
Needs more investigation. We still do get a version number regardless at the moment.