project-machine / puzzlefs

Apache License 2.0
378 stars 18 forks source link

Replace docker_extract with skopeo copy and umoci unpack #79

Closed ariel-miculas closed 1 year ago

ariel-miculas commented 1 year ago

ubuntu:latest is downloaded into $XDG_DATA_HOME/puzzlefs/ubuntu using skopeo copy.

If $XDG_DATA_HOME is missing or it's an empty string, then $HOME/.local/share is used.

Then umoci unpack is used to extract the image into a temporary directory.

Fixes #68

hallyn commented 1 year ago

Hm, with this change, when I run 'make check', I get:

mounted /dev/loop40 backed by /tmp/tmp.hXNkHjOxT5 at /tmp/tmp.iBOx98F3Nj

digest: 0f68130ec7b6d1eba27cd64c4dd71aa6e78569cba49ed42e2e3065702c31502c
fusermount3: failed to unmount /tmp/tmp.iBOx98F3Nj/mount: Device or resource busy
thread 'test_fs_verity' panicked at 'assertion failed: res.success()', exe/tests/verity.rs:39:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/panicking.rs:64:14
   2: core::panicking::panic
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/panicking.rs:111:5
   3: verity::fuser_umount
             at ./tests/verity.rs:39:13
   4: verity::test_fs_verity
             at ./tests/verity.rs:141:5
   5: verity::test_fs_verity::{{closure}}
             at ./tests/verity.rs:77:24
   6: core::ops::function::FnOnce::call_once
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/ops/function.rs:507:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/b28d30e1e3c2b90fd08b7dd79d8e63884d1e0339/library/core/src/ops/function.rs:507:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
unmounting: /tmp/tmp.iBOx98F3Nj, deleting blockdev /dev/loop40 and backing file /tmp/tmp.hXNkHjOxT5
umount: /tmp/tmp.iBOx98F3Nj: target is busy.
test test_fs_verity ... FAILED
hallyn commented 1 year ago

Ah - never mind, the failure was because umoci was in my ~/bin, not in /usr/bin.