<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cargo sparse index files are served with CRLF line endings]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">our ProGet Cargo feed (a connector to <a href="http://crates.io" rel="nofollow ugc">crates.io</a>, used by Cargo as a sparse registry) serves the<br />
sparse index files with CRLF line endings. <a href="http://crates.io" rel="nofollow ugc">crates.io</a> serves the same files with LF line endings.</p>
<p dir="auto">Example: for the crate axum, the index file /ax/um/axum of the feed has 94 lines, and all 94<br />
end with <code>\r\n</code>. The file from <a href="https://index.crates.io/ax/um/axum" rel="nofollow ugc">https://index.crates.io/ax/um/axum</a> has the same 94 lines with<br />
\n only.</p>
<p dir="auto">Now the problem is that the cargo index format does not specify anywhere, how the line breaks are handled. It only states that each version has a separate line in the file.</p>
<p dir="auto">Cargo itself and <code>cargo-deny</code> handle the line breaks differently.</p>
<ul>
<li>Cargo breaks at <code>\n</code> and uses <code>serde_json</code> for parsing the individual lines as json. <code>serde_json</code> handles <code>\r</code> as whitespace and ignores it.</li>
<li><code>cargo-deny</code> uses <code>tame-index</code> to parse the index files. The problem here is, that it as well splits the lines at <code>\n</code>, but does not ignore the trailing <code>\r</code>.</li>
</ul>
<p dir="auto">The cached local index, that is maintained by <code>cargo</code> and read by <code>cargo-deny</code>, does contain the index files just as produced by the source index and not the parsed and cleaned versions. This means the additional <code>\r</code> are present in the local cached index.</p>
<p dir="auto">This problem surfaced with the <code>cargo-deny 0.22.0</code> update, that contained an update of <code>tame-index</code>.</p>
<p dir="auto">While the actual problem is a stricter reader on the <code>cargo-deny</code> side, one could argue that ProGet should produce the index files just in the same way, as they provided by the upstream index.</p>
<p dir="auto">This is likely an easy fix on either side. I also created an but report for the <code>tame-index</code> library: <a href="https://github.com/EmbarkStudios/tame-index/issues/129" rel="nofollow ugc">https://github.com/EmbarkStudios/tame-index/issues/129</a></p>
<p dir="auto">For completeness: I am currently running ProGet 2026.14.</p>
<p dir="auto">Best regards,<br />
Martin</p>
]]></description><link>https://forums.inedo.com/topic/5885/cargo-sparse-index-files-are-served-with-crlf-line-endings</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Dec 2026 12:14:14 GMT</lastBuildDate><atom:link href="https://forums.inedo.com/topic/5885.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Dec 2026 06:31:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cargo sparse index files are served with CRLF line endings on Wed, 02 Dec 2026 09:25:31 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/m.karing_2439" aria-label="Profile: m.karing_2439">@<bdi>m.karing_2439</bdi></a>,</p>
<p dir="auto">Thanks for the detailed analysis of this; we investigated this a bit and found that the Cargo book does not seem to specify what line ending to use as this user states. From <a href="https://doc.rust-lang.org/cargo/reference/registry-index.html#index-files" rel="nofollow ugc">https://doc.rust-lang.org/cargo/reference/registry-index.html#index-files</a></p>
<blockquote>
<p dir="auto">Each version of the package has a separate line in the file.</p>
</blockquote>
<p dir="auto">The details are rather.... sparse. While this would be an absolutely trivial change to make on our end, we've learned the hard way that simple changes like this can cause big problems like the feed just breaking. Not too long ago, the smallest change we made to the PyPI API broke the <code>uv</code> client for whatever reason. Anyway.... it's just not something users expect in a maintenance release.</p>
<p dir="auto">We are not CARGO users and don't really know the inner workings of this, and would hate for this to have some kind of weird unexpected outcome. But it "seems" to work now, just not in the <code>cargo-deny 0.22.0</code> (or <code>tame-index</code>) side of things.</p>
<p dir="auto">Since the specification is unclear (and it seems to be a relatively new package), I wonder imagine it's just as trivial of a change for that library to work with both types.</p>
<p dir="auto">Either way, it's something we can easily do in a major release (everyone expects everything to break anyway)... but if it's a challenge to get that changed on the client side, we can also try to explore a maintenance release solution.</p>
<p dir="auto">Thanks,<br />
Alana</p>
]]></description><link>https://forums.inedo.com/post/20255</link><guid isPermaLink="true">https://forums.inedo.com/post/20255</guid><dc:creator><![CDATA[atripp]]></dc:creator><pubDate>Wed, 02 Dec 2026 09:25:31 GMT</pubDate></item></channel></rss>