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

Git worktree results in cmake error. (IDFGH-1937) #4136

Closed
raldone01 opened this issue Sep 30, 2019 · 0 comments
Closed

Git worktree results in cmake error. (IDFGH-1937) #4136

raldone01 opened this issue Sep 30, 2019 · 0 comments

Comments

@raldone01
Copy link
Contributor

Environment

  • Development Kit: ESP32-DevKitC
  • IDF version v4.0-dev-1287-gd7e659df2
  • Build System: CMake
  • Compiler version xtensa-esp32-elf-gcc (crosstool-NG esp32-2019r1) 8.2.0
  • Operating System: Windows

Problem Description

I created a git worktree with git worktree add ../master master.
tree:

projectRGBDisplay/
├── master
│   ├── .git
│   ├── .gitignore
│   ├── .idea
│   │   ├── .name
│   │   ├── deployment.xml
│   │   ├── encodings.xml
│   │   ├── misc.xml
│   │   ├── modules.xml
│   │   ├── projectRGBDisplay.iml
│   │   ├── vcs.xml
│   │   └── workspace.xml
│   ├── README.md
│   └── Software
│       ├── cmake-build-debug
│       ├── CMakeLists.txt
│       ├── espmake
│       ├── main
│       ├── partitions.csv
│       ├── sdkconfig
│       └── sdkconfig.old
└── projectRGBDisplay
    ├── .git
    │   ├── COMMIT_EDITMSG
    │   ├── config
    │   ├── description
    │   ├── FETCH_HEAD
    │   ├── HEAD
    │   ├── hooks
    │   ├── index
    │   ├── info
    │   ├── logs
    │   ├── objects
    │   ├── ORIG_HEAD
    │   ├── refs
    │   └── worktrees
    ├── .gitignore
    ├── .idea
    │   ├── .name
    │   ├── deployment.xml
    │   ├── encodings.xml
    │   ├── misc.xml
    │   ├── modules.xml
    │   ├── projectRGBDisplay.iml
    │   ├── vcs.xml
    │   └── workspace.xml
    ├── README.md
    └── Software
        ├── build
        ├── cmake-build-debug
        ├── CMakeLists.txt
        ├── espmake
        ├── main
        ├── Makefile
        ├── partitions.csv
        ├── sdkconfig
        └── sdkconfig.old

Expected Behavior

Successful compilation from the worktree.

Actual Behavior

CMAKE error occours when building from the worktree.

Steps to repropduce

  1. Checkout a branch
  2. Create a worktree in another directory
  3. Try to compile from the worktree directory

Debug Logs

-- Found Git: W:/Programs/git-sdk/cmd/git.exe (found version "2.23.0.windows.1") 
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/esp32deps/auto/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp32deps/auto/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp32deps/auto/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/esp32deps/auto/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
-- Check for working CXX compiler: C:/esp32deps/auto/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error: File C:/Users/_/Desktop/projectRGBDisplay/projectRGBDisplay/.git/worktrees/master/packed-refs does not exist.
CMake Error at cmake-build-debug/CMakeFiles/git-data/grabRef.cmake:27 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  C:/esp32deps/auto/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:80 (include)
  C:/esp32deps/auto/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:90 (get_git_head_revision)
  C:/esp32deps/auto/esp-idf/tools/cmake/project.cmake:37 (git_describe)
  C:/esp32deps/auto/esp-idf/tools/cmake/project.cmake:337 (__project_get_revision)
  CMakeLists.txt:13 (project)


CMake Error at cmake-build-debug/CMakeFiles/git-data/grabRef.cmake:28 (file):
  file failed to open for reading (No such file or directory):

    C:/Users/_/Desktop/projectRGBDisplay/master/Software/cmake-build-debug/CMakeFiles/git-data/packed-refs
Call Stack (most recent call first):
  C:/esp32deps/auto/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:80 (include)
  C:/esp32deps/auto/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:90 (get_git_head_revision)
  C:/esp32deps/auto/esp-idf/tools/cmake/project.cmake:37 (git_describe)
  C:/esp32deps/auto/esp-idf/tools/cmake/project.cmake:337 (__project_get_revision)
  CMakeLists.txt:13 (project)


-- Project version: 9ad100a-dirty
-- Building ESP-IDF components for target esp32
-- Checking Python dependencies...
Python requirements from C:\esp32deps\auto\esp-idf\requirements.txt are satisfied.
-- Found PythonInterp: C:/esp32deps/auto/.espressif/python_env/idf4.0_py3.6_env/Scripts/python.exe (found version "3.6.4") 
-- Could NOT find Perl (missing: PERL_EXECUTABLE) 
-- Adding linker script C:/Users/_/Desktop/projectRGBDisplay/master/Software/cmake-build-debug/esp-idf/esp32/esp32_out.ld
-- Adding linker script C:/esp32deps/auto/esp-idf/components/esp32/ld/esp32.project.ld.in
-- Adding linker script C:/esp32deps/auto/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/esp32deps/auto/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/esp32deps/auto/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/esp32deps/auto/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/esp32deps/auto/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script C:/esp32deps/auto/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Components: app_trace app_update asio bootloader bootloader_support bt coap console cxx driver efuse esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_http_client esp_http_server esp_https_ota esp_https_server esp_local_ctrl esp_ringbuf esp_rom esp_websocket_client esp_wifi espcoredump esptool_py expat fatfs freemodbus freertos heap idf_test jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl partition_table protobuf-c protocomm pthread sdmmc smartconfig_ack soc spi_flash spiffs tcp_transport tcpip_adapter ulp unity vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/esp32deps/auto/esp-idf/components/app_trace C:/esp32deps/auto/esp-idf/components/app_update C:/esp32deps/auto/esp-idf/components/asio C:/esp32deps/auto/esp-idf/components/bootloader C:/esp32deps/auto/esp-idf/components/bootloader_support C:/esp32deps/auto/esp-idf/components/bt C:/esp32deps/auto/esp-idf/components/coap C:/esp32deps/auto/esp-idf/components/console C:/esp32deps/auto/esp-idf/components/cxx C:/esp32deps/auto/esp-idf/components/driver C:/esp32deps/auto/esp-idf/components/efuse C:/esp32deps/auto/esp-idf/components/esp-tls C:/esp32deps/auto/esp-idf/components/esp32 C:/esp32deps/auto/esp-idf/components/esp_adc_cal C:/esp32deps/auto/esp-idf/components/esp_common C:/esp32deps/auto/esp-idf/components/esp_eth C:/esp32deps/auto/esp-idf/components/esp_event C:/esp32deps/auto/esp-idf/components/esp_gdbstub C:/esp32deps/auto/esp-idf/components/esp_http_client C:/esp32deps/auto/esp-idf/components/esp_http_server C:/esp32deps/auto/esp-idf/components/esp_https_ota C:/esp32deps/auto/esp-idf/components/esp_https_server C:/esp32deps/auto/esp-idf/components/esp_local_ctrl C:/esp32deps/auto/esp-idf/components/esp_ringbuf C:/esp32deps/auto/esp-idf/components/esp_rom C:/esp32deps/auto/esp-idf/components/esp_websocket_client C:/esp32deps/auto/esp-idf/components/esp_wifi C:/esp32deps/auto/esp-idf/components/espcoredump C:/esp32deps/auto/esp-idf/components/esptool_py C:/esp32deps/auto/esp-idf/components/expat C:/esp32deps/auto/esp-idf/components/fatfs C:/esp32deps/auto/esp-idf/components/freemodbus C:/esp32deps/auto/esp-idf/components/freertos C:/esp32deps/auto/esp-idf/components/heap C:/esp32deps/auto/esp-idf/components/idf_test C:/esp32deps/auto/esp-idf/components/jsmn C:/esp32deps/auto/esp-idf/components/json C:/esp32deps/auto/esp-idf/components/libsodium C:/esp32deps/auto/esp-idf/components/log C:/esp32deps/auto/esp-idf/components/lwip C:/Users/_/Desktop/projectRGBDisplay/master/Software/main C:/esp32deps/auto/esp-idf/components/mbedtls C:/esp32deps/auto/esp-idf/components/mdns C:/esp32deps/auto/esp-idf/components/mqtt C:/esp32deps/auto/esp-idf/components/newlib C:/esp32deps/auto/esp-idf/components/nghttp C:/esp32deps/auto/esp-idf/components/nvs_flash C:/esp32deps/auto/esp-idf/components/openssl C:/esp32deps/auto/esp-idf/components/partition_table C:/esp32deps/auto/esp-idf/components/protobuf-c C:/esp32deps/auto/esp-idf/components/protocomm C:/esp32deps/auto/esp-idf/components/pthread C:/esp32deps/auto/esp-idf/components/sdmmc C:/esp32deps/auto/esp-idf/components/smartconfig_ack C:/esp32deps/auto/esp-idf/components/soc C:/esp32deps/auto/esp-idf/components/spi_flash C:/esp32deps/auto/esp-idf/components/spiffs C:/esp32deps/auto/esp-idf/components/tcp_transport C:/esp32deps/auto/esp-idf/components/tcpip_adapter C:/esp32deps/auto/esp-idf/components/ulp C:/esp32deps/auto/esp-idf/components/unity C:/esp32deps/auto/esp-idf/components/vfs C:/esp32deps/auto/esp-idf/components/wear_levelling C:/esp32deps/auto/esp-idf/components/wifi_provisioning C:/esp32deps/auto/esp-idf/components/wpa_supplicant C:/esp32deps/auto/esp-idf/components/xtensa
-- Configuring incomplete, errors occurred!
See also "C:/Users/_/Desktop/projectRGBDisplay/master/Software/cmake-build-debug/CMakeFiles/CMakeOutput.log".
[Failed to reload]
@github-actions github-actions bot changed the title Git worktree results in cmake error. Git worktree results in cmake error. (IDFGH-1937) Sep 30, 2019
espressif-bot pushed a commit that referenced this issue Nov 19, 2019
Use rev-parse to get the HEAD directory instead of manually looking for
it. This method works in the main repository, worktrees and submodules.

Closes #4136
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

No branches or pull requests

1 participant