Superseding framework libraries

I have found the need to slightly modify mbeds FileSystem libraries for my implementation in the .platformio folder.
The problem is i want my teammates (over a git) to have access to this custom libraries that are located in the projects lib folder but when i call the build option the compiler includes the default libraries instead of the ones located in the project folder.

Is there a way to specify this?

It really does prefer the default ones over the lib/ ones? Strange, I thought from my experience that it always preferred the lib/ folders.

Anyways, for a quick fix you can rename your library which you placed in the lib/ folder (e.g. add -custom). Then specifiy that new name in the lib_deps = .. while adding the old one to the lib_ignore = .. line. Does that work for you?

It does not. i have modified File, FileSystem and FATFileSystem of the mbed framework to define a method called file_truncate but this is only a part of the FileSystem.
If i modify the libraries in the framework folders then it works without problem, however if i restore the original files and copy the custom file to the project folder then the compilation fails when it cannot find the truncate method. I’m using VSCodes

How can i add them to the lib_deps?
take in mind that an absolute path does not work since i need these to work over git with multiple team mates

Oh now I understand. It’s inside .platformio\packages\framework-mbed\features\filesystem.

That’s an interesting question how you’d make that change inside framework-mbed portable. I’d still try to copy out the entire filesystem folder to libs/ under a different name (filesystem-custom?) and do that above. I’ll try that in a second.

Copying the folder does not appear to work, have not tried adding anything to the .ini since im not sure how
Would -D PIO_FRAMEWORK_MBED_FILESYSTEM_PRESENT in the .ini be a problem?

Try to add

lib_ignore = mbed-filesystem

to your platformio.ini env section. I’m not sure of spelling, but you should see the library name in the build output.

1 Like

I have to modify plenty of includes since anything that had “filesystem/…” failed, after modifying lots of files the following error appeard during compilation (the modified folder dpes appear in the build output):

Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\bd\HeapBlockDevice.o
Archiving .pioenvs\bluepill_f103c8\libd5b\libRegArray.a
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\bd\MBRBlockDevice.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\bd\ObservingBlockDevice.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\bd\ProfilingBlockDevice.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\bd\ReadOnlyBlockDevice.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\bd\SlicingBlockDevice.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\fat\ChaN\ff.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\fat\ChaN\ffunicode.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\fat\FATFileSystem.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\LittleFileSystem.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\TESTS\COMMON\atomic_usage.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\TESTS\filesystem\dirs\main.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\TESTS\filesystem\files\main.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\TESTS\filesystem\interspersed\main.o
Compiling .pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\TESTS\filesystem\seek\main.o
lib\Modfilesystem\littlefs\TESTS\COMMON\atomic_usage.cpp:45:10: fatal error: greentea-client/test_env.h: No such file or directory
#include “greentea-client/test_env.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
lib\Modfilesystem\littlefs\TESTS\filesystem\dirs\main.cpp:17:10: fatal error: greentea-client/test_env.h: No such file or directory
#include “greentea-client/test_env.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\TESTS\filesystem\dirs\main.o] Error 1
*** [.pioenvs\bluepill_f103c8\libb9c\Modfilesystem\littlefs\TESTS\COMMON\atomic_usage.o] Error 1
lib\Modfilesystem\littlefs\TESTS\filesystem\files\main.cpp:17:10: fatal error: greentea-client/test_env.h: No such file or directory
#include “greentea-client/test_env.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I’m not even using little fs

Please provide a simple project and file an issue here Issues · platformio/platform-ststm32 · GitHub