Is it good practice to store binary dependencies in source control?

前端 未结 3 1325
[愿得一人]
[愿得一人] 2021-02-13 20:07

Over the years, I\'ve always stored binary dependencies in the \\lib folder and checked that into source-control with the rest of the project. I find I do this les

3条回答
  •  梦谈多话
    2021-02-13 20:44

    Things depend on the workflow and the VCS used.

    Using a component based workflow with SVN, you check in the includes and libs of the component. By this the libs and includes make the interface for other components. These only import the libs and includes using svn:externals while not importing the source code of the component at all. This enforces clean interfaces and a strict separation between the different components: A component is a black box that can only be used as specified in the interface. The internal structure is invisible to others. Using binaries reduces compile time and may reduce the number tools required on a machine for compiling since specialized tools that are required for creating a component need not be present when just using it.

    However, using a distributed VCS things will not work this way. DVCS depend on cloning the whole repository. Checking in binaries the size of the repository will rapidly grow beyond a point where this will just take too long. While having SVN repositories of 100GB is not a problem since checkouts only deal with one revision which is smaller by several orders of magnitude, having a Git/Mercurial/Bazaar repository of that size would make it quite unusable since cloning would take ages.

    So whether checking in binaries is a good idea or not depends on your workflow and also depends on the tools used.

提交回复
热议问题