I was wondering if you ever worked out what the issue was? I have the exact same issue as you. We are using PlatformIO with VS Code at my company and we try and store as much stuff on a network drive as possible. I currently have to store my PlatformIO projects on my local drive, which is not ideal. If it might help, we are programming for teensies with the Arduino framework.
It’s difficult to help without a description of the problem. And I wonder how you know that you have *the exact same issue" since the original poster didn’t provide any details either. Can you provide a description of what happens and what you expect to happen instead? Add the contents of platformio.ini, log output etc.
Generally, I would recommend against using mapped network drives for development. Given the amount of temporary files that are created, it will be slow. And if two people work on the same code, it will interfere. A far better approach is to work on a local drive and use a source code respository (such as git) to centrally store and synchronize the source code. It comes with many additional features (such a branching) that you won’t want to miss anymore once you have used them.
When I try to build the project I get lots of errors like this:
Compiling .pio\build\teensy35\src\utilities.cpp.o
'\\path_to_project_on_network_drive'
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\control.cpp: No such file or directory
arm-none-eabi-g++: fatal error: no input files
compilation terminated.
'\\path_to_project_on_network_drive'
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\logging.cpp: No such file or directory
arm-none-eabi-g++: error: src\mavlink_utilities.cpp: No such file or 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.
Regarding whether or not I should be developing on network drives in my case its company policy that your work goes on the network drive. We do use source control for long standing projects as well. We do not have them on the drive so that multiple people can work on them, i definitely agree with you there! I think there are other use cases though, at a university or other large organisation personal files may be stored on a network drive for instance.
I can’t really tell whether that ever worked. But the current build process uses library directories as the current directory and fails because the Windows command shell does not support network paths (UNC) as current directories (and probably never will).
The way I use the term mapped network drive, it only applies to network paths mapped to a drive letter. Is it an option for you to map the library directory or a directory further up in the hierarchy to a drive letter? Most likely, that would fix the problem.
To clarify, I am using it as a mapped network drive (mapped to a letter and everything, opening it from the mapped network drive in windows explorer), however it seems to be converting the windows style directory path to a UNC path. Do you know if there is a way to tell PIO to use the windows style paths instead?
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.
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.
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 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.
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.