Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/installers/cell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ if (-not $gatewayVersion) { Fail "$pin names no Gateway version" }
$root = Join-Path $env:LOCALAPPDATA 'Runvil'
$profileDir = Join-Path $env:USERPROFILE '.runvil'
$workshopExe = Join-Path $root 'runvil-workshop.exe'
# The std Plugin's library installs with Workshop, in its Plugin directory.
$stdPlugin = Join-Path $root 'plugins\plugin_std.dll'
# The libraries of the std Plugin and the bashkit Plugin install with
# Workshop, in its Plugin directory. Each is listed with the name its
# Plugin reports.
$plugins = @(
@{ Name = 'std'; Library = Join-Path $root 'plugins\plugin_std.dll' },
@{ Name = 'bashkit'; Library = Join-Path $root 'plugins\plugin_bashkit.dll' })
$gatewayExe = Join-Path $root 'runvil-gateway.exe'
$config = Join-Path $profileDir 'gateway.toml'
$discovery = Join-Path $profileDir 'run\gateway.json'
Expand Down Expand Up @@ -260,7 +264,9 @@ function Test-Selection($Want) {
# nothing into the profile, and the Speech to Text gate records the
# choice for the Gateway's first start.
Test-Presence 'Workshop' $Want.Workshop $workshopExe
Test-Presence "Workshop's std Plugin" $Want.Workshop $stdPlugin
foreach ($plugin in $plugins) {
Test-Presence "Workshop's $($plugin.Name) Plugin" $Want.Workshop $plugin.Library
}
Test-Presence 'Gateway' $Want.Gateway $gatewayExe
if (Test-Path -LiteralPath $config) { Fail "the install must leave the Gateway config to the Gateway's first start, but $config exists" }
$downloaded = @(Get-ModelFiles)
Expand All @@ -278,17 +284,20 @@ function Test-Selection($Want) {
if ($output -ne $check.Expected) { Fail "$($check.Exe) --version printed '$output', required '$($check.Expected)'" }
}

# Workshop loads the std Plugin it installed, which holds the file tools.
# Workshop loads the Plugins it installed: std, which holds the file
# tools, and bashkit, which holds the shell.
# The pipe matters: Workshop is a windowed program, and PowerShell waits
# for one, and reads its output, only when that output is piped.
if ($Want.Workshop) {
$stderr = Join-Path $logs 'plugins.stderr.log'
$listed = (& $workshopExe --plugins 2>$stderr | Out-String).Trim()
if ($listed -notmatch '(?m)^std \d') {
$reason = if (Test-Path -LiteralPath $stderr) { (Get-Content -LiteralPath $stderr -Raw) } else { '' }
Fail "$workshopExe --plugins must list the std Plugin; it printed '$listed' and exited $LASTEXITCODE. stderr: $reason"
foreach ($plugin in $plugins) {
if ($listed -notmatch "(?m)^$($plugin.Name) \d") {
$reason = if (Test-Path -LiteralPath $stderr) { (Get-Content -LiteralPath $stderr -Raw) } else { '' }
Fail "$workshopExe --plugins must list the $($plugin.Name) Plugin; it printed '$listed' and exited $LASTEXITCODE. stderr: $reason"
}
}
Write-Host "cell: Workshop loads its std Plugin ($listed)"
Write-Host "cell: Workshop loads its Plugins ($($listed -replace '\s+', ' '))"
}

# 4. Workshop serves its page, attached to the installed Gateway when
Expand Down
47 changes: 29 additions & 18 deletions .github/installers/cell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,22 @@ case "$system" in
root=${CELL_ROOT:-/Applications/Runvil}
workshop_item="$root/Runvil.app"
workshop_exe="$workshop_item/Contents/MacOS/runvil-workshop"
# The std Plugin's library rides inside Workshop's bundle, so the
# updater, which replaces the bundle, replaces it too.
std_plugin="$workshop_item/Contents/Resources/plugins/libplugin_std.dylib"
# The libraries of the std Plugin and the bashkit Plugin ride inside
# Workshop's bundle, so the updater, which replaces the bundle,
# replaces them too.
plugin_dir="$workshop_item/Contents/Resources/plugins"
plugin_suffix=dylib
gateway_item="$root/Runvil Gateway.app"
gateway_exe="$gateway_item/Contents/MacOS/runvil-gateway"
;;
Linux)
root=${CELL_ROOT:-$HOME/Runvil}
workshop_item="$root/Runvil.AppImage"
workshop_exe=$workshop_item
# The std Plugin's library rides inside the AppImage; step 6 looks
# for it there.
std_plugin=""
# The Plugins' libraries ride inside the AppImage; step 6 looks for
# them there.
plugin_dir=""
plugin_suffix=so
gateway_item="$root/runvil-gateway"
gateway_exe=$gateway_item
;;
Expand Down Expand Up @@ -180,9 +183,12 @@ check_presence() {
fi
}
check_presence Workshop "$want_workshop" "$workshop_item"
# The std Plugin's library installs with Workshop, inside its bundle, and
# The Plugins' libraries install with Workshop, inside its bundle, and
# nothing installs a Plugin directory beside it.
[ -z "$std_plugin" ] || check_presence "Workshop's std Plugin" "$want_workshop" "$std_plugin"
for plugin in std bashkit; do
[ -z "$plugin_dir" ] ||
check_presence "Workshop's $plugin Plugin" "$want_workshop" "$plugin_dir/libplugin_$plugin.$plugin_suffix"
done
check_presence "a Plugin directory beside Workshop" 0 "$root/plugins"
check_presence Gateway "$want_gateway" "$gateway_item"
if [ "$system" = Linux ]; then
Expand Down Expand Up @@ -216,18 +222,21 @@ check_version() {
[ "$want_workshop" = 0 ] || check_version "$workshop_exe" "runvil-workshop $version"
[ "$want_gateway" = 0 ] || check_version "$gateway_exe" "runvil-gateway $gateway_version"

# Workshop loads the std Plugin it ships with, which holds the file tools.
# Workshop loads the Plugins it ships with: std, which holds the file
# tools, and bashkit, which holds the shell.
check_plugins() {
local output
local output plugin
if ! output=$("$workshop_exe" --plugins 2>"$logs/plugins.stderr.log"); then
tail -n 20 "$logs/plugins.stderr.log" >&2
fail "$workshop_exe --plugins failed; full output in $logs/plugins.stderr.log"
fi
if ! echo "$output" | grep -Eq '^std [0-9]'; then
tail -n 20 "$logs/plugins.stderr.log" >&2
fail "$workshop_exe --plugins must list the std Plugin; it printed '$output'"
fi
echo "cell: Workshop loads its std Plugin ($output)"
for plugin in std bashkit; do
if ! echo "$output" | grep -Eq "^$plugin [0-9]"; then
tail -n 20 "$logs/plugins.stderr.log" >&2
fail "$workshop_exe --plugins must list the $plugin Plugin; it printed '$output'"
fi
done
echo "cell: Workshop loads its Plugins ($(echo "$output" | tr '\n' ' '))"
}
[ "$want_workshop" = 0 ] || check_plugins

Expand Down Expand Up @@ -364,10 +373,12 @@ if [ "$system" = Linux ] && [ "$want_workshop" = 1 ]; then
# Workshop looks for its Plugin directory from usr/bin, where it runs.
[ -f "$extracted/squashfs-root/usr/bin/runvil-workshop" ] ||
fail "the AppImage lacks usr/bin/runvil-workshop, which the Plugin directory lookup starts from"
[ -f "$extracted/squashfs-root/usr/lib/runvil/plugins/libplugin_std.so" ] ||
fail "the AppImage lacks usr/lib/runvil/plugins/libplugin_std.so"
for plugin in std bashkit; do
[ -f "$extracted/squashfs-root/usr/lib/runvil/plugins/libplugin_$plugin.$plugin_suffix" ] ||
fail "the AppImage lacks usr/lib/runvil/plugins/libplugin_$plugin.$plugin_suffix"
done
rm -rf "$extracted"
echo "cell: the AppImage carries its GStreamer audio plugins and the std Plugin"
echo "cell: the AppImage carries its GStreamer audio plugins and Workshop's Plugins"
fi

echo "cell: $selection passed"
1 change: 1 addition & 0 deletions .github/workflows/installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ on:
- crates/workshop/desktop/tauri*.conf.json
- crates/workshop/desktop/icons/**
- crates/workshop/plugin-std/**
- crates/workshop/plugin-bashkit/**
- crates/workshop/package.json
- crates/workshop/package-lock.json
- crates/workshop/gateway-discovery/src/**
Expand Down
Loading
Loading