Pin srt to a tested version; support only Pop!_OS 26.04 and later
srt is pinned to 0.0.83, the version the smoketest passed with. A computer with another version sees the agents item as to do in configure, which installs the pinned one. Move the pin only after smoketest/run 50 80 passes. The installer and configure stop on Pop!_OS (or Ubuntu) older than 26.04. The smoketest builds on Ubuntu 26.04, with checks that 24.04 is refused. 26.04's own AppArmor profile lets bubblewrap make user namespaces, so the connector's profile for it, and the code that offered to add it, are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,9 +36,8 @@ GNOME Settings), such as "Calendar, Files", and enable turns them back on.
|
||||
|
||||
attention exits 0 if Online Accounts marked the account as needing
|
||||
attention. It doesn't sign in, so it doesn't add to the server's count of
|
||||
failed logins. Online Accounts 3.50, which Pop!_OS 24.04 has, marks it for
|
||||
any failure, including a server it couldn't reach, so it's only a hint that
|
||||
the password may be wrong (see system/email-watch).
|
||||
failed logins. Online Accounts can mark it for any failure, including a
|
||||
server it couldn't reach, so it's only a hint that the password may be wrong (see system/email-watch).
|
||||
|
||||
pause empties the account's saved password, keeping its place in the keyring.
|
||||
Online Accounts signs in again whenever the network changes, and Evolution
|
||||
|
||||
@@ -11,6 +11,15 @@ is_pop() {
|
||||
[ "$(. /etc/os-release 2> /dev/null && echo "$ID")" = pop ]
|
||||
}
|
||||
|
||||
# Pop!_OS (or Ubuntu) older than 26.04, which the connector no longer supports
|
||||
os_too_old() {
|
||||
local id version
|
||||
id="$(. /etc/os-release 2> /dev/null && echo "$ID")"
|
||||
version="$(. /etc/os-release 2> /dev/null && echo "$VERSION_ID")"
|
||||
case "$id" in pop|ubuntu) ;; *) return 1 ;; esac
|
||||
[ -n "$version" ] && [ "$(printf '%s\n' 26.04 "$version" | sort -V | head -n 1)" != 26.04 ]
|
||||
}
|
||||
|
||||
os_name() {
|
||||
(. /etc/os-release 2> /dev/null && echo "${PRETTY_NAME:-$ID}") || uname -s
|
||||
}
|
||||
|
||||
@@ -4,11 +4,18 @@
|
||||
# sandbox. Source this file after lib/agents.sh; it uses
|
||||
# confirm_yes from configure.
|
||||
#
|
||||
# srt needs Node.js 22.12 or later, and Pop!_OS 24.04's is 18. So unless a
|
||||
# new enough one is installed already, the current long-term support release
|
||||
# is downloaded from nodejs.org into FC_TOOLS/node, checked against the
|
||||
# SHA-256 sums it publishes, and used only for srt: nothing in /usr or your
|
||||
# shell changes.
|
||||
# srt needs Node.js 22.12 or later, which Pop!_OS doesn't install. So unless
|
||||
# one is installed already (Pop!_OS 26.04's nodejs package is new enough), the
|
||||
# current long-term support release is downloaded from nodejs.org into
|
||||
# FC_TOOLS/node, checked against the SHA-256 sums it publishes, and used only
|
||||
# for srt: nothing in /usr or your shell changes.
|
||||
#
|
||||
# srt is pinned to a version the smoketest passed with: a new release once
|
||||
# broke opencode's sandbox on Pop!_OS. To move the pin, change SRT_VERSION,
|
||||
# run smoketest/run 50 80, and commit only if it passes. Computers that have
|
||||
# the old version see the agents item as to do in configure, which installs
|
||||
# the new one.
|
||||
SRT_VERSION=0.0.83
|
||||
|
||||
# srt needs Node.js 22.12 or later
|
||||
node_ok() {
|
||||
@@ -61,12 +68,30 @@ install_srt() {
|
||||
node_dir="$(dirname "$(PATH="$FC_TOOLS/node/bin:$PATH" command -v node)")"
|
||||
echo "Installing the sandbox runtime (srt) from npm..."
|
||||
PATH="$node_dir:$PATH" "$node_dir/npm" install --global --prefix "$FC_TOOLS/srt" \
|
||||
--no-fund --no-audit --ignore-scripts @anthropic-ai/sandbox-runtime > /dev/null
|
||||
--no-fund --no-audit --ignore-scripts "@anthropic-ai/sandbox-runtime@$SRT_VERSION" > /dev/null
|
||||
}
|
||||
|
||||
# The version of Federated Connector's own srt, or nothing
|
||||
srt_version() {
|
||||
jq -r '.version // empty' \
|
||||
"$FC_TOOLS/srt/lib/node_modules/@anthropic-ai/sandbox-runtime/package.json" 2> /dev/null
|
||||
}
|
||||
|
||||
# Federated Connector's own srt is installed, at the version it's pinned to
|
||||
srt_current() {
|
||||
[ "$(srt_version)" = "$SRT_VERSION" ] && srt_path > /dev/null
|
||||
}
|
||||
|
||||
# Updating srt is installing it again
|
||||
srt_ensure() {
|
||||
srt_path > /dev/null && return 0
|
||||
srt_current && return 0
|
||||
if [ -n "$(srt_version)" ]; then
|
||||
echo "The sandbox runtime (srt) is at $(srt_version); this version of Federated Connector"
|
||||
echo "was tested with $SRT_VERSION."
|
||||
confirm_yes "Install $SRT_VERSION?" || return 1
|
||||
install_srt
|
||||
return
|
||||
fi
|
||||
echo "The sandbox is Anthropic's sandbox runtime (srt), which runs on Node.js."
|
||||
node_ok || echo "This computer's Node.js is older than srt needs, so it gets its own, from nodejs.org."
|
||||
confirm_yes "Install it (into $FC_TOOLS)?" || return 1
|
||||
|
||||
Reference in New Issue
Block a user