Project-specific libraries

Coming from Eagle (or KiCAD, probably others too), I’ve always had one library for each project, that is source-controlled in the repository specific to that board.

It doesn’t seem like there’s an easy way to do that here, since all libraries are saved in the workspace’s “local” folder. I don’t want to create a new workspace for each PCB, but I want to be able to have a library that is source-controlled alongside the schematic and board.

Am I stuck creating a symlink from the “local” folder to a library saved in each project’s repository? Or is there a way to make it recognize libraries that are in different locations?

Thank you!

Hi,

This is not needed for LibrePCB. Every library element used in a project is automatically copied from the workspace into the project (subdirectory library) so when you use a version control system for the project, all dependent libraries are version controlled as well. And when you modify the workspace libraries, no project is affected unless you explicitly trigger Project → Update Project Library in the schematic/board editors.

Thank you for the reply!

Can the parts in the project library be modified directly, or only copied/updated from another library?

I’m trying to figure out a good workflow for our group that has a lot of board projects. We like to have “Common” libraries in one repository that contains only vetted and tested components. Then for each project we would start a library with new custom parts, and once they’re complete/tested push them upstream to the “Common” libraries.

It’s important to be able to collaborate on new library parts without having to push everything back to the main “Common” libraries and create a version control nightmare. That’s why we typically place a library in each board project’s repository as it’s developed alongside the board.

Is there a good way to have this sort of workflow? I would prefer not to give each project two separate repositories, one for the board and one for the library. Branching the “Common” repository would also be a headache when working on more than one project at a time.

Thanks again!

Currently the project library cannot be modified directly. I think some day we’ll implement that but it’s not high priority…

Generally we have the same “problem” with our official LibrePCB libraries distributed with the library manager - for personal projects we want to quickly create the needed library elements (i.e. allowing quick&dirty workflow, possibly containing errors) but for long term (e.g. after a PCB has been successfully tested) we want to get these things moved into the official libraries.

Here my suggested workflow is to have a single personal library next to the official libraries. Then create each new element in the personal library and apply improvements/bugfixes there. Once desired, move them to the official library (the library editor provides this functionality) through a review process. So in the end these elements won’t be contained in the personal library anymore.

Maybe this would also be a viable way for your team - just share the “personal” library with the team, for example in a repository where commits can be added by team members without any review process. So in the end you have two repositories, a “stable library” and a “staging library”. But I agree, the downside is that while working on a project, changes need to be committed to two repositories (project repo & staging library repo).

1 Like