<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Chapter 17 Modules and Dependencies on Go: Under the Hood</title><link>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/</link><description>Recent content in Chapter 17 Modules and Dependencies on Go: Under the Hood</description><generator>Hugo</generator><language>en</language><atom:link href="https://golang.design/under-the-hood/en/part5toolchain/ch17modules/index.xml" rel="self" type="application/rss+xml"/><item><title>17.1 The Hard Parts of Dependency Management</title><link>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/challenges/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/challenges/</guid><description>&lt;h1 id="171-the-hard-parts-of-dependency-management"&gt;17.1 The Hard Parts of Dependency Management&lt;/h1&gt;
&lt;p&gt;Modern software is almost never written from scratch. For an ordinary server program, one level down the &lt;code&gt;import&lt;/code&gt; list you find a logging library, an HTTP router, a serializer; one level further down are the cryptography, compression, and network primitives that each of those depends on. The code that is actually yours may be less than one percent of the whole dependency graph. This brings the dividend of reuse, and it also brings a question that is not yours by rights yet must be answered by you: &lt;strong&gt;for every package in this graph, which version should you use?&lt;/strong&gt; This section is in no hurry to give Go&amp;rsquo;s answer; first we want to make the difficulty of the problem itself clear. There are two main threads to it: one is &lt;strong&gt;how to choose a version&lt;/strong&gt; (diamond dependencies and constraint solving), the other is &lt;strong&gt;how to keep it from drifting once chosen&lt;/strong&gt; (reproducible builds). Only once these two are understood can you see why the &amp;ldquo;minimum version selection&amp;rdquo; scheme of &lt;a href=".././minimum"&gt;17.3&lt;/a&gt; deserves its own design, and what price Go paid to get there.&lt;/p&gt;</description></item><item><title>17.2 Semantic Version Management</title><link>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/semantics/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/semantics/</guid><description>&lt;h1 id="172-semantic-version-management"&gt;17.2 Semantic Version Management&lt;/h1&gt;
&lt;p&gt;To manage versions, we first have to make version numbers &lt;strong&gt;mean something&lt;/strong&gt;. &lt;a href=".././challenges"&gt;17.1&lt;/a&gt;
reduced the difficulty of dependency management to two points: version conflicts in diamond
dependencies, and reproducible builds across machines and across time. Whether these two can be
solved depends on a more basic premise, &lt;strong&gt;what a version number actually promises&lt;/strong&gt;. If the
relationship between &lt;code&gt;v1.5&lt;/code&gt; and &lt;code&gt;v1.4&lt;/code&gt; were entirely unpredictable, then no selection algorithm could
get started, and we would be forced back to a solver that &amp;ldquo;tries every pair of versions&amp;rdquo;. The approach
Go modules take is to first turn the version number into a &lt;strong&gt;contract a machine can trust&lt;/strong&gt;, and then,
on top of that contract, propose one distinctive and uncompromising rule, &lt;strong&gt;semantic import
versioning&lt;/strong&gt;. This section makes both of these clear. They are the premise on which the version
selection algorithm of &lt;a href=".././minimum"&gt;17.3&lt;/a&gt; can stand, and stand simply enough to be &amp;ldquo;a single graph
traversal&amp;rdquo;.&lt;/p&gt;</description></item><item><title>17.3 Minimal Version Selection</title><link>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/minimum/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/minimum/</guid><description>&lt;h1 id="173-minimal-version-selection"&gt;17.3 Minimal Version Selection&lt;/h1&gt;
&lt;p&gt;Having settled on semantic versioning (&lt;a href=".././semantics"&gt;17.2&lt;/a&gt;), one last question remains: when different modules in the dependency graph require different versions of the same dependency, &lt;strong&gt;which version do we pick&lt;/strong&gt;? Go&amp;rsquo;s answer is a counterintuitive yet remarkably concise algorithm, &lt;strong&gt;Minimal Version Selection&lt;/strong&gt; (MVS). It is the most distinctive and the most thought-provoking part of Go&amp;rsquo;s module design: other package managers turned this into a problem that needs a constraint solver, while Go compressed it into a single pass over a graph. This section first lays out the rules, then looks at why it can be this simple, and finally places it back within the broader lineage of the field to see exactly what it trades away and what it gains.&lt;/p&gt;</description></item><item><title>17.4 The vgo versus dep Dispute</title><link>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/fight/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://golang.design/under-the-hood/en/part5toolchain/ch17modules/fight/</guid><description>&lt;h1 id="174-the-vgo-versus-dep-dispute"&gt;17.4 The vgo versus dep Dispute&lt;/h1&gt;
&lt;p&gt;Today&amp;rsquo;s Go Modules did not exist from the start. They were born out of a rather dramatic, and rather controversial, community episode: &lt;strong&gt;the vgo versus dep dispute&lt;/strong&gt;. This history is not mere gossip. It reflects the real tension among open-source project governance, technical decision-making, and community sentiment. It is the final piece for understanding why Go Modules are the way they are today, and it is also a concentrated performance, at the toolchain level, of the design philosophy this book has been discussing all along.&lt;/p&gt;</description></item></channel></rss>