Are libraries duplicated?

I’m sure the answer is out there somewhere, but I can’t seem to actually decipher it.

I’m trying to import older projects from an old slow laptop, to a (finally!) faster one. But I’ve had this question on my mind for a while.

It looks like, PIO duplicates the needed libs for a project, in every project where it’s needed. As opposed to one location for ALL the libs, and just pointing each project to that needed lib.

Am I doing something dumb? Maybe mis-understanding? (both equally likely)

I’ve only added a few projects, I don’t want to get too far at this point. But when I add a project, and look under “project-dir/pio…” it looks like every needed library is copied there. I would expect all libraries to be put “somewhere” once, and the project files point to that location, so that diskspace isn’t wasted on many duplicates.

I guess I just need a yes or no at this point and I can try to figure out what I’m doing. But any added info would be much appreciated.

I’ve been struggling with PIO for a while (man, I’m problem prone). But ow I finally have a decent laptop, I’m hoping my issues will subside.

Thanks

The libraries are normally stored per project. This has something to do with reproducibility. Different projects can use the same library but require different versions, for example.

If you want to use global stored libraries you use the symlink syntax.

example:

lib_deps =
  symlink://../libraries/my_fancy_lib

See also here Platformio ignores dependencies of local library - #2 by sivar2311

Thanks, I’ll look into it.
Probably don’t need to worry about it, I don’t have that many projects. Except the package for the t-Display is around 3G, so that could add up.

Just concerned I was doing something wrong.