wiki/tools.guix.contribution-workflow.html

40 lines
20 KiB
HTML
Raw Normal View History

2022-07-29 15:41:17 +00:00
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>Guix package contribution workflow</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
MathJax = {
tex: {
inlineMath: [ [&#x27;$&#x27;,&#x27;$&#x27;], [&#x27;\(&#x27;,&#x27;\)&#x27;] ],
displayMath: [ [&#x27;$$&#x27;,&#x27;$$&#x27;], [&#x27;[&#x27;,&#x27;]&#x27;] ]
},
options = {
processHtmlClass = &quot;math&quot;
}
}
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>Guix package contribution workflow</h1><section class="post-metadata"><span>Date: <!-- -->2021-04-21 01:46:02 +08:00</span><span>Date modified: <!-- -->2021-05-04 20:51:25 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h1"><a href="/wiki/tools.guix.contribution-workflow#getting-started" class="toc-link toc-link-h1">Getting started</a></li><li class="toc-item toc-item-h1"><a href="/wiki/tools.guix.contribution-workflow#adding-or-updating-a-package" class="toc-link toc-link-h1">Adding or updating a package</a></li><li class="toc-item toc-item-h1"><a href="/wiki/tools.guix.contribution-workflow#testing-your-package" class="toc-link toc-link-h1">Testing your package</a></li><li class="toc-item toc-item-h1"><a href="/wiki/tools.guix.contribution-workflow#creating-a-patch" class="toc-link toc-link-h1">Creating a patch</a></li></ol></nav><p><a href="roam:GNU Guix">GNU Guix</a>, like most GNU projects, are mainly done in collaboration through email.
Here&#x27;s the very basics of what you should do when getting the groove into contributing to the project.
</p><h1 id="getting-started">Getting started</h1><ul><li><p>Basically, you have to create the build environment for the Guix source code.
You may want to always keep the <a href="https://guix.gnu.org/en/manual/">GNU Guix manual</a> on the side.
TL;DR: get the source, <code class="inline-code">./bootstrap</code>, <code class="inline-code">./configure --localstatedir=/var</code>, <code class="inline-code">make check</code>, and you&#x27;re mostly done!
</p></li><li><p>GNU projects have a <a href="https://debbugs.gnu.org/">global issue tracker</a> with each project requiring different steps and locations.
As of 2021-04-21, GNU Guix has mainly two channels for their issue tracker: <a href="https://lists.gnu.org/mailman/listinfo/bug-guix">bug-guix</a> where bug reports go and <a href="https://lists.gnu.org/mailman/listinfo/guix-patches">guix-patches</a> where contributions are streamed.
</p><ul><li><p>Both of the channels are essentially mailing lists, only an email address is required to subscribe.
</p></li><li><p>There is a <a href="http://issues.guix.gnu.org/">more legible frontend</a> combining both the channels of the bug report and patches.
</p></li></ul></li><li><p>The Guix community has a <a href="https://ci.guix.gnu.org/">build farm</a> running its <a href="http://guix.gnu.org/cuirass/">own CI software</a>.
Pretty useful to track the status of several channels that is happening within the package set.
You could also stay tuned with <a href="https://ci.guix.gnu.org/events/rss/">its RSS feed</a>.
</p></li></ul><h1 id="adding-or-updating-a-package">Adding or updating a package</h1><ul><li><p>Once you want to define a package, you can either edit it by hand or <a href="https://guix.gnu.org/en/cookbook/en/html_node/Programmable-and-automated-package-definition.html#Programmable-and-automated-package-definition">create a template from an importer</a>.
Nonetheless, referring to the <a href="https://guix.gnu.org/en/manual/en/html_node/Programming-Interface.html">programming interface</a> and the <a href="https://guix.gnu.org/en/manual/en/html_node/package-Reference.html"><code class="inline-code">package</code> reference</a> is a good idea.
</p></li><li><p>If your name is not added yet into the copyright header, add it to the file where the package is defined.
You&#x27;re essentially declaring you have copyright over the piece of code you&#x27;re contributing.
</p></li><li><p>One of the common starting tasks when declaring a package is checking the hash of the source objects.
In Guix, <code class="inline-code">guix hash</code> and <code class="inline-code">guix download</code> are handy tools.
</p></li><li><p>With each package has different requirements, one of the biggest differences is how they&#x27;re built.
Thus, you&#x27;ll be paying a lot of attention to <a href="https://guix.gnu.org/en/manual/en/html_node/Build-Systems.html">build systems</a>.
Each build system has different parameters so be sure to visit it often.
</p></li><li><p>When declaring dependencies, it&#x27;s a good idea to see how other packages have done in similar build systems.
Otherwise, it should be done on a case-by-case basis.
Just keep a reference to the <code class="inline-code">package</code> object on the side and it will be almost smooth sailing.
</p></li><li><p>Keep in mind that they also have a guideline for writing <a href="https://guix.gnu.org/en/manual/en/html_node/Synopses-and-Descriptions.html">synopsis and description</a>.
</p><ul><li><p>Synopsis shouldn&#x27;t start with an uppercase letter, a common article (e.g., &quot;a&quot;, &quot;an&quot;, &quot;the&quot;), and doesn&#x27;t end with a punctuation.
</p></li><li><p>Descriptions should be five to ten sentences long formatted in <a href="https://www.gnu.org/software/texinfo/manual/texinfo/html_node/index.html">Texinfo</a> without writing like a marketing sale pitch.
</p></li></ul></li><li><p>Just for future reference, the popular MIT license is referred to as the <a href="https://directory.fsf.org/wiki/License:Expat">Expat license</a>.
</p></li></ul><h1 id="testing-your-package">Testing your package</h1><ul><li><p><code class="inline-code">guix build</code></p></li><li><p>You can test to build in other architectures with the QEMU binaries service.
</p></li></ul><h1 id="creating-a-patch">Creating a patch</h1></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"\"2021-04-21 01:46:02 +08:00\"","date_modified":"\"2021-05-04 20:51:25 +08:00\"","language":"en","source":""},"title":"Guix package contribution workflow","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"getting-started"},"children":[{"type":"text","value":"Getting started"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/tools.guix.contribution-workflow#getting-started"},"children":[{"type":"text","value":"Getting started"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"adding-or-updating-a-package"},"children":[{"type":"text","value":"Adding or updating a package"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/tools.guix.contribution-workflow#adding-or-updating-a-package"},"children":[{"type":"text","value":"Adding or updating a package"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"testing-your-package"},"children":[{"type":"text","value":"Testing your package"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/tools.guix.contribution-workflow#testing-your-package"},"children":[{"type":"text","value":"Testing your package"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"creating-a-patch"},"children":[{"type":"text","value":"Creating a patch"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/tools.guix.contribution-workflow#creating-a-patch"},"children":[{"type":"text","value":"Creating a patch"}]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"roam:GNU Guix"},"children":[{"type":"text","value":"GNU Guix"}]},{"type":"text","value":", like most GNU projects, are mainly done in collaboration through email.\nHere's the very basics of what you should do when getting the groove into contributing to the project.\n"}]},{"type":"element","tagName":"h1","properties":{"id":"getting-started"},"children":[{"type":"text","value":"Getting started"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Basically, you have to create the build environment for the Guix source code.\n You may want to always keep the "},{"type":"element","tagName":"a","properties":{"href":"https://guix.gnu.org/en/manual/"},"children":[{"type":"text","value":"GNU Guix manual"}]},{"type":"text","value":" on the side.\n TL;DR: get the source, "},{"type":"element","tagName":"code","properties":{"className":["inline-code"]},"children":[{"type":"text","value":"./bootstrap"}]},{"type":"text","value":", "},{"type":"element","tagName":"code","properties":{"className":["inline-code"]},"children":[{"type":"text","value":"./configure --localstatedir=/var"}]},{"type":"text","value":", "},{"type":"element","tagName":"code","properties":{"className":["inline-code"]},"children":[{"type":"text","value":"make check"}]},{"type":"text","value":", and you're mostly done!\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","v