<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bloggy</title>
	<atom:link href="http://www.purinchu.net/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.purinchu.net/wp</link>
	<description>The answer to life, the universe, and everything</description>
	<lastBuildDate>Sun, 10 Feb 2013 18:40:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Filtering out KDE Projects modules in kdesrc-build</title>
		<link>http://www.purinchu.net/wp/2013/02/10/filtering-out-kde-projects-modules-in-kdesrc-build/</link>
		<comments>http://www.purinchu.net/wp/2013/02/10/filtering-out-kde-projects-modules-in-kdesrc-build/#comments</comments>
		<pubDate>Sun, 10 Feb 2013 18:40:07 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[kdesvn-build]]></category>
		<category><![CDATA[kde-projects]]></category>
		<category><![CDATA[kdesrc-build]]></category>
		<category><![CDATA[module filtering]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=763</guid>
		<description><![CDATA[So I implemented support last night for a way to filter out modules from a build from a module-set using the KDE Projects database. The issue is pretty simple. Let&#8217;s say that you wanted to build the KDE Multimedia module, with the exception of JuK (maybe you prefer the Amarok or Tomahawk music players). To [...]]]></description>
				<content:encoded><![CDATA[<p>So I implemented support last night for a way to filter <em>out</em> modules from a build from a module-set using the KDE Projects database.</p>
<p>The issue is pretty simple. Let&#8217;s say that you wanted to build the KDE Multimedia module, with the exception of <a title="KDE Multimedia – JuK" href="http://www.kde.org/applications/multimedia/juk/" target="_blank">JuK</a> (maybe you prefer the <a title="Amarok Homepage" href="http://amarok.kde.org/" target="_blank">Amarok</a> or <a title="Tomahawk Player Homepage" href="http://www.tomahawk-player.org/" target="_blank">Tomahawk</a> music players).</p>
<p>To do this before this new feature was implemented, you would have to list each <em>sub</em> module of KDE Multimedia, which means visiting the <a title="KDE Projects – KDE Multimedia" href="https://projects.kde.org/projects/kde/kdemultimedia" target="_blank">KDE Projects</a> website, or using some of the developer tools scripts to parse out the KDE Projects database, and then typing that into your .kdesrc‑buildrc. Plus, you&#8217;d have to redo this periodically in case a new application or library was added to the KDE Multimedia grouping.</p>
<p>Now, you can simply say that you want all of KDE Multimedia <em>except</em> JuK:</p>
<pre>module-set kdemultimedia
    repository kde-projects
    use-modules kdemultimedia
    ignore-modules juk
end module-set</pre>
<p>I&#8217;ve also updated the <a title="kdesrc-build Documentation" href="http://kdesrc-build.kde.org/documentation/" target="_blank">kdesrc-build documentation</a> to document the new <a title="kdesrc-build ignore-modules option documentation" href="http://kdesrc-build.kde.org/documentation/conf-options-table.html#conf-ignore-modules" target="_blank">ignore-modules</a> option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2013/02/10/filtering-out-kde-projects-modules-in-kdesrc-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JuK Supports Opus Codec (sort of)</title>
		<link>http://www.purinchu.net/wp/2013/01/06/juk-supports-opus-codec-sort-of/</link>
		<comments>http://www.purinchu.net/wp/2013/01/06/juk-supports-opus-codec-sort-of/#comments</comments>
		<pubDate>Sun, 06 Jan 2013 17:03:55 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gstreamer]]></category>
		<category><![CDATA[juk]]></category>
		<category><![CDATA[opus]]></category>
		<category><![CDATA[phonon]]></category>
		<category><![CDATA[taglib]]></category>
		<category><![CDATA[vlc]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=758</guid>
		<description><![CDATA[I just wanted to drop a quick note that JuK, the KDE music tagger/player component of the KDE Multimedia Software Compilation, now supports playback and limited metadata editing of Ogg Opus audio files. This requires support from some underlying libraries: The Taglib library must support Ogg Opus audio to add the track to your JuK [...]]]></description>
				<content:encoded><![CDATA[<p>I just wanted to drop a quick note that JuK, the KDE music tagger/player component of the KDE Multimedia Software Compilation, now supports playback and limited metadata editing of Ogg <a title="Link to Opus Codec webpage" href="http://www.opus-codec.org/">Opus</a> audio files.</p>
<p>This requires support from some underlying libraries:</p>
<ul>
<li>The <a href="https://github.com/taglib/taglib">Taglib</a> library <em>must</em> support Ogg Opus audio to add the track to your JuK collection at all. At this stage JuK can&#8217;t load a file to play if Taglib doesn&#8217;t support it, even if the playback system (Phonon) would otherwise support it. Taglib also provides the metadata reading/editing so our support is only as good as that provided by Taglib. For instance, the bitrates all show as 0kbps for my current encodes. Taglib only supports Opus in git as far as I can tell, so JuK uses configuration checks to see if Taglib supports Opus. JuK will still compile if Taglib doesn&#8217;t have Opus support.</li>
<li>To actually playback Opus audio, Phonon must support playback. Practically speaking this means your <a href="http://userbase.kde.org/Phonon">Phonon</a> backend (<a href="http://martinsandsmark.wordpress.com/2012/08/11/phonon-vlc-0-6-released/">VLC</a>, or <a href="http://wm161.net/2012/08/13/phonon-gstreamer-4-6-2/">gstreamer</a>, normally) must support Opus playback. Both underlying libraries already have releases (<a href="http://www.videolan.org/vlc/">VLC 2.0.4</a> or later; gst-plugins-bad) supporting Opus so this shouldn&#8217;t be too hard.</li>
</ul>
<p>One caveat is that I&#8217;m not sure what mimetype will eventually end up being used in shared-mime-data for Ogg Opus audio (probably <code>audio/x-opus+ogg</code> or <code>audio/opus+ogg</code>). At this point Ogg Opus audio gets detected as <code>audio/ogg</code> so I simply check for .opus extension if this fallback mimetype is identified.</p>
<p>In case it&#8217;s not clear from my writing &#8220;Ogg Opus&#8221; everywhere instead of just Opus, JuK currently does not support Opus audio in other container formats (such as Matroska). However the Opus standard recommends using Ogg as the container for purposes of storing audio as files so this should be how you encounter Opus files in practice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2013/01/06/juk-supports-opus-codec-sort-of/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Review request: kdesrc-build login session script</title>
		<link>http://www.purinchu.net/wp/2012/11/11/review-request-kdesrc-build-login-session-script/</link>
		<comments>http://www.purinchu.net/wp/2012/11/11/review-request-kdesrc-build-login-session-script/#comments</comments>
		<pubDate>Sun, 11 Nov 2012 05:30:32 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[kdesvn-build]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Review Requests]]></category>
		<category><![CDATA[kdesrc-build]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[review request]]></category>
		<category><![CDATA[xsession]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=753</guid>
		<description><![CDATA[One of the long-standing desirable improvements that I&#8217;ve wanted for kdesrc-build is to automatically make it easy to login to the newly-built-from-source desktop. In fact, this is item 5 on my current ROADMAP included with the kdesrc-build source. The issue, of course, is that it is often nowhere near good enough to compile and install a [...]]]></description>
				<content:encoded><![CDATA[<p>One of the long-standing desirable improvements that I&#8217;ve wanted for <a href="http://kdesrc-build.kde.org/" target="_blank">kdesrc-build</a> is to automatically make it easy to login to the newly-built-from-source desktop. In fact, this is item 5 on my current ROADMAP included with the kdesrc-build source.</p>
<p>The issue, of course, is that it is often nowhere near good enough to compile and install a recently-compiled KDE if your distribution can&#8217;t be bothered to actually use it!</p>
<h3>Why It&#8217;s Difficult:</h3>
<p>Unfortunately there are many different environment variables that need to be set (e.g. <code>PATH</code>, <code>LD_LIBRARY_PATH</code> (on Linux and perhaps some BSDs?), <code>XDG_DATA_DIRS</code>, etc.), in order to inform the shell,  operating system, utilities, and even KDE itself that you want to use programs and libraries installed to alternate locations instead of places like <code>/usr</code> and <code>/bin</code>.</p>
<p>Additionally, there are environment variables that should be set on top of that to support the development of further KDE software to automatically use the KDE libraries that were just installed, which needs environment variables like <code>PKG_CONFIG_PATH</code> (and even things like <code>MANPATH</code>).</p>
<p>There are a surprising number of issues that go into solving this problem:<span id="more-753"></span></p>
<ul>
<li>Alternative shell users. I&#8217;m not talking about taking advantage of advanced <a href="https://github.com/robbyrussell/oh-my-zsh" target="_blank">Oh My ZSH</a> hackery, but it&#8217;s a fact that some distros use &#8220;lite&#8221; shells like ASH as /bin/sh (and Busybox&#8217;s /bin/sh is even more restrictive), so we need to be careful about what shell features are used.</li>
<li>Different shell types. In other words, how do we support all of: Login shells, &#8220;interactive&#8221; non-login shells, and non-login shell scripts that should have the same KDE environment variable settings?</li>
<li>Different login managers. How do we support users using LightDM, KDM, GDM, etc.?</li>
<li>Are we using system-provided Qt, or self-compiled Qt?</li>
<li>How does the user customize the result? All too often you see config files with large &#8220;THIS IS AUTO-GENERATED, DO NOT EDIT&#8221; warnings, how do we allow for user customization?</li>
<li>Data flow direction. Normally kdesrc-build feeds build parameters into CMake (or whatever the build system is) and not the other way around. But to setup session support right we need to know (or assume&#8230;) where the software was installed. Sometimes it is difficult to assume, for example do you know how to determine which path is correct between <code>$prefix/lib</code>, <code>$prefix/lib32</code>, <code>$prefix/lib64</code> on any given system? CMake normally figures this out, not kdesrc-build! ;)</li>
</ul>
<h3>Development Work</h3>
<p>I was discussing this some months ago with Michael Jansen, developer of the wonderful Ruby script <a href="http://michael-jansen.biz/build-tool/" target="_blank">build-tool</a>, and he graciously provided me with some sample login-support files which I started working in earnest on a couple of weeks ago. By last week I had a solution which I think will meet the requirements of most without tripping over too many of the issues I mentioned. This solution is being developed in kdesrc-build&#8217;s <a href="http://quickgit.kde.org/?p=kdesrc-build.git&amp;a=shortlog&amp;h=xsession-support" target="_blank">xsession-support branch</a>.</p>
<h3>The Design</h3>
<p>What I&#8217;ve chosen to do is to handle the &#8220;common case&#8221;&#8230; that is, a user logging in from a graphical login manager and installing their kdesrc-build KDE to a given user account (if I&#8217;m doing it right this can in theory even be the same user account used with a system KDE installation, but you shouldn&#8217;t assume I&#8217;m doing it right! ;).</p>
<p>There are many ways to support a login manager. One of the ancient, time-honored methods is for the login manager to detect the presence of a shell script called <code>.xsession</code> in the user&#8217;s home directory, and to allow the user to run this script to setup the rest of the login session. In KDM, this is what the &#8220;Custom&#8221; session setting does. In GDM it seems to be called &#8220;Default System Session&#8221;, at least on <a href="https://wiki.ubuntu.com/CustomXSession#How_to_create_a_X_session_script" target="_blank">Ubuntu</a> (although that description&#8217;s not quite accurate). Also, Fedora at least requires you to <a href="https://bugzilla.redhat.com/show_bug.cgi?id=447910" target="_blank">install an additional package</a> for GDM (and who knows, maybe KDM too) to obey <code>~/.xsession</code> scripts.</p>
<p>So as you can tell from the end of that last paragraph, <code>~/.xsession</code> doesn&#8217;t seem to be the preferred mode of operation for modern login managers. Instead, they search for Desktop Entry files describing a session in the data directory <code>share/xsessions</code> (e.g. <code>/usr/share/xsessions</code>). Unfortunately this directory is obviously only accessible to root, so it would require special permissions to add a session type. But in any event, you still end up running a custom script, the Desktop Entry simply adds a layer of indirection (and allows you to set a custom name, description, etc. in the login manager).</p>
<p>So, the big picture objective I&#8217;ve decided on so far is to make the <code>~/.xsession</code> approach work&#8230; if it works, it works without needing root permissions. And even if it doesn&#8217;t work immediately, we can simply make our new entry in <code>share/xsessions</code> point back to the <code>~/.xsession</code> without having to duplicate the hard work (and in some distros &#8220;making it work&#8221; is as sample as installing an additional package).</p>
<h4>Making xsession work</h4>
<p>Of course this merely punts the problem down the road a little bit&#8230; how do we make <code>~/.xsession</code> work?</p>
<p>The problem essentially comes down to, figure out what is &#8220;custom&#8221; about the installed KDE (e.g. what was its install prefix, what prefix are we using for Qt), use that to set the needed environment variables to the right value, and then kick off the KDE startup script (<code>startkde</code>) with the environment already set. Oh, and do all this while allowing for user customizations.</p>
<p>My first attempt had this all as a single <code>.xsession</code> file, but this isn&#8217;t ideal (as pointed out by the indomitable David Faure). The reason it is not ideal is because all of our environment variable settings will also be needed for non-login shells within the logged-in desktop, and those shells can&#8217;t source <code>~/.xsession</code> again without trying to start a KDE-within-a-KDE. Additionally, the <code>.xsession</code> would have to change any time the user wanted to edit a setting, which introduces the difficult problem of how to allow kdesrc-build to update auto-generated parts of the file while retaining user changes.</p>
<p>So, the next round split the <code>.xsession</code> into 2 auto-generated files, <code>~/.kde-env-master.sh</code> and <code>~/.xsession</code>. Now the profile setup for interactive non-login shells could use <code>~/.kde-env-master.sh</code> without worrying about accidentally trying to start another session. Unfortunately, this didn&#8217;t solve the problem of user customizations.</p>
<p>So, my more recent try split the <code>~/.kde-env-master.sh</code> further, into a &#8220;user&#8217;s playground&#8221; and &#8220;kdesrc-build owned&#8221; bisection. kdesrc-build will install a sample user-settings file to <code>~/.kde-env-user.sh</code> and will not touch it again from there. <code>~/.xsession</code> and <code>~/.kde-env-master.sh</code> will continue to be tracked by kdesrc-build (using MD5 sums) which allows for kdesrc-build to easily be able to install bugfixed versions of those two (e.g. as new environment variables become required, such as <code>QML_IMPORT_PATH</code>).</p>
<p>Obviously I try to take pains to ensure that existing <code>.xsession</code> and <code>.kde-env-master.sh</code> files ($DEITY forbid) are not overwritten, (but this leads to complaining in the xsession-support version of kdesrc-build if existing files are in the way).</p>
<h4>Solving the other problems</h4>
<p>Of course, I mentioned other problems. How did I work-around or solve them?</p>
<ul>
<li><strong><em>Alternative shell users</em></strong>. I use Busybox <code>/bin/sh</code> and Ash for testing. As it turns out, &#8220;<code>source</code>&#8221; is a complete Bash-ism, and you really shouldn&#8217;t use the &#8220;<code>function</code>&#8221; keyword in portable shell either. It&#8217;s also more well-known that you should <code>export</code> environment variables as a separate step in portable shell. I also have included testing support in the test suite to syntax-check the shell code (and I also try to manually run those tests with the alternate shells I mentioned earlier). Another difficulty was making a &#8220;path_add&#8221; function that works in portable shell.</li>
<li><em><strong>Different shell types</strong></em>. Already covered, we split the different functions (environment setup, user customization, session login) into different scripts.</li>
<li><strong><em>Different login managers</em></strong>. As long as the login manager supports <code>~/.xsession</code> (the &#8220;traditional&#8221; way) you&#8217;re already set. More work is needed to support login managers that <em><strong>only</strong></em> support share/xsessions Desktop Entries.</li>
<li><em><strong>Are we using system-provided Qt, or self-compiled Qt</strong></em>? The shell code is setup so that if the Qt directory is not set by kdesrc-build, it will automatically try to find a system Qt and ensure it&#8217;s added to the <code>PATH</code> and rest of environment if necessary (in fact this is probably overkill since it should be all rights already be in the system environment).</li>
<li><em><strong>How does the user customize the result?</strong></em> The aforementioned <code>~/.kde-env-user.sh</code>. My late draft work on this also supported user-custom scripts run just before session start and just after session end, but KDE supports that natively so I will remove that capability to avoid (even more) debugging insanity.</li>
<li><em><strong>Data flow direction.</strong></em> The sample script tries to figure out the library directory &#8220;bit suffix&#8221; (if any) if the user doesn&#8217;t set it, by asking the installed <code>kde4-config</code>. kdesrc-build only needs to fill in where Qt and/or KDE were installed to.</li>
</ul>
<h2>Help I need</h2>
<p>At this stage, I essentially need people to actually test being able to login using this scheme. This would be helpful even if you don&#8217;t use kdesrc-build (but you&#8217;d need to fill in the KDE prefix and Qt prefix yourself in that case). <span style="text-decoration: underline;">Don&#8217;t forget to make <code>~/.xsession</code> executable if you decide to install it manually</span>, otherwise the session won&#8217;t work at all (Yep, it caught me&#8230; ;)</p>
<p>Any advice on how to setup current login managers for &#8220;user-custom&#8221; sessions without having to trawl around in <code>/usr/share/xsessions</code> would be appreciated as well.</p>
<p>Also, for those who like writing documentation (or might like it), I wouldn&#8217;t mind someone donating rewritten documention for the &#8220;<a href="http://kdesrc-build.kde.org/documentation/environment.html" target="_blank">Setting the Environment</a>&#8221; section&#8230; :)</p>
<p>You can find kdesrc-build by checking it out from KDE&#8217;s git repository (<code>git clone git://anongit.kde.org/kdesrc-build</code>)&#8230; the code I&#8217;m talking about is in the xsession-support branch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2012/11/11/review-request-kdesrc-build-login-session-script/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>kdesrc-build supports subversion 1.7</title>
		<link>http://www.purinchu.net/wp/2012/08/04/kdesrc-build-supports-subversion-1-7/</link>
		<comments>http://www.purinchu.net/wp/2012/08/04/kdesrc-build-supports-subversion-1-7/#comments</comments>
		<pubDate>Sat, 04 Aug 2012 21:51:47 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[kdesvn-build]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[kdesrc-build]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=745</guid>
		<description><![CDATA[So the most recent major release of the Subversion source control software used for some KDE modules is version 1.7, released waaay back in October 2011. It turns out that 1.7 uses a different on-disk format (which centralizes all the metadata to a single .svn directory among many other things). Also, that on-disk format doesn&#8217;t [...]]]></description>
				<content:encoded><![CDATA[<p>So the most recent major release of the <a href="http://subversion.apache.org/">Subversion</a> source control software used for some KDE modules is version 1.7, released waaay back in October 2011.</p>
<p>It turns out that 1.7 uses a different on-disk format (which centralizes all the metadata to a single <code>.svn</code> directory among many other things). Also, that on-disk format doesn&#8217;t get automatically upgraded, but instead you must run a <code>svn upgrade</code> command manually (but just once).</p>
<p>I had somehow managed to avoid 1.7 by accident so I was pretty shocked to see a <a href="https://bugs.kde.org/show_bug.cgi?id=304415">kdesrc-build bug</a> get reported about this &#8212; it was news to me!</p>
<p>Now that I&#8217;ve had time to look at it svn 1.7 should work just fine, kdesrc-build will try to run the required command if svn says it&#8217;s necessary. If an error occurs and you don&#8217;t have local patches you should just delete the affected source directory and let kdesrc-build check it out again. The updated kdesrc-build is only <a href="https://projects.kde.org/projects/extragear/utils/kdesrc-build/repository/revisions/9a7a4d6330fa247e5cd57ea8e196b26229f34222">in git-master</a> for now though.</p>
<p>But be careful, there&#8217;s no way to run <code>svn diff</code> with svn-1.7 against an older working copy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2012/08/04/kdesrc-build-supports-subversion-1-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KSharedDataCache debugging</title>
		<link>http://www.purinchu.net/wp/2012/06/16/kshareddatacache-debugging/</link>
		<comments>http://www.purinchu.net/wp/2012/06/16/kshareddatacache-debugging/#comments</comments>
		<pubDate>Sat, 16 Jun 2012 20:58:20 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[Implementing KSharedDataCache]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[kshareddatacache]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=738</guid>
		<description><![CDATA[I was approached the other day by an Amarok developer who was receiving a lot of debug output from KImageCache (which uses my KSharedDataCache). When the cache was nearly full he was starting to receive a lot of messages about being &#8220;Unable to free up memory for&#8221; each entry. He caught up with me on [...]]]></description>
				<content:encoded><![CDATA[<p>I was approached the other day by an Amarok developer who was receiving a lot of debug output from KImageCache (which uses my KSharedDataCache). When the cache was nearly full he was starting to receive a lot of messages about being &#8220;Unable to free up memory for&#8221; each entry.</p>
<p>He caught up with me on IRC and I pointed him to where the error message was from (which he had already found) and then explained what the logic was supposed to be inside of that function. Unfortunately I wasn&#8217;t able to be more helpful but I did leave with some tips about how I would debug it.</p>
<p>Probably half the time I get reports like this that&#8217;s where the matter is left. So I was surprised when I logged into IRC the next day that the dev was still looking into it! He had taken the steps I had suggested (including having to adapt it to his installation) and was able to verify that the KSharedDataCache was not finding free pages even though there should have been room available.</p>
<p>This meant that either the record-keeping was corrupted somewhere (which is bad), or that there was a problem in the function to find free pages. My contribution this day was limited to more debugging suggestions (pre-filling the cache to reproduce quickly), and more advice on what some auxiliary functions were doing. Oh, and the recommendation to check cache consistency (and when to do it) to flag immediately when the problem occurs.</p>
<p>And the next day, he had identified the problem and <a href="http://quickgit.kde.org/index.php?p=kdelibs.git&#038;a=commit&#038;h=91a95c89f520e934017383d4b8cf7e0ba53675a4">made a fix</a>! As it turned out, I wasn&#8217;t searching the last <em>n</em> pages of the cache (where <em>n</em> is the number of pages needed to hold the entry to be inserted). So this problem could only occur when the cache was nearly full, or would be nearly full after the entry is added (since we defragment the cache first in this situation).</p>
<p>So thanks to Sam for sticking with the debugging! The fix will be in the next routine release of kdelibs (probably first week of July).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2012/06/16/kshareddatacache-debugging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The future of kdesrc-build</title>
		<link>http://www.purinchu.net/wp/2012/05/06/the-future-of-kdesrc-build/</link>
		<comments>http://www.purinchu.net/wp/2012/05/06/the-future-of-kdesrc-build/#comments</comments>
		<pubDate>Sun, 06 May 2012 16:07:50 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[kdesvn-build]]></category>
		<category><![CDATA[kdesrc-build]]></category>
		<category><![CDATA[roadmap]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=734</guid>
		<description><![CDATA[As I hinted at in my recent post, it&#8217;s time for me to genuflect a bit on kdesrc-build &#8220;going forward&#8221;: The idea for me, from the time I first submitted kdecvs-build to kdesdk way back in the day, was to make it as easy as possible to build the current/bleeding-edge editions of KDE, both to [...]]]></description>
				<content:encoded><![CDATA[<p>As I hinted at in <a href="/wp/2012/05/06/kdesrc-build-1-15/" title="kdesrc-build 1.15">my recent post</a>, it&#8217;s time for me to genuflect a bit on kdesrc-build &#8220;going forward&#8221;:</p>
<p>The idea for me, from the time I first submitted kdecvs-build to <code>kdesdk</code> way back in the day, was to make it as easy as possible to build the current/bleeding-edge editions of KDE, both to support KDE developers and to support testing from &#8220;power users&#8221;.</p>
<p>Over the years the software has adapted to the shift to SVN, the KDE 3->4 migration, the partial shift to Git, followed by the introduction of KDE Project infrastructure. Although I&#8217;m biased I believe it&#8217;s been useful in its intended purpose. So where do we go from here? I&#8217;ll just submit my current &#8220;road map&#8221; for comment and leave you all with a request&#8230;</p>
<h3>The Roadmap</h3>
<ul>
<li>Add support for Qt 5. The changes to support not needing a module called &#8220;qt-copy&#8221; were the first step, now we must make the changes necessary to build the multiple Qt repositories that comprise Qt 5.</li>
<li>Continue the relentless (and sometimes painful) push to refactor the code. This has already achieved big positives in the new support for <code>bzr</code> and the <code>qmake</code> build system, but we need to go further to support other items, like:</li>
<li>An expanded test suite. Although I&#8217;ve had less &#8220;brown bag&#8221; releases than in 2003-2005, I still have commits that land in git that I have to have users note break things for them. There is a test suite, but much of the code is hard to test because it&#8217;s intertwined together (which will be improved by refactoring).</li>
<li>And finally, a lot of changes to continue to make it easier to run a bleeding-edge desktop:
<ul>
<li>Continue to improve the <a href="http://kdesrc-build.kde.org/documentation/">documentation</a>.</li>
<li>Generate needed session-setup files for the user (<code>.bashrc</code>, <code>.xsession</code>, etc.). Don&#8217;t make the user have to copy a .bashrc somewhere.</li>
<li>A script to run the distro-specific commands necessary to install the <a href="http://techbase.kde.org/Getting_Started/Build/Distributions">prerequisites</a>.</li>
</ul>
</li>
</ul>
<p>So my big question to you all is: Where are you going for documentation? What would you prefer? Currently the documentation quickly gets out-of-date. I&#8217;m quite willing to host it on <a href="http://userbase.kde.org/">UserBase</a> instead if that&#8217;s easier, and the KDE documentation team is quite willing to support that as well. But I hardly have time to work on the program, let alone the documentation for it, so there would need to be some kind volunteers to occasionally go through and make sure the advice still makes sense.</p>
<p>Another question I have is: How recent a Perl do you all run? I have tried hard through the years to ensure that kdesrc-build dependencies are quite minimal (right now just Perl 5.10, libwww-perl, and XML::Parser). It would be nice to utilize some common but non-core Perl modules (which I don&#8217;t think is unfair, given that we&#8217;re talking about staying on the &#8220;bleeding-edge&#8221; anyways).</p>
<p>Finally, how tied are people to the &#8220;single-file kdesrc-build&#8221; concept? Right now kdesrc-build requires essentially no separate installation step because it&#8217;s just a single file. Would making the single file be a simple wrapper around &#8220;git clone-or-pull kde:kdesrc-build-modules ; $srcdir/kdesrc-build-modules/start $args&#8221; be too annoying?</p>
<p>The most important question is the documentation one though&#8230; the steps needed to build KDE change frequently enough that the docs should be really good, and I have not done a good job at that. :-( I&#8217;m open to suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2012/05/06/the-future-of-kdesrc-build/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>kdesrc-build 1.15</title>
		<link>http://www.purinchu.net/wp/2012/05/06/kdesrc-build-1-15/</link>
		<comments>http://www.purinchu.net/wp/2012/05/06/kdesrc-build-1-15/#comments</comments>
		<pubDate>Sun, 06 May 2012 15:33:18 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[kdesvn-build]]></category>
		<category><![CDATA[kdesrc-build]]></category>
		<category><![CDATA[kdesrc-build release]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=729</guid>
		<description><![CDATA[So I&#8217;ve released kdesrc-build 1.15 yesterday. There are lots of bugfixes and some minor features since 1.14.1. (I ended up skipping 1.14.2 despite some FIXED-IN: entries that claim otherwise). You should read the release page if you want the full details (or just git shortlog v1.14.1..v1.15 ;). A brief summary of the changes would be: [...]]]></description>
				<content:encoded><![CDATA[<p>So I&#8217;ve <a href="http://kdesrc-build.kde.org/releases/kdesrc-build-1.15.php">released kdesrc-build 1.15</a> yesterday. There are lots of bugfixes and some minor features since 1.14.1. (I ended up skipping 1.14.2 despite some FIXED-IN: entries that claim otherwise).</p>
<p>You should read the release page if you want the full details (or just <code>git shortlog v1.14.1..v1.15</code> ;). A brief summary of the changes would be:</p>
<ul>
<li>kdesrc-build takes advantage of some elements of the <code><a href="https://projects.kde.org/projects/kde-build-metadata">kde-build-metadata</a></code> repository. Specifically:
<ul>
<li>
<p><code>dependency-data</code> is utilized to re-order <code>kde-projects</code> modules if necessary. This applies even to the order you give in your configuration file, but is probably most useful for modules that are automatically grouped until modules you&#8217;ve requested. For example, with the newly-converted <code><a href="https://projects.kde.org/projects/kde/kdemultimedia">kdemultimedia</a></code> module, this feature allows kdesrc-build to still know to build the libraries <code>libkcddb</code> and <code>libkcompactdisc</code> before building <code>kscd</code> (without you having to mention that order yourself).</p>
<p>It is <em>important to note</em> that this relies on the dependency data actually being accurate. If you&#8217;re a KDE developer who develops modules in the KDE Project infrastructure you can update the dependency data yourself, just checkout <code>kde-build-metadata</code> and make your fixes. Just make sure that you only mark dependencies between modules in the KDE Project database at this point, there&#8217;s no way to depend on a generic git repository.</p>
</li>
<li>Also supported is a listing of KDE Projects for kdesrc-build to ignore. This is mostly for things like websites which are tracked in <code>kde-projects</code> but can&#8217;t be built. If you see that kdesrc-build is trying to be a KDE Project that can&#8217;t be built then please add it to <code>kde-build-metadata/build-script-ignore</code>.</li>
</ul>
</li>
<li>Building and installing l10n packages (from SVN) works again. Sorry, non-en_US users for leaving that broken for so long.</li>
<li>kdesrc-build doesn&#8217;t re-download the entire KDE Project database if it hasn&#8217;t changed.</li>
<li>Modules on the command line with no matching entry in the configuration file is no longer automatically an error. Instead it is assumed to be a module from <code>kde-projects</code>. An error is still raised if that ends up not being the case after looking up the database, but this allows for a quick-and-easy one-shot install of modules from <code>kde-projects</code> (especially if the dependency data is correct&#8230; ;)</li>
<li>In a similar vein (to allow for one-shot installs), the qmake build system is now (partially) supported.</li>
<li>&#8220;<code>qt-copy</code>&#8221; is no longer special-cased. You can built Qt from any module name now.</li>
<li>Aurélien Gâteau added support for <a href="http://bazaar.canonical.com/">Bazaar SCM</a> (to allow building <code>libdbusmenu-qt</code>.</li>
</ul>
<p>Many of these features required some ongoing refactoring of the code so if I&#8217;ve broken something please let me know.</p>
<p>If kdesrc-build has been working for you at all you&#8217;ve probably been using it from <a href="http://quickgit.kde.org/index.php?p=kdesrc-build.git">its git repository</a> so you probably wouldn&#8217;t notice much change. I&#8217;m mostly making the release for the benefit of distribution packagers and in order to mark off a mostly-stable spot before I start diving into the <a href="http://quickgit.kde.org/index.php?p=kdesrc-build.git&#038;a=blob&#038;h=8a04ecc161892d17fc59d0ecd949d377932649cc&#038;hb=2cd364ad90f029e84a1f9175c9b1de1ddff10cfa&#038;f=ROADMAP">new roadmap</a> I&#8217;ve posted to the source folder.</p>
<p>On that note, looking forward to the future there are some questions I want to put out, but that will be a separate blog post&#8230; enjoy the new release in the meantime!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2012/05/06/kdesrc-build-1-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim tip: Finding differences without separate files</title>
		<link>http://www.purinchu.net/wp/2011/11/11/vim-tip-finding-differences-without-separate-files/</link>
		<comments>http://www.purinchu.net/wp/2011/11/11/vim-tip-finding-differences-without-separate-files/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 01:19:29 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[Computing Troubles]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Useful Tricks]]></category>
		<category><![CDATA[diff finding]]></category>
		<category><![CDATA[Test::More]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=722</guid>
		<description><![CDATA[While debugging a failure in the kdesrc-build test suite after a fairly extensive series of refactorings, I ended up with an object hierarchy which was different from a different hierarchy&#8230; but different where? The obvious solution is to use something like Test::More&#8217;s is_deeply test, which displays the places where the two structures are different. Unfortunately [...]]]></description>
				<content:encoded><![CDATA[<p>While debugging a failure in the kdesrc-build test suite after a fairly extensive series of refactorings, I ended up with an object hierarchy which was different from a different hierarchy&#8230; but different where?</p>
<p>The obvious solution is to use something like <a href="http://search.cpan.org/~mschwern/Test-Simple/lib/Test/More.pm#Complex_data_structures">Test::More&#8217;s is_deeply</a> test, which displays the places where the two structures are different.</p>
<p>Unfortunately it reported that the two structures were identical (although in fairness I checked just now and it&#8217;s an older version from 2009, there&#8217;s been several bugfixes in the function since which probably close this&#8230; assuming I was using the method right).</p>
<p>The other quick-and-dirty debugging method I use is to simply dump the structure to the output using something like <a href="http://search.cpan.org/~smueller/Data-Dumper-2.131/Dumper.pm">Data::Dumper</a>.</p>
<p>Unfortunately it&#8217;s not easy to &#8220;spot the difference&#8221; in two consecutive Data::Dumper outputs of nearly-identical structures. That is where Vim came in to save my day.</p>
<p>I think most Vim users already know about the <tt>vimdiff</tt> mode which helps significantly with applying patches to files, but what if you don&#8217;t have a file to work on? In my case I was dealing with Konsole output. Of course I could cut-and-paste that output to different files and then run vimdiff, but that&#8217;s annoying (what if I forget to unlink the files when I&#8217;m done, what to name them?, etc.).</p>
<p>Instead I dumped all of the output into a Vim window, then used <tt>:vnew</tt> to open a new buffer and window. Afterwards I moved the second output block to the new window and cleaned up the leading and trailing empty lines.</p>
<p>The only thing left to do is put Vim in its diff mode, and that is done using <tt>:diffthis</tt>, which gave me the following (click to enlarge):</p>
<p><center><a href="/images/vimdiffthis.png"><img src="/images/vimdiffthis-sm.png" width="480" height="225" alt="Screenshot of a vim window displaying only differences between two different buffers"/></a></center></p>
<p>This makes it <em>much</em> easier to find the bug, and is very easy to accomplish quickly. Perhaps you&#8217;ll find it useful at some point as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2011/11/11/vim-tip-finding-differences-without-separate-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tracking down a library bug</title>
		<link>http://www.purinchu.net/wp/2011/10/16/tracking-down-a-library-bug/</link>
		<comments>http://www.purinchu.net/wp/2011/10/16/tracking-down-a-library-bug/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 03:08:49 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[Computing Troubles]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Useful Tricks]]></category>
		<category><![CDATA[abi]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[kdesrc-build]]></category>
		<category><![CDATA[nm]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=715</guid>
		<description><![CDATA[So today I had noticed I had build failures in quite a few modules that were based on errors linking to libkipi, involving undefined references to KIPI::ImageInfoShared::~ImageInfoShared(). Normally fixing this is as easy as ensuring that the library which provides the symbol has been updated, built, and installed and then running kdesrc-build --refresh-build on the [...]]]></description>
				<content:encoded><![CDATA[<p>So today I had noticed I had build failures in quite a few modules that were based on errors linking to libkipi, involving undefined references to <code>KIPI::ImageInfoShared::~ImageInfoShared()</code>.</p>
<p>Normally fixing this is as easy as ensuring that the library which provides the symbol has been updated, built, and installed and then running <code>kdesrc-build --refresh-build</code> on the modules that had failed. In this case it didn&#8217;t work though. Hmm&#8230;</p>
<p>Looking at my <code>log/latest/gwenview/error.log</code> showed that it was the same build failure, so I went to the affected build directory and ran <code>make VERBOSE=1</code>, which shows the command line involved.</p>
<p>The output was a whole lot of something like:</p>
<pre>/usr/lib/ccache/bin/g++   -march=native -pipe <i>removed .o files</i>
/home/kde-svn/kde-4/lib/libkfile.so.4.7.0
../lib/libgwenviewlib.so.4.7.0 /home/kde-svn/kde-4/lib/libkio.so.5.7.0
/home/kde-svn/kde-4/lib64/libkipi.so <i>more removed stuff</i></pre>
<p>Had I been paying close attention I may have noticed the actual problem right here, but in the event I merely noticed that libkipi had no version number referenced, only the <code>libkipi.so</code>.</p>
<p>The next step for me was to try and figure out why the symbol wasn&#8217;t defined, but first I wanted to make sure that the symbol wasn&#8217;t defined, which can be accomplished using the <code>nm</code> tool.</p>
<p>The output of <code>nm lib64/libkipi.so</code> needs to be filtered to make it useful. I ended up just grepping for the mangled symbol name but you can unmangle the symbol names and grep for that as well. After running <code>nm lib64/libkipi.so | grep ImageInfoShared</code> I saw that the destructor was actually defined three times!</p>
<pre>$ nm  /home/kde-svn/kde-4/lib64/libkipi.so | grep _ZN4KIPI15ImageInfoSharedD
0000000000014728 t _ZN4KIPI15ImageInfoSharedD0Ev
00000000000146e0 t _ZN4KIPI15ImageInfoSharedD1Ev
00000000000146e0 t _ZN4KIPI15ImageInfoSharedD2Ev</pre>
<p>Two of the destructor names pointed to the same address so there was only two different functions, but why were there even 2? Looking into this further revealed that the different destructors are actually defined in the C++ ABI <a href="http://sourcery.mentor.com/public/cxx-abi/abi.html#mangling-special">implemented by gcc</a>, specifically that:</p>
<ul>
<li>The <code>D0</code> destructor is used as the <quote>deleting destructor</quote>.</li>
<li>The <code>D1</code> destructor is used as the <quote>complete object destructor</quote>
</li>
<li>The <code>D2</code> destructor is used as the <quote>base object destructor</quote>.</li>
</ul>
<p>The D1 destructor is presumably used as a shortcut when the compiler is able to determine the actual class hierarchy of a given object and can therefore inline the destructors together into a &#8220;full destructor&#8221;, which the D2 destructor would be used when the ancestry is unclear and therefore the full C++ destruction chain is run. Neither of these would deallocate memory though, which is why the separate D0 destructor is needed (which is presumably otherwise equivalent to D2, but that&#8217;s just me guessing).</p>
<p>Either way, the destructors were actually just normal operation of the compiler. All the bases appeared to be covered, <code>t</code> from the <code>nm</code> output means that the symbol is defined in the text section, which means it should be available, right?</p>
<p>As it turns out I had to read the <code>nm</code> manpage closer&#8230; <em>lowercase</em> symbol categories imply that the symbol is local to that library, or in other words that it does not participate in symbol linking amongst other shared objects. That would explain why <code>gcc</code> seemingly couldn&#8217;t find it.</p>
<p>But why was the symbol local instead of global? As far as this goes, I&#8217;m still honestly not sure. It turns out that <code>LIBKIPI_EXPORT</code> was defined to expand to <code>KDE_IMPORT</code> instead of <code>KDE_EXPORT</code>. But on Linux <em>both</em> of those change the visibility of the affected symbol to be exported (<code>KDE_IMPORT</code> makes more sense on the Windows platform, but is essentially the default on Linux already). So although this appeared to be the issue, it was actually not a concern.</p>
<p>However, playing around with that <code>#define</code> and recompiling libkipi made me realize that the affected library didn&#8217;t appear to have changed after I ran <code>make install</code>&#8230; which turned out to be due to my KDE libraries getting installed to <code>$HOME/kde-4/lib</code>, but libkipi was in <code>$HOME/kde-4/lib<b>64</b></code>, and was getting picked up by CMake and FindKipi.cmake somehow.</p>
<p>Perhaps I hit a transient buildsystem bug, perhaps it was something else. But removing the stray lib64 directory and rebuilding the affected modules appears to have fixed everything. At least I learned the reason there&#8217;s up to 3 different destructor symbol names for a C++ class, I guess. ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2011/10/16/tracking-down-a-library-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>15 years of KDE</title>
		<link>http://www.purinchu.net/wp/2011/10/14/15-years-of-kde/</link>
		<comments>http://www.purinchu.net/wp/2011/10/14/15-years-of-kde/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 01:59:28 +0000</pubDate>
		<dc:creator>mpyne</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[anniversary]]></category>

		<guid isPermaLink="false">http://www.purinchu.net/wp/?p=710</guid>
		<description><![CDATA[I&#8217;m almost late to the party, but then it&#8217;s never too late to commemorate something as notable as 15 years of development. I look forward to many more years of working with the best community of developers and users out there! Happy 15th Birthday KDE!]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m almost late to the party, but then it&#8217;s never <em>too</em> late to commemorate something as notable as 15 years of development.</p>
<p>I look forward to many more years of working with the best community of developers and users out there! Happy 15<sup>th</sup> Birthday KDE!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.purinchu.net/wp/2011/10/14/15-years-of-kde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->