January 30, 2025

Working with CI

Continuing from yesterday, I have a build working in Nix that I need to translate to the sourcehut build job. Hopefully this is as straightforward as dropping the relevant packages into the file including the ghcWithPackages invocation.

image: nixos/24.11
oauth: pages.sr.ht/PAGES:RW
packages:
- "nixos.haskellPackages.ghcWithPackages (pkgs: with pkgs; [pandoc-cli stack])"
- nixos.hut
environment:
  site: mwhipple.srht.site
tasks:
- publish: make --file=generate.mk --directory=$site publish

That didn't work - can try it quickly without quotes before digging deeper.

image: nixos/24.11
oauth: pages.sr.ht/PAGES:RW
packages:
- nixos.haskellPackages.ghcWithPackages (pkgs: with pkgs; [pandoc-cli stack])
- nixos.hut
environment:
  site: mwhipple.srht.site
tasks:
- publish: make --file=generate.mk --directory=$site publish

That blew up even faster with a YAML parsing error.

The issue is around a mismatch between the syntax for nix-shell that I'm using locally and nix-env that is being used for CI. Any relevant information is likely somewhere between the nixos wiki and haskell4nix documentation. With this incarnation where stack is heavily relied upon, it seems like I may not need the special behavior so I'll also go back to just using more typical packages.

image: nixos/24.11
oauth: pages.sr.ht/PAGES:RW
packages:
- nixos.gnumake
- nixos.haskellPackages.pandoc-cli
- nixos.haskellPackages.stack
- nixos.hut
environment:
  site: mwhipple.srht.site
tasks:
- publish: make --file=generate.mk --directory=$site publish

I also stumbled into a tangle braino where I kept appending to the file rather than replacing (which helped produce garbage YAML). I was also leaving make out so that is added back.

Now this works!

As somewhat predicted the build took a fair amount of time (~6 minutes). It's worth seeing if any type of caching may speed up subsequent invocations. Given how infrequently it will be run, the time is acceptable and while I'd like to speed it up I have no driving need to do so. As I incidentally dig deeper into some of the relevant technologies I'll revisit to this to see if I can apply newfound knowledge, but for now I'll leave this as it is.

Research Flow

I'm fairly constantly reading up on something or other. Often these things cross between work and personal efforts (particularly since I often want to use personal resources to do research in support of work).

What I've currently gravitated towards is using my tablet for research. I currently have a Samsung Galaxy Tab 8 that my sister gave me a few years ago since she doesn't like Android. It continues to run Android; for the time being this is somewhat locked in given that I also use it to keep my children occupied on longer road trips with some Netflix downloads (thereby saving my sanity) - while I'd likely be able to get other functions working on an alternative OS, I don't want to chance messing that up. I also don't have the time that I used to have to devote to those types of things, and I have other devices (like old netbooks) that I'd probably start with given that they'd likely be easier to work with.

I typically bounce between a lot of materials and O'Reilly books in Firefox tabs (since the O'Reilly app itself is terrible) and the New York Times app (and some other things not research related like I'm currently working on my chess skills and ear training). Right now as resources are completed I send the tab to my laptop through Firefox (or share articles to myself over email) where I then save them into Zotero. I have a sideloaded copy of zotero-android(1), but the ability to save citations isn't there yet - I'll also be looking at an alternative like zoo at which point I can stop doing the tab sharing.

The tablet is great as it is easily portable across and outside of workstations, and can be plugged in to the laptop I'm using to charge as needed. I currently also have a portable keyboard, and a Twiddler keyer which I sometimes use with the tablet, but at the moment I don't use it for much (though I have in the past and likely will again but am shifting some approaches).

For other information (including printed materials) I've taken to using my phone camera which I then store using my laptop during some subsequent session. For some materials this may be a DOI or ISBN number, or it may be something less formal.

My laptop I typically have several projects open that I'm grokking along with any type of in-flight work. All of which I keep reined in to a particular footprint.

Spell Checking

While creating this site I noticed that my spell checking wasn't working in Emacs…which is important since I'm unlikely to spend the time to edit the content in any timely fashion (I'm typically racing to get it done before my day starts).

The received error was about a missing dictionary - I quickly tried reinstalling aspell and the same issue manifested. I then checked the (Gentoo) USE flags and noticed that no language was selected, so I added the relevant l10n_en flag to my global USE flags (English supports seems likely to be generally helpful) and re-emerged aspell - and now it works. easy-peasy. Now to go back and clean up my spelling.

Next I'll wire up flyspell for more consistent use.

HackerRank Custom Test

Last week or so I experimented with writing a custom HackerRank test to use for interviewing (2). I found this appealing since it could avoid some tool issues that can pop up while interviewing. I was also looking to use it as part of a take-home initial step that can be used both for quick assessment and to set some background context for subsequent stages (a pattern I've been a part of in the past that I'm particularly fond of using the same scenario to gauge a range of candidate skills across multiple sessions).

Use of HackerRank seemed straightforward enough and I was overall pleased. I likely tried to use the system for purposes that it wasn't primarily designed for (I'm not looking of a code ninja type of exercise), but the ability to provide some verifiable behaviors in what should be a readily accessible environment holds a lot of promise (there are almost certainly alternatives, but HackerRank was what was immediately available to me).

Emacs Configuration

As per my habit every several years, I'll start to record my emacs configuration.

bib.json syncing

I belatedly realized it will be far simpler to just change where my bibliography is exported (as I'm not actively using the other location) or configure a second export from Zotero. This obviates the need to otherwise copy it into this directory and provides more coherent access across channels.

Modelina

I'll be picking my way through the Modelina source code(3). I have some personal interests in this project as part of supporting Data Precedence, but I'm also using it professionally. I currently have it integrated for some code generation needs, but have some areas that I'd like to optimize or customize (particularly in support of more sophisticated interface management to allow for things like more controlled forward and backward compatibility.

Tree Sitter in Emacs

Tree Sitter is a tool I've recently independently played around with, but am also interested in its integration with Emacs. This just popped its head up when trying to activate a Typescript mode where I must have installed a tree sitter mode that is not working in the current compilation.

1.
zotero/zotero-android [online]. Kotlin. 4 November 2024. Zotero. [Accessed 4 November 2024]. Available from: https://github.com/zotero/zotero-android
Zotero for Android
2.
HackerRank Knowledge Base. [online]. [Accessed 30 January 2025]. Available from: http://support.hackerrank.com/articles/2031393332-creating-a-custom-test
Creating a Custom Test
3.
asyncapi/modelina [online]. TypeScript. 29 January 2025. AsyncAPI Initiative. [Accessed 30 January 2025]. Available from: https://github.com/asyncapi/modelina
A library for generating typed models based on inputs such as AsyncAPI, OpenAPI, and JSON Schema documents with high customization