PlatformIO now failing on mapped network drives

No, I think it’s different. It looks as if the following happens.

A mapped network drive is specified for lib_extra_dirs:

lib_extra_dirs = T:\shared_libraries

During the build, the drive letter is resolved into a UNC path, e.g. \\server\devteam\shared_libraries

The build task then tries to make the UNC path (or a subpath) the current directory. This fails because Windows (or the command shell) cannot use a UNC path for the current directory.

Unfortunately the platformio.ini and the log output in the thread above have been edited to the point where they are misleading.

I haven’t reproduced it as I hardly ever use PlatformIO on Windows and don’t have a network drive for testing. If the bug is as described above, the fix should be to consistently used the path with the drive letter and not converted it to a UNC path.

What is the right solution here?

I changed all of the paths as I didn’t want to give away too much about the project itself, I should have started with an MWE and as it turns out I can reproduce the issue with a plain, empty project with the same micro.
As you mentioned I do use lib_extra_dirs to point at a folder on the network drive. This works successfully as long as the project itself is on a local drive (ie, the same project I initially posted works just fine when the platformio project is on my C drive).

Log and platformio.ini are below:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:teensy35]
platform = teensy
board = teensy35
framework = arduino

Log:

Processing teensy35 (platform: teensy; board: teensy35; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy35.html
PLATFORM: Teensy 4.8.0 > Teensy 3.5
HARDWARE: MK64FX512 120MHz, 255.99KB RAM, 512KB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy 1.151.0 (1.51)
 - toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)   
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 93 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\teensy35\src\main.cpp.o
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
Compiling .pio\build\teensy35\FrameworkArduino\AudioStream.cpp.o
UNC paths are not supported.  Defaulting to Windows directory.
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
Compiling .pio\build\teensy35\FrameworkArduino\DMAChannel.cpp.o
CMD.EXE was started with the above path as the current directory.
Compiling .pio\build\teensy35\FrameworkArduino\EventResponder.cpp.o
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial1.cpp.o
UNC paths are not supported.  Defaulting to Windows directory.
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial2.cpp.o
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial3.cpp.o
UNC paths are not supported.  Defaulting to Windows directory.
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial4.cpp.o
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
arm-none-eabi-g++: error: src\main.cpp: No such file or directory
arm-none-eabi-g++: fatal error: no input files
compilation terminated.
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
*** [.pio\build\teensy35\src\main.cpp.o] Error 1
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\AudioStream.cpp.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial2.cpp.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\DMAChannel.cpp.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial1.cpp.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial4.cpp.o: No such file or directory
*** [.pio\build\teensy35\FrameworkArduino\DMAChannel.cpp.o] Error 1
*** [.pio\build\teensy35\FrameworkArduino\AudioStream.cpp.o] Error 1
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial2.cpp.o] Error 1
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial1.cpp.o] Error 1
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial4.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial3.cpp.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\EventResponder.cpp.o: No such file or directory
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial3.cpp.o] Error 1
*** [.pio\build\teensy35\FrameworkArduino\EventResponder.cpp.o] Error 1
=========================================================================================================== [FAILED] Took 3.04 seconds ===========================================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

So now the project (and not the extra_libs directory) is on a mapped network drive?

If so, can you open a command shell / terminal with the project directory as the current directory and execute:

pio run

Unfortunately it came out the same. To clarify: the first example I posted (where I changed the paths), both my project and the lib_extra_dirs were on the network drive. If I moved that project over to my local drive (but left the lib_extra_dirs pointing to the network drive) it compiles just fine. The new example is a completely untouched new platformio project, with no extra directories.

Output from running at CLI:

PS S:\Control\Arduino\PIO Demonstration\PIO Test> platformio run
Processing teensy35 (platform: teensy; board: teensy35; framework: arduino)
------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy35.html
PLATFORM: Teensy 4.8.0 > Teensy 3.5
HARDWARE: MK64FX512 120MHz, 255.99KB RAM, 512KB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy 1.151.0 (1.51)
 - toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 93 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\teensy35\src\main.cpp.o
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Compiling .pio\build\teensy35\FrameworkArduino\AudioStream.cpp.o
arm-none-eabi-g++: error: src\main.cpp: No such file or directory
arm-none-eabi-g++: fatal error: no input files
compilation terminated.
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Compiling .pio\build\teensy35\FrameworkArduino\DMAChannel.cpp.o
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Compiling .pio\build\teensy35\FrameworkArduino\EventResponder.cpp.o
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial1.cpp.o
UNC paths are not supported.  Defaulting to Windows directory.
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial2.cpp.o
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial3.cpp.o
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Compiling .pio\build\teensy35\FrameworkArduino\HardwareSerial4.cpp.o
*** [.pio\build\teensy35\src\main.cpp.o] Error 1
'\\fishy\development\Control\Arduino\PIO Demonstration\PIO Test'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\DMAChannel.cpp.o: No such file or directory
*** [.pio\build\teensy35\FrameworkArduino\DMAChannel.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial1.cpp.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial2.cpp.o: No such file or directory
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial1.cpp.o] Error 1
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial2.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial3.cpp.o: No such file or directory
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\HardwareSerial4.cpp.o: No such file or directory
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial3.cpp.o] Error 1
*** [.pio\build\teensy35\FrameworkArduino\HardwareSerial4.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\AudioStream.cpp.o: No such file or directory
*** [.pio\build\teensy35\FrameworkArduino\AudioStream.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio\build\teensy35\FrameworkArduino\EventResponder.cpp.o: No such file or directory
*** [.pio\build\teensy35\FrameworkArduino\EventResponder.cpp.o] Error 1
============================================== [FAILED] Took 3.69 seconds ==============================================
PS S:\Control\Arduino\PIO Demonstration\PIO Test>

Hi,
What version of Python are you using?
It happened to me with version 3.8, back again to 3.7 worked fine for me.
Cheers.

How to reproduce this issue?

/cc @valeros

Hi Ivan.
I had installed in one computer platformio with python 3.7 the one that was installed automatically. With this configuration, no problem to access the mapped network location.
But I installed it in another computer and platformio asked me for python, I don’t know why, I installed 3.8 and linked to platformio. With this configuration the mapped drive was converted into UNC. I tried to change the config file and I got it but the system internally changed the mapped drive again.
Finally I copied the 3.7 python folder from the other computer and linked to platformio. This solved the problem.

I don’t know if this is what’s it’s happening to jackb, but it could be.

Cheers.

1 Like

Thanks! We will investigate Python 3.8.

Any progress with this issue? The “temporary” work around is getting kind of old by now, two release behind at this point? Nobody out there works from a network server?

I’m running Python 3.9, PIO 5.1.0, vscode 1.38.1

Everything on a mapped network drive (S: maps to \the-ripper\storage)

PS S:\devel\Platformio\stepdrv04> pio run -e pc
Processing pc (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------There is a known issue with Python 3.8+ and mapped network drives on Windows.
Please downgrade Python to the latest 3.7. More details at:
https://github.com/platformio/platformio-core/issues/3417  
Verbose mode can be enabled via `-v, --verbose` option     
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (3.0.0) > DOIT ESP32 DEVKIT V1
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-arduinoespressif32 3.10004.210126 (1.0.4)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 28 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoJson> 6.17.3
|-- <FastAccelStepper> 0.22.0
|-- <ArduinoOTA> 1.0
|   |-- <Update> 1.0
|   |-- <WiFi> 1.0
|   |-- <ESPmDNS> 1.0
|   |   |-- <WiFi> 1.0
Building in release mode
Compiling .pio\build\pc\src\main.cpp.o
Generating partitions .pio\build\pc\partitions.bin
Archiving .pio\build\pc\lib9c3\libArduinoJson.a
'\\the-ripper\storage\devel\Platformio\stepdrv04'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.

I am also looking for a solution for this. Mapped network folder to a local Windows drive letter and the CMD.EXE gives the same error - it converts the mapped drive to the UNC path in the background.

any solution to this problem, or a guide how to change the python version in PIO?
thanks!

Also looking for a fix for this… Mapped drive is resolving to UNC path in PIO preventing work on NAS.

I also am having this issue. More specifically when it goes to install the libraries (new computer build), it says UNC isn’t supported and then prepends the UNC project path in front of the download URL for github libraries. It ends up trying to access “\\server\share\https:\github.com\blah\file.zip”

That shouldn’t happen. What’s the exact lib_deps expression in the platformio.ini here?

Yes, I can see there was recent update to Python in November that has caused this

Early december i started getting this message.

Prior to this, it would only fail on paths that had double spaces in it (which was a bit of a folder naming convention ##__Name, etc.). That was a pain, but failing on UNC path’s is not really workable for me any more because every single file I have sits on a NAS, meaning that this issue is now a show stopper. :frowning:

The workaround they mentioned in the bit.ly link did not work for me.

Is there intention to fix this either by the python, vscode, or platformio developers? If not, is there any kind of work around like a path translator planned? Otherwise do I have to go and figure out another IDE solution; this would be a shame because I really liked it.

Thanks!

  1. What is your Windows OS version?
  2. If you ignore this warning, does the project build without any issues?
  3. I’ve just added Solution 2 to that issue. It means downgrading Python to 3.7. Does this work for you?

Hi Ivan, thanks for such a quick response and looking into it. I am reposting my deleted response as I thought I had it solved, but no, I haven’t. To answer your questions :

1: OS is Windows 10 Home version 21H1 x64 bit.
2: I though I found the issue, being another double space in the mapped folder (which doesn’t shown in the path with the network drive) All double spaces removed now, and thought this fixed it, but what really got it “working” again was opening the project folder using the UNC path with the double slashes. When I remapped it and used the network drive path again, it failed and would not build. It works with the UNC path, but the build times have blown way out and intellisense no longer works.

On side note, this double space error in the folder name created 2 sets of heavily nested folders under the project folder, and the would keep nesting until I assume it hit the character limit. It did this nesting outside of the project folder in multiple places as well. Very weird, first two subfolders in image below:

The folders keep nesting until they hit the character limit i guess, one of the paths below:
A:\100 PlatformIO projects\2020.02 HCL TTGO_COPIEDOUT\ Rob's Documents\100 PlatformIO projects\2020.02 HCL TTGO_COPIEDOUT\ Rob's Documents\100 PlatformIO projects\2020.02 HCL TTGO_COPIEDOUT\.pio\build\esp32dev

3: I tried Solution 2, but unfortunately, when i restart PlatformIO after copying over python and deleting the penv folder, it just reinstalls python first then the core.

So i suppose the problem persists. I like platformio too much to change IDE’s, so will try and keep copying back and forth between local drive and network storage where everything else is. I do hope python address this soon (and sorts out the double spaces in the path breaking things :slight_smile: )

Thanks again!

Rob

Hi all,

Has there been any progress for that issue? I’ve been using a workaround like @rwmingis for 1+ year now. I’m running PIO inside a VMWare guest and it’s the host shared drive that I cannot use to build PIO projects.
Did anyone find a trick we could use to make this work?

Any input appreciated.
Thanks.

Just tested now and that problem was fixed by a recent release: