I have a large code base under source control (was subversion, now git). To compile the code and run the tests I use a set of 3rd party libraries. These libraries can be divided into few categoriesL
- Binaries only
- 3rd party sources
- 3rd party sources + local modifications
Each library has its {Windows, Linux} X {debug, release} X {32bit, 64bit} configurations. In addition these libraries evolve with time and different versions of my project use different versions/builds of these libraries.
My question is what is the best way to store these 3rd parties?
Here is my set of preferences:
- Keep the size of the project source repository small
- Keep the project source in sync with the 3rd parties so I can always compile and run and old version
- Simple to manage
- Cross platform
I tried and thought of several solutions but neither was satisfactory:
- Use a versioned script to fetch the binaries from a manually managed ftp server that holds all versions of the libraries. This works, but requires careful management of the directory structure on the server. It is error prone as someone might overwrite one of the binaries with a new build.
- SVN externals - At the time SVN externals could not refer to a specific tag. Today I am using git.
- Git submodules - Pulls the entire external repository which can be huge. Alternatively it requires managing a separate repository for every single library. The submodule points at a specific tag which means either I get all the externals, when I need only some, or I mimic some weird file system in the git tree.
It is clear to me that the 3rd party sources need to be stored in git in a vendor branch, but the binaries and headers are a different story.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…