Attribute world commits to conversations and restore temporary directories
This commit is contained in:
@@ -349,6 +349,15 @@ impl Runtime {
|
||||
.env
|
||||
.push(("PATH".into(), "/usr/local/bin:/bin".into()));
|
||||
}
|
||||
// Keep process attribution aligned with the nearest conversation, including children.
|
||||
if let Some(conversation) = conversations.first() {
|
||||
request
|
||||
.env
|
||||
.retain(|(name, _)| name != "SAUSAGE_CONVERSATION");
|
||||
request
|
||||
.env
|
||||
.push(("SAUSAGE_CONVERSATION".into(), conversation.clone()));
|
||||
}
|
||||
request.cwd = sausage_vfs::resolve("/", &request.cwd);
|
||||
request.env.retain(|(name, _)| name != "PWD");
|
||||
request.env.push(("PWD".into(), request.cwd.clone()));
|
||||
|
||||
@@ -42,6 +42,7 @@ impl World {
|
||||
}
|
||||
|
||||
/// Copy an optional bundle into a new world. Existing worlds retain their programs.
|
||||
/// Ensure `/tmp`, `/run`, and `/var/tmp` exist on every startup.
|
||||
/// Each `.wasm` tool keeps its independent file and gains a relative `/bin/<name>` symlink.
|
||||
/// `/dev` exposes generated null, zero, and random byte devices in every world.
|
||||
/// Missing `/etc/gitconfig` defaults to Sausage <sausage@localhost>. Local repository config overrides it.
|
||||
@@ -50,6 +51,9 @@ impl World {
|
||||
let host_dir = dir.join("host");
|
||||
let fresh = !root_dir.exists();
|
||||
std::fs::create_dir_all(root_dir.join("usr/local/bin"))?;
|
||||
for path in ["tmp", "run", "var/tmp"] {
|
||||
std::fs::create_dir_all(root_dir.join(path))?;
|
||||
}
|
||||
if fresh && let Some(bundle) = userland {
|
||||
for folder in ["bin", "src"] {
|
||||
copy_tree(&bundle.join(folder), &root_dir.join(folder))?;
|
||||
|
||||
Reference in New Issue
Block a user