Repository navigation
Conversation
b23ef23 to
1667c27
Compare
1aa18de to
58e39cc
Compare
Adds an explicit environment (env) subcommand which allows users to list and interact with existing build / test environments. Additionally contains extensive internal refactoring to make the environment tracking and cleanup more robust.
58e39cc to
e17b3c1
Compare
| owner_pid_start INTEGER, | ||
| destroying INTEGER NOT NULL DEFAULT 0, | ||
| driver_metadata TEXT NOT NULL DEFAULT '{}' | ||
| ); |
| ); | ||
| CREATE TABLE attachments ( | ||
| id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
| environment_id TEXT NOT NULL REFERENCES environments(id) ON DELETE CASCADE, |
There was a problem hiding this comment.
then we need PRAGMA foreign key checks
| system_sqlite = "bundled-sqlite = []" | ||
|
|
||
|
|
||
| def use_system_sqlite() -> str: |
There was a problem hiding this comment.
uuh there must be a better way, since we only want to change a feature flag. maybe feature flags can be set somehow differentlly (env? cli?)
|
|
||
| - **Isolated builds without the setup**: `debmagic build binary` builds a `debian/`-packaged source tree in a temporary container (using LXD, Incus, Docker) | ||
| - **Fast iteration**: `--persistent`/`--incremental` reuse the environment and sync only source changes; `--shell-on-failure` and `debmagic shell` drop you right where the build broke | ||
| - **Fast iteration**: `--persistent`/`--incremental` reuse the environment and sync only source changes; a failed build prints `debmagic env shell <id>` |
There was a problem hiding this comment.
you can analyze failures with devmagic env shell
There was a problem hiding this comment.
could call this environment.rs, or just env.rs - the _cmd is weird^^
There was a problem hiding this comment.
that file seems very verbose, maybe some better db adapter abstraction reduces the boilerplate. env management should start db transactions, then invoke functions for manipulation on the db abstraction. that separates data and env logic and hopefully helps?
cargo then pulls the deps right, as well as apt?
| let config = config::Config::load(None, cli.config.as_deref())?; | ||
| env_cmd::list_environments(&config)?; | ||
| } | ||
| EnvCommands::Clean { id, force } => { |
There was a problem hiding this comment.
we should have "rm"/"remove" for env removals (ala docker/lxd), and the clean for the automatic removals.
could oneday even be automatically removed after some time.
| @@ -0,0 +1,3 @@ | |||
| -- Persistence values in environments.persistent: 0 = no, 1 = always, 2 = on-failure. | |||
There was a problem hiding this comment.
reference the conversion functions?
also sad that sqlite has no enums.
| }; | ||
|
|
||
| use anyhow::{Context, anyhow, bail}; | ||
| use rusqlite::{Connection, OptionalExtension, TransactionBehavior, params}; |
There was a problem hiding this comment.
could we use https://docs.rs/sqlx/latest/sqlx/sqlite/index.html instead? then also the system sqlite problem could be resolved.
|
|
||
| /// A single signing invocation: what to sign and whether to send a desktop | ||
| /// notification just before the gpg touch prompt. | ||
| pub struct SignRequest<'a> { |
Adds an explicit environment (env) subcommand which allows users to list and interact with existing build / test environments.
Additionally contains extensive internal refactoring to make the environment tracking and cleanup more robust.