nandi/frqpublic Fork 0
e10e1c1
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Take the jolt-native beside this one when there is one

Changing the terminal backend meant commit, push, re-pin, re-lock before the
change could be run at all — four steps and an upload for a line of Rust, on a
link that has better things to do.

The dev shell looks for ../jolt-native now and takes the Jolt halves and
libjolttui out of it, so the loop is cargo build and just tui. A worktree
under .claude/worktrees counts as the same checkout, since the sibling is the
main one's.

It has to be built: a checkout with no target/release/libjolttui.so would pair
the working copy's Jolt half with the pin's shared object, which fails in ways
that look like neither. And it says which tree it took on the way in —
FRQ_JOLT_NATIVE names another, empty asks for the pin.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-10T11:39:43-07:00 Browse files
e10e1c1 parent: 15b66ce
modified flake.nix +63 -0
@@ -590,6 +590,69 @@
590590 ];
591591 FRQ_LIB_PATH = lib.makeLibraryPath (runtimeLibsFor pkgs);
592592 NIXGL = "${nixGLFor pkgs}/bin/nixGLIntel";
593+
594+ # A checkout of jolt-native beside this one, in place of the pin.
595+ #
596+ # The pin is a rev on a server, so the loop for a change to the
597+ # terminal backend was commit, push, re-pin, re-lock — four steps
598+ # and an upload for a line of Rust. With a working copy beside this
599+ # one the loop is `cargo build` and `just tui`, and the shell finds
600+ # that copy itself: ../jolt-native from the checkout this was run
601+ # in, which is where it is on the machines this is developed on.
602+ # A worktree under .claude/worktrees counts as the same checkout —
603+ # the sibling is the main one's, not the worktree's.
604+ #
605+ # Found rather than named, but not silently: it says which tree it
606+ # took on the way in, because `just tui` running something other
607+ # than the pin is the sort of thing you have to be able to see.
608+ #
609+ # It has to be a built one. A checkout with no target/release/
610+ # libjolttui.so in it would mean the Jolt half of the backend from
611+ # the working copy and the shared object from the pin — two halves
612+ # of two different libraries, which fail in ways that look like
613+ # neither. So an unbuilt sibling is left alone and the pin stands.
614+ #
615+ # FRQ_JOLT_NATIVE overrides the search, and is taken even unbuilt
616+ # (with a word about what to run): naming a tree is asking for it.
617+ # Empty is how you say the pin, on a machine that has a sibling and
618+ # wants what everyone else is running.
619+ #
620+ # Only the sources and libjolttui move either way. Everything else
621+ # on the library path — libopus, libmoq_ffi, the ALSA plugins —
622+ # stays the pin's, since a checkout has no build of those to offer.
623+ shellHook = ''
624+ frq_named=1
625+ if [ -z "''${FRQ_JOLT_NATIVE+named}" ]; then
626+ frq_named=
627+ frq_git="$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null || true)"
628+ frq_near="''${frq_git:+$(dirname "$(dirname "$frq_git")")/jolt-native}"
629+ if [ -n "$frq_near" ] && [ -e "$frq_near/target/release/libjolttui.so" ]; then
630+ FRQ_JOLT_NATIVE="$frq_near"
631+ else
632+ FRQ_JOLT_NATIVE=""
633+ fi
634+ fi
635+ if [ -n "$FRQ_JOLT_NATIVE" ]; then
636+ if [ -d "$FRQ_JOLT_NATIVE/crates/jolt-tui" ]; then
637+ FRQ_JOLT_NATIVE="$(cd "$FRQ_JOLT_NATIVE" && pwd)"
638+ export FRQ_JOLT_NATIVE
639+ export GLIMMER_TUI_SRC="$FRQ_JOLT_NATIVE/glimmer-backends/glimmer-tui"
640+ export GLIMMER_JVUI_SRC="$FRQ_JOLT_NATIVE/glimmer-backends/glimmer-jvui"
641+ export JVUI_SRC="$FRQ_JOLT_NATIVE/jvui"
642+ # First, so a cargo build wins over the pin's copy of the
643+ # same object. The rest of the pin's lib directory is still
644+ # behind it.
645+ export JOLT_NATIVE_LIB="$FRQ_JOLT_NATIVE/target/release:$JOLT_NATIVE_LIB"
646+ echo "frq: jolt-native from $FRQ_JOLT_NATIVE, not the pin (FRQ_JOLT_NATIVE= for the pin)" >&2
647+ if [ ! -e "$FRQ_JOLT_NATIVE/target/release/libjolttui.so" ]; then
648+ echo "frq: no libjolttui.so there yet — cargo build --release --features terminal -p jolt-tui" >&2
649+ fi
650+ elif [ -n "$frq_named" ]; then
651+ echo "frq: FRQ_JOLT_NATIVE=$FRQ_JOLT_NATIVE is not a jolt-native checkout; using the pin" >&2
652+ fi
653+ fi
654+ unset frq_named frq_git frq_near
655+ '';
593656 };
594657 });
595658
@@ -590,6 +590,69 @@
590 ];590 ];
591 FRQ_LIB_PATH = lib.makeLibraryPath (runtimeLibsFor pkgs);591 FRQ_LIB_PATH = lib.makeLibraryPath (runtimeLibsFor pkgs);
592 NIXGL = "${nixGLFor pkgs}/bin/nixGLIntel";592 NIXGL = "${nixGLFor pkgs}/bin/nixGLIntel";
593+
594+ # A checkout of jolt-native beside this one, in place of the pin.
595+ #
596+ # The pin is a rev on a server, so the loop for a change to the
597+ # terminal backend was commit, push, re-pin, re-lock — four steps
598+ # and an upload for a line of Rust. With a working copy beside this
599+ # one the loop is `cargo build` and `just tui`, and the shell finds
600+ # that copy itself: ../jolt-native from the checkout this was run
601+ # in, which is where it is on the machines this is developed on.
602+ # A worktree under .claude/worktrees counts as the same checkout —
603+ # the sibling is the main one's, not the worktree's.
604+ #
605+ # Found rather than named, but not silently: it says which tree it
606+ # took on the way in, because `just tui` running something other
607+ # than the pin is the sort of thing you have to be able to see.
608+ #
609+ # It has to be a built one. A checkout with no target/release/
610+ # libjolttui.so in it would mean the Jolt half of the backend from
611+ # the working copy and the shared object from the pin — two halves
612+ # of two different libraries, which fail in ways that look like
613+ # neither. So an unbuilt sibling is left alone and the pin stands.
614+ #
615+ # FRQ_JOLT_NATIVE overrides the search, and is taken even unbuilt
616+ # (with a word about what to run): naming a tree is asking for it.
617+ # Empty is how you say the pin, on a machine that has a sibling and
618+ # wants what everyone else is running.
619+ #
620+ # Only the sources and libjolttui move either way. Everything else
621+ # on the library path — libopus, libmoq_ffi, the ALSA plugins —
622+ # stays the pin's, since a checkout has no build of those to offer.
623+ shellHook = ''
624+ frq_named=1
625+ if [ -z "''${FRQ_JOLT_NATIVE+named}" ]; then
626+ frq_named=
627+ frq_git="$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null || true)"
628+ frq_near="''${frq_git:+$(dirname "$(dirname "$frq_git")")/jolt-native}"
629+ if [ -n "$frq_near" ] && [ -e "$frq_near/target/release/libjolttui.so" ]; then
630+ FRQ_JOLT_NATIVE="$frq_near"
631+ else
632+ FRQ_JOLT_NATIVE=""
633+ fi
634+ fi
635+ if [ -n "$FRQ_JOLT_NATIVE" ]; then
636+ if [ -d "$FRQ_JOLT_NATIVE/crates/jolt-tui" ]; then
637+ FRQ_JOLT_NATIVE="$(cd "$FRQ_JOLT_NATIVE" && pwd)"
638+ export FRQ_JOLT_NATIVE
639+ export GLIMMER_TUI_SRC="$FRQ_JOLT_NATIVE/glimmer-backends/glimmer-tui"
640+ export GLIMMER_JVUI_SRC="$FRQ_JOLT_NATIVE/glimmer-backends/glimmer-jvui"
641+ export JVUI_SRC="$FRQ_JOLT_NATIVE/jvui"
642+ # First, so a cargo build wins over the pin's copy of the
643+ # same object. The rest of the pin's lib directory is still
644+ # behind it.
645+ export JOLT_NATIVE_LIB="$FRQ_JOLT_NATIVE/target/release:$JOLT_NATIVE_LIB"
646+ echo "frq: jolt-native from $FRQ_JOLT_NATIVE, not the pin (FRQ_JOLT_NATIVE= for the pin)" >&2
647+ if [ ! -e "$FRQ_JOLT_NATIVE/target/release/libjolttui.so" ]; then
648+ echo "frq: no libjolttui.so there yet — cargo build --release --features terminal -p jolt-tui" >&2
649+ fi
650+ elif [ -n "$frq_named" ]; then
651+ echo "frq: FRQ_JOLT_NATIVE=$FRQ_JOLT_NATIVE is not a jolt-native checkout; using the pin" >&2
652+ fi
653+ fi
654+ unset frq_named frq_git frq_near
655+ '';
593 };656 };
594 });657 });
595 658