Ask Dev Updater for the checkout, not for the app inside it
Dev Updater's unit is a project -- a directory in a checkout -- that produces components, so this declaration belongs at the repository root where it can say where each half lives. `cwd` is how a component says that, and it is what the old file was working around: sitting in `app/`, it reached the backend with `../server/Cargo.toml` and `../server/service`, which described the layout backwards. So the file says what this repository produces: the backend, built and serviced in `server/`, and then the APK, built in `app/`. The order is unchanged and still the point -- a failing APK build leaves the phone the APK it already had rather than half of a matched pair. The service script gains dev-updater's note about lingering. A user service stops at logout unless `loginctl enable-linger` is set, which for this one matters more than for a build server: the phone reaches ai-server whether or not anyone is logged in at the desk. **This changes the project path, so the phone's existing entry (at ~/repos/ai-app/app) has to be removed and the checkout root added instead**, and its components accepted once. Verified against dev-updater's current parser rather than by reading its schema: the declaration loads, `cargo build --release` resolves into server/, app/build-apk.sh into app/, the service script to an absolute path, and APK discovery from the root still finds the built APK. `./server/service status` prints not-installed and exits 0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xn8nHw1tw1R6PtiY1eEtw
This commit is contained in:
1 parent
19de699bfa
commit
5f8a2146e6
3 files changed
+43
-22
No files matched your search
@@ -0,0 +1,33 @@
|
|||||||
|
// Read by Dev Updater. Structured as the body of the config: no outer
|
||||||
|
// parentheses, so nothing here is indented for the sake of a wrapper.
|
||||||
|
//
|
||||||
|
// This file sits at the checkout root because the project Dev Updater
|
||||||
|
// serves is the whole repository -- one checkout producing two things.
|
||||||
|
// Each component says where it lives with `cwd`, relative to this
|
||||||
|
// directory, rather than one of them reaching out of the other with `../`.
|
||||||
|
|
||||||
|
// What to call this project before there is a build to read a label from.
|
||||||
|
// A built APK wins: it is the authority on what will actually install.
|
||||||
|
label: "AI Sessions",
|
||||||
|
|
||||||
|
// Walked in order, and the order is the point: the backend is built and
|
||||||
|
// delivered first, so a failing APK build leaves the phone the APK it
|
||||||
|
// already had rather than half of a matched pair.
|
||||||
|
components: [
|
||||||
|
Server(
|
||||||
|
name: "backend",
|
||||||
|
build: "cargo build --release",
|
||||||
|
cwd: "server",
|
||||||
|
// Installs into whichever user-service manager is here, and is how
|
||||||
|
// ai-server is started, stopped and asked about. See the script.
|
||||||
|
service: "server/service",
|
||||||
|
),
|
||||||
|
Apk(
|
||||||
|
name: "app",
|
||||||
|
// Resolved against this directory, and run in `app/` -- the script
|
||||||
|
// cds to its own directory anyway, so the cwd is here to say where
|
||||||
|
// the app is rather than because the build needs it.
|
||||||
|
build: "app/build-apk.sh",
|
||||||
|
cwd: "app",
|
||||||
|
),
|
||||||
|
],
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
// Read by Dev Updater. Structured as the body of the config: no outer
|
|
||||||
// parentheses, so nothing here is indented for the sake of a wrapper.
|
|
||||||
|
|
||||||
label: "AI Sessions",
|
|
||||||
|
|
||||||
// The server is built and delivered before the APK: if the APK build then
|
|
||||||
// fails, the phone keeps being offered the one it already had rather than
|
|
||||||
// half of a matched pair.
|
|
||||||
components: [
|
|
||||||
Server(
|
|
||||||
name: "backend",
|
|
||||||
build: "cargo build --release --manifest-path ../server/Cargo.toml",
|
|
||||||
// Installs into whichever user-service manager is here, and is how
|
|
||||||
// this server is started, stopped and asked about. See the script.
|
|
||||||
service: "../server/service",
|
|
||||||
),
|
|
||||||
Apk(
|
|
||||||
name: "app",
|
|
||||||
build: "./build-apk.sh",
|
|
||||||
),
|
|
||||||
]
|
|
||||||
+10
-1
@@ -3,6 +3,12 @@
|
|||||||
# drive from the phone -- and for you to drive by hand, which is the same
|
# drive from the phone -- and for you to drive by hand, which is the same
|
||||||
# thing.
|
# thing.
|
||||||
#
|
#
|
||||||
|
# Declared as the Server component of this checkout in `.dev-updater.ron`
|
||||||
|
# at the repository root, so the card drives it like any other project's.
|
||||||
|
# One button is worth knowing about before pressing it: on a phone that
|
||||||
|
# reaches ai-server through the tunnel rather than through Dev Updater,
|
||||||
|
# Stop leaves this server down until someone starts it again here.
|
||||||
|
#
|
||||||
# ./service install | uninstall | start | stop | restart | status
|
# ./service install | uninstall | start | stop | restart | status
|
||||||
#
|
#
|
||||||
# `status` prints exactly one of `running`, `stopped` or `not-installed`
|
# `status` prints exactly one of `running`, `stopped` or `not-installed`
|
||||||
@@ -16,7 +22,10 @@
|
|||||||
# with a message telling you to run it yourself once instead.
|
# with a message telling you to run it yourself once instead.
|
||||||
#
|
#
|
||||||
# User services on purpose: a system unit needs root to install, and a
|
# User services on purpose: a system unit needs root to install, and a
|
||||||
# build machine's own account is where a dev server belongs.
|
# build machine's own account is where a dev server belongs. Note that a
|
||||||
|
# user service stops at logout unless lingering is enabled
|
||||||
|
# (`loginctl enable-linger $USER`), which you want for this one: the phone
|
||||||
|
# reaches this server whether or not anyone is logged in at the desk.
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
|||||||
Reference in new issue
Block a user