<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - xvc-config</title>
    <link>https://emresahin.net/tags/xvc-config/</link>
    <description>Posts in the xvc-config tag</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 29 Sep 2026 14:57:43 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/tags/xvc-config/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>devlog 20</title>
      <published>2025-02-01T09:27:50+00:00</published>
      <updated>2025-02-01T09:27:50+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 01 Feb 2025 09:27:50 +0000</pubDate>
      <link>https://emresahin.net/devlog-20/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-20/</guid>
      <description>🐢 We have an error in the publish action. Let’s fix it and rerun it. 🐇 There are two errors. One resulted from forgetting sudo when installing dependencies. The other was the incorrect name for the OpenSSL library. It should be libssl-dev instead of openssl-dev . Maybe we can link the command lis...</description>
      <category>devlog</category>
      <category>xvc</category>
      <category>once-cell</category>
      <category>xvc-config</category>
      <category>xvc-root</category>
      <category>rand</category>
      <category>libssl</category>
      <category>rust</category>
      <category>performance</category>
      <content:encoded><![CDATA[<p>🐢 We have an error in the publish action. Let’s fix it and rerun it.</p>
<p>🐇 There are two errors. One resulted from forgetting <code>sudo</code> when installing
dependencies. The other was the incorrect name for the OpenSSL library. It should be
<code>libssl-dev</code> instead of <code>openssl-dev</code>. Maybe we can link the command list in
the <a href="https://docs.rs/openssl/latest/openssl/#automatic">docs</a>.</p>
<p>🐢 Oops, yes, we should at least keep that in mind.</p>
<p>🐇 I’m checking the most popular crates. <a href="https://docs.rs/getrandom">getrandom</a>
retrieves a random number from the system. It looks much lighter than the <code>rand</code>
crate.</p>
<p>🦊 We can use <a href="https://docs.rs/once_cell">once_cell</a> to initialize
<code>XvcEntityCounter</code>. We currently
<a href="https://github.com/iesahin/xvc/blob/main/ecs/src/ecs/mod.rs#L102">use</a> <code>Once</code>
for this purpose.</p>
<p>🐇 I don’t think it will provide any better features.</p>
<p>🦊 For that case, yes, no better features. But the interface is something like:</p>
<pre><code class="language-rust">impl&lt;T&gt; OnceCell&lt;T&gt; {
    const fn new() -&gt; OnceCell&lt;T&gt; { ... }
    fn set(&amp;self, value: T) -&gt; Result&lt;(), T&gt; { ... }
    fn get(&amp;self) -&gt; Option&lt;&amp;T&gt; { ... }
}</code></pre>
<p>And this makes, for example, working with <code>XvcRoot</code> much easier. We are passing
<code>Arc&lt;RwLock&lt;XvcRootInner&gt;&gt;&gt;</code> everywhere. This is a heavy price when we only use
it in a read-only manner. We can prevent most of these, when we use a <code>read</code> lock, by using
<code>OnceCell</code>.</p>
<p>🐇 <code>XvcConfig</code> can benefit from this as well. We don’t update the config during runs.</p>
<p>🐢 Why do we want to assign it, though? We currently have a <code>config</code> field in
<code>XvcRootInner</code>, and we get a reference to it with the <code>config()</code> method.</p>
<p>🐇 Ok. Let’s skip this for now. No need to worry before measuring the performance impact.</p>]]></content:encoded>
    </item>
    <item>
      <title>devlog 2</title>
      <published>2024-05-26T17:29:09+00:00</published>
      <updated>2024-05-26T17:29:09+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sun, 26 May 2024 17:29:09 +0000</pubDate>
      <link>https://emresahin.net/devlog-2/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-2/</guid>
      <description>We were debugging Python bindings for Xvc. xvc.file.track enters an infinite loop when given a non-existent path. To make debugging easier, we can add file deletions in the ./start-readme script to the notebook itself. Instead, I’ll run my watcher run-after-commit.sh to ensure that the files are ...</description>
      <category>devlog</category>
      <category>xvc</category>
      <category>xvc</category>
      <category>jupyter</category>
      <category>xvc-config</category>
      <category>xvc-file</category>
      <category>repr</category>
      <category>python-bindings</category>
      <category>debugging</category>
      <content:encoded><![CDATA[<p>We were debugging Python bindings for Xvc. <code>xvc.file.track</code> enters an infinite
loop when given a non-existent path.</p>
<p>To make debugging easier, we can add file deletions in the <code>./start-readme</code> script
to the notebook itself.</p>
<p>Instead, I’ll run my watcher <code>run-after-commit.sh</code> to ensure that the files
are deleted after commits.</p>
<p>That may also work; you can use both as well.</p>
<p>I noticed cli-opts pass <code>--no-system-config</code> etc. by default. Let’s deal with
this first.</p>
<p>I fixed that.</p>
<p>I’m testing whether we are in the directory that we should be in with
<code>xvc.root("--absolute")</code>, but it looks like it’s not possible to pass a string
argument to the command.</p>
<p>Let me take a look at this.</p>
<p>It looks like there have been some changes in optional parameter handling in PyO3.
You may need to deal with keyword arguments with decorators.</p>
<p>Now, let’s try <code>xvc.file().track()</code> once more with <code>dir-0001/</code>.</p>
<p>It seems to be working now. With an existing directory, it doesn’t show an
error.</p>
<p>What does <code>xvc.file().list()</code> show?</p>
<p>It shows a single string with <code>\n</code> in it. It looks like we need to handle this in
the output thread.</p>
<p>I added a <code>replace("\\n", "\n")</code> to <code>output_str</code> at the end, but it didn’t make a
difference. I tested in the notebook with <code>list_result.split("\n")</code>, and these
<code>\n</code> characters are indeed CRLF. So Jupyter shows CRLF in strings with <code>\n</code>, and
this is not something we should try to fix, I think.</p>
<p>You can search how to show <code>\n</code> characters in a Jupyter notebook with CRLF.</p>
<p>The output string should be fed into <code>repr</code>, as in:</p>
<pre><code class="language-python"># Define a string with CRLF characters
text_crlf = "Hello\r\nWorld\r\nThis is a test string."

# Use repr to show the \r\n characters explicitly
print(repr(text_crlf))
</code></pre>
<p>I tested this, and GPT misleads. <code>repr</code> is when you <em>want</em> to show <code>\n</code>, not
vice versa. When I <code>print(list_result)</code>, it prints the results properly.</p>
<p>It looks like we don’t need to make this a priority now. We can tell the user in the
notebook that the commands are intentionally returning strings, and they can
process or print them however they want.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
