fix: change bin mount path to /tmp/mire/bin

This commit is contained in:
2026-03-22 17:17:12 +00:00
parent de536cddc1
commit a236765060
3 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -8,6 +8,6 @@
# read only paths from host, entry looks like "path on host:path on sanbox" # read only paths from host, entry looks like "path on host:path on sanbox"
# paths on host are absolute or relative to repo root # paths on host are absolute or relative to repo root
mounts = [] mounts = []
# read only host paths to expose on PATH inside the sandbox as /mire/bin/<basename> # read only host paths to expose on PATH inside the sandbox as /tmp/mire/bin/<basename>
# paths on host can be absolute or relative to repo root # paths on host can be absolute or relative to repo root
paths = [] paths = []
+4 -3
View File
@@ -8,7 +8,7 @@ visible_home=${MIRE_HOME:?}
bootstrap_rc="$host_home/.mire-shell-rc" bootstrap_rc="$host_home/.mire-shell-rc"
visible_bootstrap_rc="$visible_home/.mire-shell-rc" visible_bootstrap_rc="$visible_home/.mire-shell-rc"
setup_scripts_dir='/tmp/mire-setup-scripts' setup_scripts_dir='/tmp/mire-setup-scripts'
visible_bin_dir='/mire/bin' visible_bin_dir='/tmp/mire/bin'
cat >"$bootstrap_rc" <<'EOF' cat >"$bootstrap_rc" <<'EOF'
cd "${HOME:?}" cd "${HOME:?}"
@@ -35,11 +35,10 @@ if [ "${MIRE_COMPARE_MARKER:-0}" = "1" ]; then
fi fi
EOF EOF
# the first ro-bind allows for /usr/bin etc to be mounted and accessible
set -- \ set -- \
--ro-bind / / \ --ro-bind / / \
--tmpfs /home \ --tmpfs /home \
--tmpfs /mire \
--dir "$visible_bin_dir" \
--bind "$host_home" "$visible_home" \ --bind "$host_home" "$visible_home" \
--bind "$host_tmp" '/tmp' \ --bind "$host_tmp" '/tmp' \
--dev /dev \ --dev /dev \
@@ -58,6 +57,8 @@ set -- \
--setenv TZ 'UTC' \ --setenv TZ 'UTC' \
--chdir "$visible_home" --chdir "$visible_home"
set -- "$@" --dir /tmp/mire --dir "$visible_bin_dir"
if [ -n "${MIRE_SETUP_SCRIPTS:-}" ]; then if [ -n "${MIRE_SETUP_SCRIPTS:-}" ]; then
i=1 i=1
while IFS= read -r host_path || [ -n "$host_path" ]; do while IFS= read -r host_path || [ -n "$host_path" ]; do
+3 -3
View File
@@ -122,7 +122,7 @@ func TestBuildRecordShellScriptUsesExpectedCommands(t *testing.T) {
"visible_home=${MIRE_HOME:?}", "visible_home=${MIRE_HOME:?}",
"bootstrap_rc=\"$host_home/.mire-shell-rc\"", "bootstrap_rc=\"$host_home/.mire-shell-rc\"",
"setup_scripts_dir='/tmp/mire-setup-scripts'", "setup_scripts_dir='/tmp/mire-setup-scripts'",
"visible_bin_dir='/mire/bin'", "visible_bin_dir='/tmp/mire/bin'",
"visible_bootstrap_rc=\"$visible_home/.mire-shell-rc\"", "visible_bootstrap_rc=\"$visible_home/.mire-shell-rc\"",
"for path in /tmp/mire-setup-scripts/*.sh; do", "for path in /tmp/mire-setup-scripts/*.sh; do",
"source \"$path\"", "source \"$path\"",
@@ -145,8 +145,6 @@ func TestBuildRecordShellScriptUsesExpectedCommands(t *testing.T) {
`if [ "${MIRE_COMPARE_MARKER:-0}" = "1" ]; then`, `if [ "${MIRE_COMPARE_MARKER:-0}" = "1" ]; then`,
"printf '__MIRE_PROMPT_READY__\\n'", "printf '__MIRE_PROMPT_READY__\\n'",
"PROMPT_COMMAND=__mire_prompt_ready", "PROMPT_COMMAND=__mire_prompt_ready",
"--tmpfs /mire",
"--dir \"$visible_bin_dir\"",
"--bind \"$host_home\" \"$visible_home\"", "--bind \"$host_home\" \"$visible_home\"",
"--bind \"$host_tmp\" '/tmp'", "--bind \"$host_tmp\" '/tmp'",
"--setenv HOME \"$visible_home\"", "--setenv HOME \"$visible_home\"",
@@ -155,6 +153,8 @@ func TestBuildRecordShellScriptUsesExpectedCommands(t *testing.T) {
"--setenv TERM 'xterm-256color'", "--setenv TERM 'xterm-256color'",
"--setenv TZ 'UTC'", "--setenv TZ 'UTC'",
"--chdir \"$visible_home\"", "--chdir \"$visible_home\"",
"--dir /tmp/mire",
"--dir \"$visible_bin_dir\"",
"exec bwrap \"$@\" bash --noprofile --rcfile \"$visible_bootstrap_rc\" -i", "exec bwrap \"$@\" bash --noprofile --rcfile \"$visible_bootstrap_rc\" -i",
} { } {
if !strings.Contains(body, want) { if !strings.Contains(body, want) {