<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Patrick Böker</title>
    <description>The latest articles on Forem by Patrick Böker (@patrickbkr).</description>
    <link>https://forem.com/patrickbkr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F521926%2F2db108bc-bf00-40d1-bc7c-e594a6f04d9f.jpeg</url>
      <title>Forem: Patrick Böker</title>
      <link>https://forem.com/patrickbkr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/patrickbkr"/>
    <language>en</language>
    <item>
      <title>The Second Raku Core Summit</title>
      <dc:creator>Patrick Böker</dc:creator>
      <pubDate>Wed, 18 Jun 2025 08:06:48 +0000</pubDate>
      <link>https://forem.com/patrickbkr/the-second-raku-core-summit-3d2</link>
      <guid>https://forem.com/patrickbkr/the-second-raku-core-summit-3d2</guid>
      <description>&lt;p&gt;One and a half weeks ago I had the honor of being part of the second Raku Core Summit. The summit took place from Friday the 6th of June to Monday the 9th of June. We were again invited to lizmat's home in Echt, NL.&lt;br&gt;
A big thanks to Wendy for once again excellently providing food and drink throughout the days (we enjoyed an endless supply of cocktail tomatoes, strawberries and cherries).&lt;br&gt;
And another big thanks to The Perl and Raku Foundation for sponsoring the event!&lt;br&gt;
All in all we had a productive meeting, we indeed managed to cross out all entries on the big list of things we wanted to discuss and then we even had some time left for hacking on stuff.&lt;/p&gt;

&lt;p&gt;I personally got answers to all the questions I brought:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A pretty short discussion unblocked my work on &lt;a href="https://github.com/Raku/problem-solving/issues/473#issuecomment-2954082152" rel="noopener noreferrer"&gt;variable argument support in NativeCall&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Rakudo now bundles &lt;a href="https://github.com/rakudo/rakudo/commit/313dfb7df0fdb3d527125f4642100dd8051d8957" rel="noopener noreferrer"&gt;filenames&lt;/a&gt;, &lt;a href="https://github.com/rakudo/rakudo/commit/a7453b1dce375221d9c1783ee3dca9e7fd32ec4e" rel="noopener noreferrer"&gt;sources and source checksums&lt;/a&gt; with the compiled code making it available to debuggers. This unblocks my work on a TUI debugger frontend for Rakudo.&lt;/li&gt;
&lt;li&gt;We concluded that my work on &lt;a href="https://github.com/MoarVM/MoarVM/pull/1812" rel="noopener noreferrer"&gt;return prioritization&lt;/a&gt; should be merged,&lt;/li&gt;
&lt;li&gt;as well as the new &lt;a href="https://github.com/rakudo/rakudo/pull/5725" rel="noopener noreferrer"&gt;script wrappers&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the first evening I gave a talk of how I envision the &lt;a href="https://boekernet.de/~patrick/talks/raku-vision-talk.md" rel="noopener noreferrer"&gt;future of Raku&lt;/a&gt;. It's basically my &lt;a href="https://boekernet.de/~patrick/finger.txt" rel="noopener noreferrer"&gt;Raku todo list&lt;/a&gt; and why I believe the things on that list are important. I think the talk resonated with most of the others. &lt;/p&gt;

&lt;p&gt;Lastly we talked about how we want to get Raku 6.e released. The discussions resulted in &lt;a href="https://github.com/rakudo/rakudo/issues/5905" rel="noopener noreferrer"&gt;a checklist&lt;/a&gt; of things we want and need to do prior to the release. (Some points of my vision talk made it onto that list, yay!) It's quite long, but I'm happy that we have a concrete list now.&lt;/p&gt;

</description>
      <category>raku</category>
    </item>
    <item>
      <title>Better wrapper scripts</title>
      <dc:creator>Patrick Böker</dc:creator>
      <pubDate>Wed, 27 Mar 2024 22:29:54 +0000</pubDate>
      <link>https://forem.com/patrickbkr/better-wrapper-scripts-158j</link>
      <guid>https://forem.com/patrickbkr/better-wrapper-scripts-158j</guid>
      <description>&lt;p&gt;There are many programming languages that don't by default produce native executables. Among them are Python, Java, Ruby, Perl, Raku, ... The list goes on. When creating an application in any of those languages one will at one point typically hit the issue that the application can only be started by calling a the language interpreter and passing a few arguments. The usual solution is to write a small wrapper shell script on *nix and a bat file on Windows. That's a quick solution. But getting such wrapper scripts really right is not trivial. Typical pitfalls are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script depends on the current working directory&lt;/li&gt;
&lt;li&gt;It requires Bash and thus can't work in e.g. BusyBox&lt;/li&gt;
&lt;li&gt;It fails to process args that contain special chars (e.g. &lt;code&gt;&amp;lt;&lt;/code&gt; or &lt;code&gt;&amp;gt;&lt;/code&gt; (or many others) combined with bat files is fun)&lt;/li&gt;
&lt;li&gt;It insta returns to the prompt and then ghost writes to the terminal on Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few years ago I started working on a tool to help generating robust wrappers. I've finally pushed it over the finish line.&lt;/p&gt;

&lt;p&gt;It's called &lt;a href="https://raku.land/zef:patrickb/Devel::ExecRunnerGenerator" rel="noopener noreferrer"&gt;Executable Runner Generator&lt;/a&gt;. The name could have been chosen better, but we'll have to live with it now. It's written in the &lt;a href="https://raku.org/" rel="noopener noreferrer"&gt;Raku&lt;/a&gt; language, but the generated wrappers are independent of the language. Currently it can generate wrappers that work on Windows x86_64 and all sorts of POSIX systems.&lt;/p&gt;

&lt;p&gt;In general the task of the wrapper is to put together a command line (and runtime environment like CWD and env vars) and execute the program. How exactly that happens is configured via a set of options. The wrapper has the ability to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Construct paths relative to the wrappers file system location&lt;/li&gt;
&lt;li&gt;Change path separators on Windows&lt;/li&gt;
&lt;li&gt;Change the current working directory&lt;/li&gt;
&lt;li&gt;Specify the command line arguments to pass to the program&lt;/li&gt;
&lt;li&gt;Forward the arguments passed to the wrapper&lt;/li&gt;
&lt;li&gt;Add and remove environment variables&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A webservice
&lt;/h2&gt;

&lt;p&gt;As not everyone is keen to install Raku on their system just to generate a wrapper, I've set up a small website that exposes the functionality:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://boekernet.de/erg" rel="noopener noreferrer"&gt;https://boekernet.de/erg&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Call for help
&lt;/h2&gt;

&lt;p&gt;On Windows the generator relies on a native executable written in C to do it's magic. There is no &lt;code&gt;exec&lt;/code&gt; syscall on Windows. The program works around this by staying alive, letting the child process inherit it's file descriptors and once the child finishes, returns with it's exit code. I'm pretty sure this "exec emulation" isn't perfect. But as I'm not a Windows low level expert I don't even know what I'm missing. Signals? Security contexts? I don't know.&lt;br&gt;
So: If you are knowledgeable of the lower Windows APIs, I'd love to get feedback on the &lt;a href="https://git.sr.ht/~patrickb/Devel-ExecRunnerGenerator/tree/main/item/runner-src/runner.c" rel="noopener noreferrer"&gt;implementation&lt;/a&gt; or maybe even a patch. You can reach me &lt;a href="https://boekernet.de/~patrick/" rel="noopener noreferrer"&gt;on many channels&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>packaging</category>
      <category>script</category>
    </item>
    <item>
      <title>Stability</title>
      <dc:creator>Patrick Böker</dc:creator>
      <pubDate>Wed, 06 Mar 2024 20:56:06 +0000</pubDate>
      <link>https://forem.com/patrickbkr/stability-3mla</link>
      <guid>https://forem.com/patrickbkr/stability-3mla</guid>
      <description>&lt;p&gt;It's been three years since I announced the Rakudo CI bot project (then still called the Raku CI bot) I am working on and almost two years since I last published a &lt;a href="https://news.perlfoundation.org/post/grant-report-raku-ci-bot-2022-01"&gt;grant report&lt;/a&gt;. It's high time to publish another. But in this post I want to focus on a milestone that's not part of the grant: Stability.&lt;/p&gt;

&lt;p&gt;In my last two reports (&lt;a href="https://news.perlfoundation.org/post/2021-10-raku-ci-bot-grant-update"&gt;6&lt;/a&gt;, &lt;a href="https://news.perlfoundation.org/post/grant-report-raku-ci-bot-2022-01"&gt;7&lt;/a&gt;) I started added a paragraph dedicated solely to bugs I found and fixed in third party components. Quoting one of those reports:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I do hope that instead of evading bugs in third party software by utilizing workarounds or switching the library, but instead golfing, reporting and fixing bugs, the quality of our software ecosystem will improve and future users will be able to enjoy a more reliable ecosystem.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I had less time working on the CI bot than I liked (one of the happy reasons being my families head count increasing). But I did not expect that getting the bot stable would take me two more years, 39 pull requests, two problem-solving issues and a dozen more bug reports that were solved by others. In the last year when I was asked what my go-to programming language of choice was, I would say "Raku. But I honestly can't recommend using it yet. It's lacking in stability."&lt;/p&gt;

&lt;p&gt;Over the course of the last years the CI bot always somehow worked, but within a few minutes, at most one or two hours after starting it, it would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Segfault in multiple ways&lt;/li&gt;
&lt;li&gt;Deadlock in multiple ways&lt;/li&gt;
&lt;li&gt;Infini-loop&lt;/li&gt;
&lt;li&gt;Error out in various ways (and - depending on the error class - recover. Remember that stability was one of the key goals of the CI bot.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Well, I'm happy to report, that since last week the CI bot manages to run for multiple days without dying and &lt;em&gt;without logging a single unexpected error&lt;/em&gt;.&lt;br&gt;
To be honest it still manages to hit an out of memory condition roughly every two days on a system with 4GB of RAM. This is worth looking into, but not the kind of failure that makes me not recommend using Raku in general.&lt;/p&gt;

&lt;p&gt;Lets look at the dependencies of this project (showing only the larger ones):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cro::HTTP

&lt;ul&gt;
&lt;li&gt;IO::Socket::Async::SSL&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Cro::WebApp&lt;/li&gt;
&lt;li&gt;LibXML&lt;/li&gt;
&lt;li&gt;OO::Monitors&lt;/li&gt;
&lt;li&gt;Red

&lt;ul&gt;
&lt;li&gt;DB::Pg&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Log::Async&lt;/li&gt;
&lt;li&gt;JSON::JWT

&lt;ul&gt;
&lt;li&gt;OpenSSL&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;YAMLish&lt;/li&gt;
&lt;li&gt;WebService::GitHub

&lt;ul&gt;
&lt;li&gt;HTTP::Tiny&lt;/li&gt;
&lt;li&gt;IO::Socket::SSL&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So when you want to build an application that&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;has a web frontend,&lt;/li&gt;
&lt;li&gt;uses PostgreSQL,&lt;/li&gt;
&lt;li&gt;sends webrequests&lt;/li&gt;
&lt;li&gt;including uploading larger files and&lt;/li&gt;
&lt;li&gt;using XML and JSON APIs and&lt;/li&gt;
&lt;li&gt;has things happening concurrently,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I can now recommend Raku as a language to do so.&lt;/p&gt;

&lt;p&gt;Yay! \o/&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bug Rooster
&lt;/h2&gt;

&lt;p&gt;Do note that not all of the below PRs are merged yet. I'll keep pushing to get the remaining lot merged in due time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cro
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/160"&gt;Do not send the ENO_OF_STREAM flag twice #160&lt;/a&gt;: merged 2021-11-19&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/161"&gt;Implement remote window handling #161&lt;/a&gt;: merged 2022-10-17&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/162"&gt;Implement support for sslkeylogfile #162&lt;/a&gt;: merged 2022-10-17&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/168"&gt;Fix cleanup of timed out connections #168&lt;/a&gt;: merged 2022-10-17&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/169"&gt;Enable logic to prevent connection timeout #169&lt;/a&gt;: merged 2022-10-17&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-core/pull/36"&gt;Fix parsing media types with '.' in them #36&lt;/a&gt;: merged 2022-11-14&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/180"&gt;HTTP2: Implement GoAway handling for the non-error case #180&lt;/a&gt;: merged 2023-04-12&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/jnthn/raku-http-hpack/pull/5"&gt;Correct initial dynamic table limit #5&lt;/a&gt;: merged 2023-04-12

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/188"&gt;Bump HTTP::HPACK dep #188&lt;/a&gt;: merged 2023-11-1&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/187"&gt;Implement a retry mechanism when GoAways are received #187&lt;/a&gt;: merged 2024-01-22&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/190"&gt;Fix HTTP1.1 pipeline teardown #190&lt;/a&gt;: merged 2024-01-22&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/191"&gt;Fix a connection reuse race #191&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/192"&gt;Fix HTTP1.1 connection caching with explicitly given version #192&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-http/pull/193"&gt;Fix HTTP2 connections with multiple streams stalling #193&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/croservices/cro-webapp/pull/88"&gt;Fix using template parts via render-template #88&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Red
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/FCO/Red/pull/535"&gt;Remove duplicate operator #535&lt;/a&gt;: merged 2021-11-21&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/FCO/Red/pull/536"&gt;Lock accesses to the alias-cache of Model #536&lt;/a&gt;: merged 2021-11-21&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/FCO/Red/pull/545"&gt;Extend alias lock to also cover the read accesses #545&lt;/a&gt;: merged 2022-02-10&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/FCO/Red/pull/548"&gt;Fix DateTime roundtrip on Pg #548&lt;/a&gt;: merged 2022-02-10&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/FCO/Red/pull/553"&gt;Fixes constucting an enum column from another column #553&lt;/a&gt;: merged 2022-06-15&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rakudo
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/rakudo/rakudo/pull/4795"&gt;Fix IO::Path::parent #4795&lt;/a&gt;: merged 2022-02-19

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/Raku/roast/pull/801"&gt;Add more IO::Path::parent tests #801&lt;/a&gt;: merged 2022-02-19&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rakudo/rakudo/pull/4800"&gt;Change parent to always just remove the last element #4800&lt;/a&gt;: merged 2022-02-26&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Raku/roast/pull/802"&gt;Change .parent behavior to "stupid" resolving #802&lt;/a&gt;: merged 2022-02-26&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Raku/problem-solving/issues/364"&gt;Supply blocks may reorder flow of execution #364&lt;/a&gt;: solved

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/rakudo/rakudo/issues/5141"&gt;Deadlock in supply / whenever chain #5141&lt;/a&gt;: fixed &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rakudo/rakudo/pull/5158"&gt;Simplify Supply / whenever processing order #5158&lt;/a&gt;: superseeded&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/rakudo/rakudo/pull/5202"&gt;Fix rare deadlocks during supply setup #5202&lt;/a&gt;: merged 2023-11-24&lt;/li&gt;
&lt;li&gt;
&lt;a href=""&gt;Switch Supply.zip to a watermark approach (https://github.com/rakudo/rakudo/pull/5211rework) #5211&lt;/a&gt;: merged 2023-03-09&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Raku/roast/pull/833"&gt;Test supply setup with a blocking recursion #833&lt;/a&gt;: merged 2023-11-24&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  MoarVM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/Raku/problem-solving/issues/417"&gt;LEAVE phaser with return #417&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/MoarVM/MoarVM/pull/1786"&gt;Implement return prioritization #1786&lt;/a&gt;: superseeded&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/MoarVM/MoarVM/pull/1782"&gt;Don't lose return value with LEAVE phasers #1782&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/MoarVM/MoarVM/pull/1785"&gt;Fix returning from LEAVE to surrounding scope #1785&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Raku/roast/pull/851"&gt;Test return prioritization #851&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=""&gt;Implement return prioritization (https://github.com/MoarVM/MoarVM/pull/17882nd try) #1788&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/jnthn/p6-io-socket-async-ssl/pull/64"&gt;IO::Socket::Async::SSL: Implement support for sslkeylogfile #64&lt;/a&gt;: merged 2021-11-19&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sergot/openssl/pull/95"&gt;OpenSSL: Fix OpenSSL::RSAKey sometimes failing to create a key #95&lt;/a&gt;: merged 2022-01-13&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/alabamenhu/DateTimeTimezones/pull/7"&gt;DateTime::Timezones: Fix depends spec #7&lt;/a&gt;: merged 2023-20-21&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sergot/openssl/pull/106"&gt;OpenSSL: Fix segfaults when double closing #106&lt;/a&gt;: merged 2024-02-18&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sergot/io-socket-ssl/pull/24"&gt;IO::Socket:SSL: Rewrite this module as a IO::Socket::Async frontend #24&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/jnthn/p6-io-socket-async-ssl/pull/73"&gt;IO::Socket::Async::SSL: Make .writes Promise result return the written bytes #73&lt;/a&gt;: merged 2024-03-03&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://gitlab.com/jjatria/http-tiny/-/merge_requests/6"&gt;HTTP::Tiny: Fix connection reuse&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://gitlab.com/jjatria/http-tiny/-/merge_requests/5"&gt;HTTP::Tiny: Fix segfault&lt;/a&gt;: &lt;strong&gt;open&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>raku</category>
      <category>ci</category>
    </item>
    <item>
      <title>Hi (and an introduction to the Raku CI bot)</title>
      <dc:creator>Patrick Böker</dc:creator>
      <pubDate>Fri, 26 Mar 2021 14:42:05 +0000</pubDate>
      <link>https://forem.com/patrickbkr/hi-and-an-introduction-to-the-raku-ci-bot-3p3g</link>
      <guid>https://forem.com/patrickbkr/hi-and-an-introduction-to-the-raku-ci-bot-3p3g</guid>
      <description>&lt;p&gt;Hi!&lt;br&gt;
I'm Patrick Böker, patrickbkr on GitHub, patrickb on IRC. I'm a software developer living in Germany near Stuttgart. I have dabbled with many different programming languages and tech stacks. Professionally I'm mostly working with Java, VB.net, VBA and Raku. In my free time I'm involved in the development of the Raku programming language itself.&lt;/p&gt;

&lt;p&gt;I plan to write about any IT related topics I feel are worth sharing, but as I am currently most involved in the Raku language, I expect to be writing mostly about things related to it, but don't be surprised if a post covering some other topic slips in.&lt;/p&gt;

&lt;p&gt;I was recently &lt;a href="https://news.perlfoundation.org/post/grant_proposal_raku_ci_integration_bot"&gt;awarded a grant&lt;/a&gt; as part of the &lt;a href="https://www.perlfoundation.org/raku-development-fund.html"&gt;Raku Development Fund&lt;/a&gt; by the Perl Foundation to work on the Continuous Integration (CI) pipeline of the Rakudo compiler. Raku*do* is the rather fitting name of the compiler and runtime that runs Raku and is currently developed in unison with the language itself. I try to not mix up the two, Raku and Rakudo, but I will fail from time to time, so don't be too confused when I use them wrongly. I will post about my progress on that project here.&lt;/p&gt;

&lt;p&gt;The rest of this post is an introduction to that project.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;It all started with an &lt;a href="https://github.com/Raku/problem-solving/issues/206"&gt;issue&lt;/a&gt; in our dear Problem Solving repository. That repository is the tool by which larger changes to the Raku language and related topics are discussed, reviewed and approved. This is akin to &lt;a href="https://www.python.org/dev/peps/"&gt;PEPs&lt;/a&gt; in Python or &lt;a href="http://openjdk.java.net/jeps/1"&gt;JEPs&lt;/a&gt; in Java.&lt;/p&gt;

&lt;p&gt;That issue states that the development process of Rakudo, has a set of deficiencies which more than once resulted in broken releases and our CI failing on master for longer periods of time. That hurts.&lt;/p&gt;

&lt;p&gt;Deficiencies of our process include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Our CI only covers a small set of environments&lt;/li&gt;
&lt;li&gt;The CI is not entirely reliable&lt;/li&gt;
&lt;li&gt;There are flappers in our test-suite&lt;/li&gt;
&lt;li&gt;People can and do push changes directly to master, sometimes breaking it&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  The Plan
&lt;/h1&gt;

&lt;p&gt;The software I intend to write as a part of the solution is named &lt;em&gt;RakuCIBot&lt;/em&gt; or &lt;em&gt;RCB&lt;/em&gt; for short. So let's address the problems one by one.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Our CI only covers a small set of environments
&lt;/h2&gt;

&lt;p&gt;The Raku community doesn't have the financial resources and manpower to setup and take care of a custom CI solution on our own servers. So we try to make use of the free offerings some CI providers kindly provide to open source projects. It's not strictly necessary for the solution to be free, we might be able to mount a moderate monthly cost for a CI offering, but there are free offerings for open source projects out there, so it makes sense to go with the free solutions. Our CI, as it currently stands, relies solely on Microsofts Azure CI as they offer agents running all three major operating systems (Windows, Linux and MacOS) and do not currently impose resource limits on projects. We did previously use TravisCI, AppVeyor and CircleCI, but none of them support all three major OSes &lt;em&gt;and&lt;/em&gt; don't impose usage limits. (Some of those older CI integrations haven't been shut down yet, but we plan to do so soonish).&lt;/p&gt;

&lt;p&gt;When developing a programming language that directly interfaces with and abstracts the low level APIs of the operating system and (in case of our JIT compiler) even the hardware itself, one does want coverage of all the hardware, operating systems and libraries we can run on. Our current CI, which only runs on x86-64 and only on Windows, Linux and MacOS doesn't suffice. We do want testing on, amongst others and in no particular order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenBSD&lt;/li&gt;
&lt;li&gt;AIX&lt;/li&gt;
&lt;li&gt;SystemZ&lt;/li&gt;
&lt;li&gt;ARM (especially now that Apple moved over to ARM)&lt;/li&gt;
&lt;li&gt;musl (used in Alpine Linux which is very popular in containers)&lt;/li&gt;
&lt;li&gt;glibc 2.17 (that's the oldest version in use in a major disto - CentOS 7)&lt;/li&gt;
&lt;li&gt;Something Debian-y&lt;/li&gt;
&lt;li&gt;Something RedHat-y&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There currently exists no CI offering that provides support for all of these. Especially the rarer hardware platforms are difficult to find support for. There is one rather strange exception though. The &lt;a href="https://openbuildservice.org/"&gt;Open Build Service&lt;/a&gt;, developed and hosted by SUSE, provides a free to use (and open source!) build infrastructure to be used for building packages for a range of Linux distributions on a very wide range of hardware platforms. The OBS is no CI platform, it's intended to be used to build (and deploy) distribution packages. But technically it does run tests as part of its normal work of creating packages and we do have approval to bend the OBS service into a CI platform for Rakudo.&lt;/p&gt;

&lt;p&gt;So the plan is to rely on two CI offerings, AzureCI for MacOS and Windows, and OBS for Linux on all sorts of different Linux distributions and hardware platforms.&lt;/p&gt;

&lt;p&gt;The Rakudo core projects use Git and GitHub for source code management. So it's desirable to have the CI integrated in GitHub. OBS' APIs make it tricky to use them as a CI directly and they do not offer any integration into GitHub (remember: OBS has no focus on being a CI platform currently), so we need a software that acts as a middle man and does the bending that's necessary to use it as such. That's one of the tasks the RCB I plan to develop should perform.&lt;/p&gt;

&lt;p&gt;Extending RCB to also test on other CI offerings should possible. &lt;a href="https://man.sr.ht/builds.sr.ht/compatibility.md"&gt;SourceHut&lt;/a&gt; (it's a paid service) for example would give us support for several BSDs.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The CI is not entirely reliable
&lt;/h2&gt;

&lt;p&gt;The CIs we have used up to now have all been occasionally failing for reasons unrelated to the actual tests. Reasons include the CI platform being offline and the GitHub APIs being temporarily unavailable for the CI provider. As CI providers usually don't retry a build once it's failed, such failures are annoying. They alarm committers of a problem where there is none or block a PR from being merged. The only solution I could think of is to introduce a middle man that acts like a &lt;a href="https://en.wikipedia.org/wiki/Message_queue"&gt;Message Queue&lt;/a&gt;. That's another task the RCB should perform. It should be able to receive push notifications of the respective APIs of GitHub and the CI backends to keep the CI processing responsive, but also pull for changes to be resilient to temporary fallouts. There should be a focus on making sure RCB will not accidentally miss or loose messages itself. Otherwise we'll have a system as unreliable as before, but more complex.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. There are flappers in our test-suite
&lt;/h2&gt;

&lt;p&gt;Flappers are tests in our test-suite that are not entirely reliable. Such a test is for some reason sometimes falsely negative. The rarer the test fails to succeed without reason, the more difficult it is to reproduce and fix. Preferably we want to fix flappers, but sometimes it's not easily possible to do so (missing manpower being the usual reason). So we should make sure flappers don't hurt the CI. The simple solution is to just re-run a CI run if it fails. That will help with the stability of our CI, but is counter productive for actually fixing the flappers. When, in the case of a failed CI run, we just re-run the tests and don't do anything else, we basically hide an error. Error-hiding, aka &lt;code&gt;CATCH { #`[Just ignore.] }&lt;/code&gt;, is a famous &lt;a href="https://en.wikipedia.org/wiki/Error_hiding"&gt;anti-pattern&lt;/a&gt; we should strive to avoid. So what we'll do instead is set up a list, where flappers are manually kept book of. That list is read by RCB and only CI failures that match one of the noted flappers are then re-run. In addition RCB will keep track of the failures for each flapper so we can get a feel for how often the flappers hit and ideally get a hint for fixing them.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. People can and do push changes directly to master
&lt;/h2&gt;

&lt;p&gt;We'll only allow pushing changes to master that have been successfully CI tested via a pull request (PR). A PR is a GitHubby thing where one proposes a change for review / CI test and which can be merged in a separate step. For this workflow to work it's absolutely necessary that our CI is reliable, otherwise PRs can and will become blocked by false negative CI results, providing an endless source of annoyance for our dear developers. We do not want that. They are already &lt;a href="https://perl6advent.wordpress.com/2014/12/24/"&gt;tormented on the behalf of our users&lt;/a&gt;. We should spare them additional torture by the infrastructure.&lt;/p&gt;

&lt;p&gt;To ease the pain of a more complex process of getting changes into the master branch, I want the RCB to automatically merge PRs when requested to do so (via a magic word in a comment of the PR) and the CI tests are successful. Then a PR submitter doesn't need to revisit her PR later to merge it.&lt;/p&gt;

&lt;h1&gt;
  
  
  What's the state of things?
&lt;/h1&gt;

&lt;p&gt;To reduce the chances of unforeseen difficulties as soon as possible, I tried to approach the parts of this project with the largest potential for problems first. In my experience it's external components out of my control that are the most trouble. External components of RCB are the CI backends, namely AzureCI and OBS and GitHub. So I started by looking into those first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interfaces: GitHub
&lt;/h2&gt;

&lt;p&gt;The GitHub interfaces gave me the least trouble of the three. There is some &lt;a href="https://docs.github.com/en/rest/reference"&gt;good documentation&lt;/a&gt; that even includes a tutorial on how to &lt;a href="https://docs.github.com/en/rest/guides/building-a-ci-server"&gt;integrate a CI server&lt;/a&gt; and there already is a &lt;a href="https://raku.land/github:fayland/WebService::GitHub"&gt;Raku GitHub API library&lt;/a&gt;. I started extending the functionality of that library to also support the &lt;a href="https://docs.github.com/en/rest/reference/checks"&gt;Checks&lt;/a&gt; and &lt;a href="https://docs.github.com/en/rest/reference/pulls"&gt;Pulls&lt;/a&gt; APIs. I'm not done with them yet, there is more to be implemented, e.g. extending the &lt;a href="https://docs.github.com/en/rest/reference/issues"&gt;Issue&lt;/a&gt; API to support comments and implementing support for &lt;a href="https://docs.github.com/en/developers/webhooks-and-events/about-webhooks"&gt;webhooks&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interfaces: AzureCI
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-6.1"&gt;AzureCI documentation&lt;/a&gt; is rather messy. In some part that's surely caused by the huge scope that the Azure services cover. But I never the less find it difficult to get at the information I'm interested in. The relevant subproject of Azure is &lt;em&gt;Azure Pipelines&lt;/em&gt;, which is part of &lt;em&gt;Azure DevOps&lt;/em&gt;. One specific bit of information I had almost thought impossible to get at is the build logs of the individual &lt;a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started/key-pipelines-concepts?view=azure-devops"&gt;jobs in a stage&lt;/a&gt;. I finally found out that the only(?) way to access those logs is via the &lt;a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/build/timeline?view=azure-devops-rest-6.1"&gt;Timeline API&lt;/a&gt;. That API will return the individual bits of the log of a &lt;em&gt;build&lt;/em&gt; (which is usually made up of multiple jobs that run in parallel) in temporal order. Using the parent IDs each individual log bit contains, (they are not documented at all) its possible to reconstruct the build logs of the individual jobs as they are seen on &lt;a href="https://dev.azure.com/Rakudo/rakudo/_build/results?buildId=1195&amp;amp;view=logs&amp;amp;j=70f6b8a1-f3cf-5727-bd79-d08ddb1caf67&amp;amp;t=f59a17df-92a9-5d7f-18bb-7f81f1c720a8"&gt;the webinterface&lt;/a&gt; (that link will be dead in a few weeks, just ignore then).&lt;/p&gt;

&lt;p&gt;Otherwise I think all the necessary bits to control AzureCI pipelines are there. I hope it's now a &lt;a href="https://en.wikipedia.org/wiki/Small_matter_of_programming"&gt;SMOP&lt;/a&gt; - in the literal sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interfaces: OBS
&lt;/h2&gt;

&lt;p&gt;OBS has an &lt;a href="https://build.opensuse.org/apidocs/index"&gt;API&lt;/a&gt;. It's rather straight forward and smallish. It's necessary to understand how OBS itself works for the API to make sense though, as it rather literally maps to the workflows in OBS itself. Also it's an XML only API, JSON is not supported. There is one unfortunate limitation in how OBS (and thus its API) works. In OBS it is not possible to retrieve the build log of a package apart from the most recent one. This has the consequence, that build jobs will have to happen serially, one after the other, instead of in parallel. &lt;/p&gt;

&lt;h2&gt;
  
  
  Core Architecture
&lt;/h2&gt;

&lt;p&gt;I fleshed out the architecture of the core logic of the application already. I'll explain it in an upcoming post.&lt;/p&gt;

&lt;h1&gt;
  
  
  Next steps
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Set up the frame of the application. That includes setting up a skeleton application with the initial setup stuff to get a do-nothing-application with some tests working, a container pipeline and a deployment script to push it to a server.&lt;/li&gt;
&lt;li&gt;Get enough of the GitHub integration working to have RCB act as a GitHub CI backend.&lt;/li&gt;
&lt;li&gt;Get the OBS integration working.&lt;/li&gt;
&lt;li&gt;Flesh out the core logic.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;More to come.&lt;/p&gt;

</description>
      <category>raku</category>
      <category>ci</category>
      <category>obs</category>
      <category>azure</category>
    </item>
  </channel>
</rss>
