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

pip install fails if IDF is shallow cloned (IDFGH-2203) #4355

Closed
hackaugusto opened this issue Nov 17, 2019 · 1 comment
Closed

pip install fails if IDF is shallow cloned (IDFGH-2203) #4355

hackaugusto opened this issue Nov 17, 2019 · 1 comment
Assignees

Comments

@hackaugusto
Copy link

hackaugusto commented Nov 17, 2019

Environment

  • Operating System: Arch Linux

Problem Description

pip install -r requirements.txt fails with a shallow clone.

Expected Behavior

The installation should complete.

Actual Behavior

pip install fails with the following stack trace:

Extracting /home/hack/.espressif/dist/openocd-esp32-linux64-0.10.0-esp32-20190313.tar.gz to /home/hack/.espressif/tools/openocd-esp32/v0.10.0-esp32-20190313
Installing Python environment and packages
fatal: No names found, cannot describe anything.
Traceback (most recent call last):
  File "/mnt/test/projects/esp32/esp/idf/tools/idf_tools.py", line 1344, in <module>
    main(sys.argv[1:])
  File "/mnt/test/projects/esp32/esp/idf/tools/idf_tools.py", line 1340, in main
    action_func(args)
  File "/mnt/test/projects/esp32/esp/idf/tools/idf_tools.py", line 1139, in action_install_python_env
    idf_python_env_path, _, virtualenv_python = get_python_env_path()
  File "/mnt/test/projects/esp32/esp/idf/tools/idf_tools.py", line 840, in get_python_env_path
    idf_version_str = subprocess.check_output(['git', '--work-tree=' + global_idf_path, 'describe', '--tags'], cwd=global_idf_path, env=os.environ).decode()
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', '--work-tree=/mnt/test/projects/esp32/esp/idf', 'describe', '--tags']' returned non-zero exit status 128.

Steps to reproduce

I'm running the following script to setup IDF on my machine:

#!/usr/bin/sh

export ESP_ROOT=$(pwd)/esp
export ESP_VIRTUALENV=$ESP_ROOT/venv
export IDF_PATH=$ESP_ROOT/idf  # constant used by the IDF

export ESP_IDF_VERSION="v4.0"
export ESP_IDF_GIT_URL="https://github.com/espressif/esp-idf.git"

export PATH="$IDF_PATH/tool:$PATH"

[ ! -e $IDF_PATH ] && {
    git clone --depth 1 --recursive $ESP_IDF_GIT_URL -b release/$ESP_IDF_VERSION $IDF_PATH
}

[ ! -e $ESP_VIRTUALENV ] && {
    python -m venv $ESP_VIRTUALENV
    source $ESP_VIRTUALENV/bin/activate
    pip install -r $IDF_PATH/requirements.txt
}

I just noticed the venv was created with python3, however the git command seems to be unrelated to that.

Ideally the setup would work with a shallow copy, otherwise documenting this would be useful.

@github-actions github-actions bot changed the title pip install fails if IDF is shallow cloned pip install fails if IDF is shallow cloned (IDFGH-2203) Nov 17, 2019
@dobairoland dobairoland self-assigned this Nov 18, 2019
@dobairoland
Copy link
Collaborator

Hi @hackaugusto. I can reproduce this error message but just to note that it is not related to pip install. It fails for tools/idf_tool.py probably while you are invoking it directly or through export.sh.

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

2 participants