Skip to content

Commit

Permalink
[WIP] Write errors to temp file
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy committed Dec 23, 2024
1 parent 0e9530d commit 4a29aee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ jobs:
# more disk space, so much so that it can cause the run to fail
- name: Run tests
run: cargo test --all --release
- name: Show errors
if: always()
run: |
cat /tmp/brioche-error.log || echo "no error log"
build:
name: Build artifacts
if: github.event_name == 'push'
Expand Down
11 changes: 10 additions & 1 deletion crates/brioche-core/src/sandbox/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,16 @@ pub fn run_sandbox(exec: super::SandboxExecutionConfig) -> anyhow::Result<super:
Ok(())
};

move || before_chroot().inspect_err(|error| eprintln!("before_chroot error: {error}"))
move || {
before_chroot().inspect_err(|error| {
use std::io::Write as _;
let file = std::fs::OpenOptions::new()
.create(true)
.append(true)
.open("/tmp/brioche-error.log");
let _ = file.and_then(|mut file| writeln!(file, "before_chroot error: {error:#}"));
})
}
});

let mut child = command
Expand Down

0 comments on commit 4a29aee

Please sign in to comment.