Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it acceptable/good to store binaries in SVN?

We would like to share runtime project binary files. So every team member could take current working version. It is acceptable/good to store runtime binaries in the SVN?

like image 347
user22814 Avatar asked Feb 10 '09 08:02

user22814


People also ask

How does SVN store binary files?

If Subversion determines that the file is binary, the file receives an svn:mime-type property set to application/octet-stream. You can always override this by using the auto-props feature or by setting the property manually with svn propset . Subversion treats the following files as text: Files with no svn:mime-type.

Does SVN store diffs?

It doesn't make complete copies of nodes; instead, it stores the latest revision as a full text, and previous revisions as a succession of reverse diffs (the word "diff" is used loosely here – for files, it means vdeltas, for directories, it means a format that expresses changes to directories).


1 Answers

The two common reasons you may want to store binaries in a Version Control System are (written in 2009):

  • store external third-party libraries.
    Usually one stores them into a Maven repository, but to store them into SVN allows you to have one and only one referential for all your need: get your sources, and get your libraries you need to compile those sources. All comes from one repository.

(As noted by ivorujavaboy in 2017: "The only good reason to do this at present day is if you have STATIC libraries that will never change, which is a really rare case")

  • store deliveries for quicker deployment.
    Usually deliveries (the executable you build to deploy into production) are built on demand.
    But if you have many pre-production environment, and if you have many deliveries, the cost of building them for assembly, integration, homologation, pre-production platforms can be high.
    A solution is to build them once, store them in a deliveries section of your SVN, and use them directly in your different environment.
    Note:
    This apply also to development elements: if you have a Jaxb process which generates 900 POJO files (through XML binding), and you need to download that development set in multiple environments, you may want 1 compressed file copy transaction, rather than 900 ones.

So yes, it is "acceptable/good to store runtime binaries in the SVN"... for the right reasons.


That being said:

  • Wim Coenen rightfully mentions the disadvantages (bad practice, slow, mismatch between sources and stored delivery)
  • Vladimir advocates for the use of a delivery referential (Nexus or, as Vladimir mentions, Apache ivy)
  • RogerV illustrates the advantages of using said delivery referential (Nexus in his case)
like image 68
VonC Avatar answered Sep 21 '22 20:09

VonC