PlatformIO Community

PlatformIO now failing on mapped network drives

In previous versions (up to the latest I think) mapped network drives on windows have worked fine for me but now I get:

CMD.EXE was started with the above path as the current directory.

This is despite opening the project in a folder using a mapped drive letter in windows - which used to work fine.

Hi!

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.

Cheers

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.

2 Likes

Of course, my bad!
; 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

build_flags = -O3

lib_extra_dirs = \\path_to_libraries_on_network_drive

monitor_port = COM[8]
monitor_speed = 115200

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.

Thanks for your response

1 Like

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.

1 Like

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?

It’s quite surprising that a network drive mapped to a drive letter is converted to a UNC path. You could open an issue at https://github.com/platformio/platformio-core.

1 Like

Is it similar to?

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.