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

esp32 platform does not install due to filesystem permissions #9

Open
positron96 opened this issue Jan 25, 2021 · 3 comments
Open

esp32 platform does not install due to filesystem permissions #9

positron96 opened this issue Jan 25, 2021 · 3 comments

Comments

@positron96
Copy link

Hi and thank you for this image.

I'm trying to use it to build esp32 firmware and meet some problems. esp32 platform installs some python packages to work and pip fails to install them due to not being able to write to /.local folder. It seems user directory for this image is set to /, which probably causes problems. $USER might be set to /root to make it work better.

Log:

$ pio platform install [email protected]
********************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
********************************************************************************
Platform Manager: Installing espressif32 @ 2.0.0
Downloading...
Unpacking...
Platform Manager: espressif32 @ 2.0.0 has been installed!
Tool Manager: Installing platformio/toolchain-xtensa32 @ ~2.50200.0
Downloading...
Unpacking...
Tool Manager: toolchain-xtensa32 @ 2.50200.80 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.20600.0
Downloading...
Unpacking...
Tool Manager: tool-esptoolpy @ 1.20600.0 has been installed!
The platform '[email protected]' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.
********************************************************************************
There is a new version 5.0.4 of PlatformIO available.
Please upgrade it via `platformio upgrade` or `pip install -U platformio` command.
Changes: https://docs.platformio.org/en/latest/history.html
********************************************************************************
********************************************************************************
There are the new updates for platforms (espressif32)
Please update them via `platformio platform update` command.
If you want to manually check for the new versions without updating, please use `platformio platform update --dry-run` command.
********************************************************************************
$ cp $VER_FILE $DIR/main
$ pio run -e esp32dev
Processing esp32dev (platform: espressif32@~2.0.0; framework: espidf; board: esp32dev)
--------------------------------------------------------------------------------
Tool Manager: Installing platformio/toolchain-xtensa32 @ ~2.80200.0
Downloading...
Unpacking...
Tool Manager: toolchain-xtensa32 @ 2.80200.200827 has been installed!
Tool Manager: Installing platformio/toolchain-esp32ulp @ ~1.22851.0
Downloading...
Unpacking...
Tool Manager: toolchain-esp32ulp @ 1.22851.191205 has been installed!
Tool Manager: Installing platformio/framework-espidf @ ~3.40100.0
Downloading...
Unpacking...
Tool Manager: framework-espidf @ 3.40100.200827 has been installed!
Tool Manager: Installing platformio/tool-cmake @ ~3.16.0
Downloading...
Unpacking...
Tool Manager: tool-cmake @ 3.16.4 has been installed!
Tool Manager: Installing platformio/tool-ninja @ ^1.7.0
Downloading...
Unpacking...
Tool Manager: tool-ninja @ 1.7.1 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40001.0
Downloading...
Unpacking...
Tool Manager: tool-scons @ 4.40001.0 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (2.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf 3.40100.200827 (4.1.0) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - tool-ninja 1.7.1 
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80200.200827 (8.2.0)
Installing ESP-IDF's Python dependencies
WARNING: The directory '/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Defaulting to user installation because normal site-packages is not writeable
Collecting cryptography>=2.1.4
  Downloading cryptography-3.3.1-cp36-abi3-manylinux2010_x86_64.whl (2.6 MB)
Collecting future>=0.15.2
  Downloading future-0.18.2.tar.gz (829 kB)
Collecting pyparsing<2.4.0,>=2.0.3
  Downloading pyparsing-2.3.1-py2.py3-none-any.whl (61 kB)
Collecting cffi>=1.12
  Downloading cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl (405 kB)
Collecting six>=1.4.1
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
Building wheels for collected packages: future
  Building wheel for future (setup.py): started
  Building wheel for future (setup.py): finished with status 'done'
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491059 sha256=220393297ee71f25ec2f6f9c17c25d4c321ee6a04ee1aaa64d4b12b1a384228d
  Stored in directory: /tmp/pip-ephem-wheel-cache-kbn55m1f/wheels/2f/a0/d3/4030d9f80e6b3be787f19fc911b8e7aa462986a40ab1e4bb94
Successfully built future
Installing collected packages: pycparser, cffi, six, cryptography, future, pyparsing
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/.local'
Check the permissions.
WARNING: You are using pip version 20.2.4; however, version 21.0 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
*** Error 1
Reading CMake configuration...
-- Could NOT find Git (missing: GIT_EXECUTABLE) 
-- 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: /.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc -- 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: /.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g++
-- Check for working CXX compiler: /.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Project version: 1
-- Building ESP-IDF components for target esp32
-- Checking Python dependencies...
The following Python requirements are not satisfied:
future>=0.15.2
cryptography>=2.1.4
pyparsing>=2.0.3,<2.4.0
Please follow the instructions found in the "Set up the tools" section of ESP-IDF Getting Started Guide
-- Configuring incomplete, errors occurred!

In the middle of the logs there is a line ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/.local'

@sglahn
Copy link
Owner

sglahn commented Feb 23, 2021

Can you delete your image and pull latest again and see if the problem still exists? Because I can't reproduce your error.

I tried the following:

  1. Run container interactive and install espressif32
    docker run -it --entrypoint /bin/bash -v `pwd`:/workspace sglahn/platformio-core:latest
    And then from within the container install the lib:
    pio platform install [email protected]
    And it worked. Here are the logs:
I have no name!@c8a1fec0585f:/workspace$ pio platform install [email protected]
***********************************************************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
***********************************************************************************************************************

Platform Manager: Installing espressif32 @ 2.0.0
Platform Manager: espressif32 @ 2.0.0 has been installed!
Tool Manager: Installing platformio/toolchain-xtensa32 @ ~2.50200.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: toolchain-xtensa32 @ 2.50200.80 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.20600.0
Tool Manager: tool-esptoolpy @ 1.20600.0 has been installed!
The platform '[email protected]' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.

***********************************************************************************************************************
There is a new version 5.1.0 of PlatformIO available.
Please upgrade it via `platformio upgrade` or `pip install -U platformio` command.
Changes: https://docs.platformio.org/en/latest/history.html
***********************************************************************************************************************


***********************************************************************************************************************
There are the new updates for platforms (espressif32)
Please update them via `platformio platform update` command.

If you want to manually check for the new versions without updating, please use `platformio platform update --dry-run` command.
***********************************************************************************************************************
  1. Install the lib the "normal" way:
    docker run --rm -v `pwd`:/workspace -u `id -u $USER`:`id -g $USER` sglahn/platformio-core:latest platform install [email protected]

And it also worked. Here are the logs:

********************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
********************************************************************************

Platform Manager: Installing espressif32 @ 2.0.0
Platform Manager: espressif32 @ 2.0.0 has been installed!
Tool Manager: Installing platformio/toolchain-xtensa32 @ ~2.50200.0
Tool Manager: toolchain-xtensa32 @ 2.50200.80 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.20600.0
Tool Manager: tool-esptoolpy @ 1.20600.0 has been installed!
The platform '[email protected]' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.

********************************************************************************
There is a new version 5.1.0 of PlatformIO available.
Please upgrade it via `platformio upgrade` or `pip install -U platformio` command.
Changes: https://docs.platformio.org/en/latest/history.html
********************************************************************************


********************************************************************************
There are the new updates for platforms (espressif32)
Please update them via `platformio platform update` command.

If you want to manually check for the new versions without updating, please use `platformio platform update --dry-run` command.
********************************************************************************

@positron96
Copy link
Author

I'll try as soon as I can!
Meanwhile, where are python packages installed in your case?

@positron96
Copy link
Author

positron96 commented Feb 23, 2021

Huh, can you please try not only installing the platform, but also pio run'ing some project? In my case installation also finishes fine, but run fails because python packages are installed during run, not during installation (see my log from the issue).

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