← index #17192Issue #17173
Related · high · value 2.789
QUERY · ISSUE

mpremote romfs deploy: Directory handling is arguably inconsistent with cp -r

openby peterhinchopened 2025-04-25updated 2025-05-01
enhancementtools

Port, board and/or hardware

Board independent. Tested on RP2040

MicroPython version

MicroPython v1.25.0-dirty on 2025-04-19; Raspberry Pi Pico with RP2040

Built with romfs

Reproduction

Issue

$ mpremote deploy foo

where foo is a directory on the PC containing subdirectories

Expected behaviour

The command

$ mpremote cp -r foo :

copies the directory foo with contents and subdirectories to the host. This is consistent with

$ cp -r foo bar

Observed behaviour

By contrast

$ mpremote deploy foo

copies the contents of foo as per

$ cp -r foo/* bar

A typical project might consist of a Python package foo where the executable foo is contained in a directory holding documentation and other resources. The requirement is to copy foo and its contents. Currently this requires a workround involving a temporary directory and a symlink.

Additional Information

Options are either to change this behaviour or provide means of deploying either the directory + contents or contents alone.

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

mpremote cp -r command fails with "mpremote: cp: -r not specified; omitting directory"

openby jabeloneopened 2025-04-23updated 2025-09-05
bugtools

Port, board and/or hardware

ESP32 on a custom designed ESP32-s3 board

MicroPython version

MicroPython v1.25.0 on 2025-04-15; Generic ESP32S3 module with ESP32S3

Reproduction

  1. install mpremote using the instructions here.
  2. run the command mpremote connect /dev/cu.usbserial-A5069RR4 cp -r configuration/ :configuration/ to recursively copy the configuration directory to the board.

Expected behaviour

I expected the command to recursively copy all files within the configuration directory over to the board to a folder located at /configuration, and to create that folder if it doesn't exist. This expectation comes from the documentation on this page.

mpremote cp -r utils/ :utils/ + soft-reset repl
Same as above, but update the entire utils directory first.

Observed behaviour

The tool returns the following error:

$ mpremote connect /dev/cu.usbserial-A5069RR4 cp -r configuration/ :configuration/
cp configuration/ :configuration/
mpremote: cp: -r not specified; omitting directory

Additional Information

Running on a M1 MacBook Pro, macOS Sequoia 15.3.2.
Using mpremote 1.25.0.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied