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

Clean All fails on files that are read only #4331

Closed
1 task done
alex-code opened this issue Jun 26, 2022 · 2 comments
Closed
1 task done

Clean All fails on files that are read only #4331

alex-code opened this issue Jun 26, 2022 · 2 comments

Comments

@alex-code
Copy link

  • PlatformIO Core.

Configuration

Operating system: Windows 11

PlatformIO Version (platformio --version): 6.0.2

Description of problem

Clean All fails on files that are "Read Only".
Including a git repository in lib_deps some files in the .git directory are marked read only which blocks cleaning.

Steps to Reproduce

  1. Have a project include https://github.com/PaulStoffregen/Encoder.git in lib_deps
  2. Build or let the libs be downloaded
  3. Run Clean All

Actual Results

PermissionError: [WinError 5] Access is denied: 'C:\\Users\\myuser\\Documents\\GitHub\\My-Project\\.pio\\libdeps\\firebeetle32\\Encoder\\.git\\objects\\pack\\pack-87f987569879568m596f8m96f8fjddl0u.idx':

Expected Results

The files to be removed.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:firebeetle32]
monitor_speed = 115200
platform = espressif32
board = firebeetle32
framework = arduino
monitor_filters = esp32_exception_decoder
extra_scripts = extra_script.py
board_build.partitions = no_ota.csv
lib_ldf_mode = chain+
lib_compat_mode = strict
lib_deps = 
	https://github.com/PaulStoffregen/Encoder.git

Additional info

Adding this line os.chmod(dst, stat.S_IWRITE) to the piotarget.py file just before the remove allows the clean to run successfully but I'm not sure if this is the best way to fix it.

@ivankravets
Copy link
Member

Thanks for the report. Please re-test with pio upgrade --dev. Does it clean without errors now?

@alex-code
Copy link
Author

All good, clean completes successfully.
Thanks for updating 👍

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

No branches or pull requests

2 participants