Wrong install by git link of lib without manifest

I try to add this repo to lib_deps as:

And so on… In all cases, pio install content of test/ folder instead of root, and that causes build errors (see .pio/<env>/crcpp/ content). Is that normal? If i copy sources to lib/ folder - build works as expected.

Is there any way to use original repo somehow, and include inc/CRC.h into my files (without original project changes)?

PS. Anyway, IMO, pio should not try to use test/ folder of dependencies for build.

Yes, see Include libraries from github - #2 by maxgerhardt and PlatformIO downloads subfolder - #4 by maxgerhardt. Since the linked library has no manifest file (library.json), PlatformIO crawls the subfolders in the search for the source folder, and finds source files in test/ in this case. This logic is contained in find_library_root(), and it fails for the folder structure of your target library.

Fixes as done to close e.g. Library without includeDir unpredictable · Issue #3887 · platformio/platformio-core · GitHub is adding more special cases in the detection logic. In this case for e.g. per Add "inc" as sign that it's the root of the library by maxgerhardt · Pull Request #4093 · platformio/platformio-core · GitHub.

The safest way to use a non-PlatformIO library within PlatformIO is to make it explicitly PlatformIO-compatible, that is, by forking it and giving it a library.json.

This has been fixed in the latest PlatformIO core 5.2.3 (Releases · platformio/platformio-core · GitHub, PR 4093).

1 Like