views:

22

answers:

1

Suppose I have a project under my own version control. Then I want to make some changes to a 3rd party lib, so I want to put that lib's source in my project somewhere to be under my version control with the rest of the project. However, the 3rd party lib is maintained somewhere else on another version control software system. Because I am forking this lib, I will want to pull updates for it that get committed later from the outside world.

I do not know the proper way to structure such a situation... do I just have the 3rd party lib with its versioning control and all nested within my version control setup? Or do I maintain it somewhere else and symlink the files or even copy+paste them into my project when I pull in updates from the outside world?

A: 

What I usually do, is have a local copy of the third party library repository. However, that local copy is not part of the same tree where I build my project. In my project repo, I have only the final lib binary my code depends on (and the corresponding headers, in case of C++).

This structure allows me to regularly pull lib updates and evaluate them, while ensuring that my project is building with a stable lib bits. Once I've ensured that any new changes to the library are not going to destabilize my project, I update my project repo with the new binary.

Of course, you can also include the library source directly as part of your project build. You can even automate pulling updates. However, if you do it this way, your project stability is left to the mercy of the library maintainers, and any breaking change in its source or behavior might have adverse effect on your project progress.

Franci Penov