version control - Insight on handling static library revisions (i.e. binaries) with git -
i'm looking insight on how handle git repositories each utilize (large) static library, , have concerns solution thought about.
suppose lots of separate projects, under version control, each rely upon large static library under (very) active development. let's repos a
, b
, c
, ...
have own development teams, , rely on lib
. now, lib
project under version control, , being worked on yet team. let's assume teams can't/shouldn't access source lib
, accessing headers , static library binaries ok.
now, when first thought how organize sort of situation in git repos, submodules came mind. here's quick diagram:
"lib" repo: dist/ -> "lib_dist" submodule headers/ sources/ ... "lib_dist" repo: binaries/ (output "lib" repo build process) headers/ (copied "lib" repo in build script) "a" repo: headers/ libs/ lib_dist/ -> "lib_dist" submodule sources/ "b" repo: (looks "a") "c" repo: (again looks "a")
the build process lib
compile source static library files , copy headers dist
subfolder. subfolder submodule of lib
repo, , we'll call lib_dist
repo. lib_dist
repo added a
, b
, c
, ...
submodule.
advantages: developers on teams a
, b
, c
, etc. not have compile large static library themselves, can't see source code lib
, , a
, b
, c
, repos able compile no matter revision developer using. mean if developer on project a
needs go older revision, can git checkout <rev_hash> .
, git submodule update
; if lib_dist
has changed since time <rev_hash>
committed, submodule revision adjusted match 1 present @ time <rev_hash>
made. means lib_dist
headers , binaries "just work".
disadvantages: on time (and exacerbated due active development), lib_dist
repo grow very large, git isn't meant store binary files under version control. git repos on 1gb in size can tax server, , pushing/pulling become time consuming , resource intensive.
so, in sort of context, "best practices"? git right tool? better tool exist (i'm open other version control tools)? nothing came mind me, short of manually managing lib
versions. but, seems me manually managing to-be-compiled-against version of static lib so... 20th century (and error-prone).
thanks!
edit: should add these projects written in c/c++.
i not recommend using git managing library binaries, gits core feature versioning not need. if building on multiple platforms, have provide separate binaries each platform.
what looking seems kind of automated dependency management e.g. maven java.
Comments
Post a Comment