Software repository

From HandWiki
Short description: Storage location for software packages


A software repository, or repo for short, is a storage location for software packages. Often a table of contents is also stored, along with metadata. A software repository is typically managed by source or version control, or repository managers. Package managers allow automatically installing and updating repositories, sometimes called "packages".

Overview

Many software publishers and other organizations maintain servers on the Internet for this purpose, either free of charge or for a subscription fee. Repositories may be solely for particular programs, such as CPAN for the Perl programming language, or for an entire operating system. Operators of such repositories typically provide a package management system, tools intended to search for, install and otherwise manipulate software packages from the repositories. For example, many Linux distributions use Advanced Packaging Tool (APT), commonly found in Debian based distributions, or Yellowdog Updater, Modified (yum) found in Red Hat based distributions. There are also multiple independent package management systems, such as pacman, used in Arch Linux and equo, found in Sabayon Linux.

Example of a signed repository key (with ZYpp on openSUSE)

As software repositories are designed to include useful packages, major repositories are designed to be malware free. If a computer is configured to use a digitally signed repository from a reputable vendor, and is coupled with an appropriate permissions system, this significantly reduces the threat of malware to these systems. As a side effect, many systems that have these abilities do not need anti-malware software such as antivirus software.[1]

Most major Linux distributions have many repositories around the world that mirror the main repository.

In an enterprise environment, a software repository is usually used to store artifacts, or to mirror external repositories which may be inaccessible due to security restrictions. Such repositories may provide additional functionality, like access control, versioning, security checks for uploaded software, cluster functionality etc. and typically support a variety of formats in one package, so as to cater for all the needs in an enterprise, and thus aiming to provide a single point of truth. Popular examples are JFrog Artifactory,[2][3] Nexus repository[4] and Cloudsmith,[5] a cloud-based product.

At client side, a package manager helps installing from and updating the repositories.

At server side, a software repository is typically managed by source control or repository managers. Some of the repository managers allow to aggregate other repository location into one URL and provide a caching proxy. When doing continuous builds many artifacts are produced and often centrally stored, so automatically deleting the ones which are not released is important.

Package management system vs. package development process

A package management system is different from a package development process.

A typical use of a package management system is to facilitate the integration of code from possibly different sources into a coherent stand-alone operating unit. Thus, a package management system might be used to produce a distribution of Linux, possibly a distribution tailored to a specific restricted application.

A package development process, by contrast, is used to manage the co-development of code and documentation of a collection of functions or routines with a common theme, producing thereby a package of software functions that typically will not be complete and usable by themselves. A good package development process will help users conform to good documentation and coding practices, integrating some level of unit testing.

Selected repositories

The following table lists a few languages with repositories for contributed software. The "Autochecks" column describes the routine checks done.

Very few people have the ability to test their software under multiple operating systems with different versions of the core code and with other contributed packages they may use. For the R programming language, the Comprehensive R Archive Network (CRAN) runs tests routinely.

To understand how this is valuable, imagine a situation with two developers, Sally and John. Sally contributes a package A. Sally only runs the current version of the software under one version of Microsoft Windows, and has only tested it in that environment. At more or less regular intervals, CRAN tests Sally's contribution under a dozen combinations of operating systems and versions of the core R language software. If one of them generates an error, she gets that error message. With luck, that error message details may provide enough input to allow enable a fix for the error, even if she cannot replicate it with her current hardware and software. Next, suppose John contributes to the repository a package B that uses a package A. Package B passes all the tests and is made available to users. Later, Sally submits an improved version of A, which unfortunately, breaks B. The autochecks make it possible to provide information to John so he can fix the problem.

This example exposes both a strength and a weakness in the R contributed-package system: CRAN supports this kind of automated testing of contributed packages, but packages contributed to CRAN need not specify the versions of other contributed packages that they use. Procedures for requesting specific versions of packages exist, but contributors might not use those procedures.

Beyond this, a repository such as CRAN running regular checks of contributed packages actually provides an extensive if ad hoc test suite for development versions of the core language. If Sally (in the example above) gets an error message she does not understand or thinks is inappropriate, especially from a development version of the language, she can (and often does with R) ask the core development-team for the language for help. In this way, the repository can contribute to improving the quality of the core language software.

Language, purpose Package development process Repository Install methods Collaborative development platform Autochecks
Haskell Common Architecture for Building Applications and Libraries[6] Hackage cabal (software)
Java Maven[7]
Julia[8]
Common Lisp Quicklisp[9]
.NET NuGet NuGet[10] dotnet add package <package>
Node.js node npm,[11] yarn, bower npm install <package>

yarn add <package>

bower install <package>

Perl CPAN PPM[12] ActiveState
PHP PEAR, Composer PECL, Packagist composer require <package>

pear install <package>

Python Setuptools PyPI pip, EasyInstall, PyPM, Anaconda
R R CMD check process[13][14] CRAN[15] install.packages[16]
remotes[17]
GitHub[18] Often on 12 platforms or combinations of different versions of R (devel, prerel, patched, release) on different operating systems (different versions of Linux, Windows, macOS, and Solaris).
Ruby RubyGems RubyGems[19] RubyGems,[19] Bundler[20]
Rust Cargo[21] crates.io[22] Cargo[21]
Go go pkg.go.dev go get <package> GitHub[18]
Dart Flutter pub.dev flutter pub get <package>
D DUB dlang.org dub add <package>
TeX, LaTeX CTAN

(Parts of this table were copied from a "List of Top Repositories by Programming Language" on Stack Overflow[23])

Many other programming languages, among them C, C++, and Fortran, do not possess a central software repository with universal scope. Notable repositories with limited scope include:

  • Netlib, mainly mathematical routines for Fortran and C, historically one of the first open software repositories;
  • Boost, a strictly curated collection of high-quality libraries for C++; some code developed in Boost later became part of the C++ standard library.

Package managers

Main page: Package manager

Package managers help manage repositories and the distribution of them. If a repository is updated, a package manager will typically allow the user to update that repository through the package manager. They also help with managing things such as dependencies between other software repositories. Some examples of Package Managers include:

Popular Package Managers
Package Manager Description
npm A package manager for Node.js[24]
pip A package installer for Python[25]
apt For managing Debian Packages[26]
Homebrew A package installer for MacOS that allows one to install packages Apple didn't[27]
vcpkg A package manager for C and C++[28][29]
yum and dnf Package manager for Fedora and Red Hat Enterprise Linux[30]
pacman Package manager for Arch Linux[31]

Repository managers

Relationship to continuous integration

As part of the development lifecycle, source code is continuously being built into binary artifacts using continuous integration. This may interact with a binary repository manager much like a developer would by getting artifacts from the repositories and pushing builds there. Tight integration with CI servers enables the storage of important metadata such as:

  • Which user triggered the build (whether manually or by committing to revision control)
  • Which modules were built
  • Which sources were used (commit id, revision, branch)
  • Dependencies used
  • Environment variables
  • Packages installed

Artifacts and packages

Artifacts and packages inherently mean different things. Artifacts are simply an output or collection of files (ex. JAR, WAR, DLLS, RPM etc.) and one of those files may contain metadata (e.g. POM file). Whereas packages are a single archive file in a well-defined format (ex. NuGet) that contain files appropriate for the package type (ex. DLL, PDB).[32] Many artifacts result from builds but other types are crucial as well. Packages are essentially one of two things: a library or an application.[33]

Compared to source files, binary artifacts are often larger by orders of magnitude, they are rarely deleted or overwritten (except for rare cases such as snapshots or nightly builds), and they are usually accompanied by much metadata such as id, package name, version, license and more.

Metadata

Metadata describes a binary artifact, is stored and specified separately from the artifact itself, and can have several additional uses. The following table shows some common metadata types and their uses:

Metadata type Used for
Versions available Upgrading and downgrading automatically
Dependencies Specify other artifacts that the current artifact depends on
Downstream dependencies Specify other artifacts that depend on the current artifact
License Legal compliance
Build date and time Traceability
Documentation Provide offline availability for contextual documentation in IDEs
Approval information Traceability
Metrics Code coverage, compliance to rules, test results
User-created metadata Custom reports and processes

See also


References

  1. itmWEB: Coping with Computer Viruses
  2. "JFrog Artifactory - wikieduonline". https://www.wikieduonline.com/wiki/JFrog_Artifactory. 
  3. "Artifactory - Universal Artifact Management". https://jfrog.com/artifactory/. 
  4. "Nexus Repository | Software Component Management". https://www.sonatype.com/products/repository-pro. 
  5. "Cloudsmith artifact repository". https://www.cloudsmith.com/. 
  6. "The Haskell Cabal | Overview". https://www.haskell.org/cabal/. 
  7. "Maven – Welcome to Apache Maven". http://maven.apache.org/. 
  8. "Julia Package Listing". https://pkg.julialang.org/. 
  9. "Quicklisp beta". https://www.quicklisp.org/beta/. 
  10. karann-msft. "NuGet Package Manager UI Reference" (in en-us). https://docs.microsoft.com/en-us/nuget/tools/package-manager-ui. 
  11. "npm". https://www.npmjs.com/. 
  12. "Installing Perl Modules - www.cpan.org". http://www.cpan.org/modules/INSTALL.html. 
  13. Leisch, Friedrich. "Creating R Packages: A Tutorial". https://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf. 
  14. Graves, Spencer B.; Dorai-Raj, Sundar. "Creating R Packages, Using CRAN, R-Forge, And Local R Archive Networks And Subversion (SVN) Repositories". https://cran.r-project.org/doc/contrib/Graves+DoraiRaj-RPackageDevelopment.pdf. 
  15. "The Comprehensive R Archive Network". https://cran.r-project.org/. 
  16. "R Installation and Administration". https://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages. 
  17. Wickham, Hadley; Bryan, Jenny. "Package structure and state". R Packages. O'Reilly. https://r-pkgs.org/package-structure-state.html. Retrieved 2020-11-20. 
  18. 18.0 18.1 Decan, Alexandre; Mens, Tom; Claes, Maelick; Grosjean, Philippe (2015). "On the Development and Distribution of R Packages: An Empirical Analysis of the R Ecosystem". Proceedings of the 2015 European Conference on Software Architecture Workshops. pp. 1–6. doi:10.1145/2797433.2797476. ISBN 9781450333931. https://zenodo.org/record/851546. Retrieved 2021-10-26. 
  19. 19.0 19.1 "RubyGems.org your community gem host". https://rubygems.org/. 
  20. "Bundler: The best way to manage a Ruby application's gems". https://bundler.io/. 
  21. 21.0 21.1 "The Cargo Book". https://doc.rust-lang.org/stable/cargo/. 
  22. "Rust Package Registry". https://crates.io/. 
  23. "List of Top Repositories by Programming Language". https://stackoverflow.com/questions/1693529/list-of-top-repositories-by-programming-language. 
  24. "npm About". https://www.npmjs.com/about. 
  25. developers, The pip, pip: The PyPA recommended tool for installing Python packages., https://pip.pypa.io/, retrieved 2019-11-21 
  26. "Apt - Debian Wiki". https://wiki.debian.org/Apt. 
  27. "Homebrew" (in en). https://brew.sh/. 
  28. "Yelp launches Yelp Fusion, Microsoft creates Vcpkg tool, and the new Touch Sense SDK for Android developers". September 20, 2016. https://sdtimes.com/android/yelp-launches-yelp-fusion-microsoft-creates-vcpkg-tool-new-touch-sense-sdk-android-developers-sd-times-news-digest-sept-20-2016/. 
  29. "Microsoft's C++ library manager now available for Linux and macOS". April 25, 2018. https://sdtimes.com/msft/microsofts-c-library-manager-now-available-linux-mac-os/. 
  30. Chinthaguntla, Keerthi (22 April 2020). "Linux package management with YUM and RPM" (in en). https://www.redhat.com/sysadmin/how-manage-packages. 
  31. "pacman - ArchWiki". https://wiki.archlinux.org/index.php/pacman. 
  32. Chris, Tucker (2007-03-15). Optimal Package Install/Uninstall Manager. UC San Diego. p. 1. http://cseweb.ucsd.edu/~lerner/papers/opium.pdf. Retrieved 2011-09-14. 
  33. "Linux repository classification schemes". braintickle.blogspot.com. 13 January 2006. http://braintickle.blogspot.com/2006/01/linux-repository-classification.html.