containers / krunvm

Create microVMs from OCI images
Apache License 2.0
1.41k stars 42 forks source link

Build failure on macOS, error[E0004]: non-exhaustive patterns: `Inspect` not covered #24

Closed c3d closed 2 years ago

c3d commented 2 years ago

Building on macOS with cargo 1.62.0 (a748cf5a3 2022-06-08), M1 machine, Monterey 12.5, main being commit 023c665e1bc845b02e063d42c273277935f07762, I get the following:

~/Work/krunvm [main]> cargo build
   Compiling libc v0.2.90
   Compiling proc-macro2 v1.0.24
   Compiling serde v1.0.124
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.64
   Compiling bitflags v1.2.1
   Compiling unicode-width v0.1.8
   Compiling cfg-if v0.1.10
   Compiling serde_derive v1.0.124
   Compiling vec_map v0.8.2
   Compiling ansi_term v0.11.0
   Compiling strsim v0.8.0
   Compiling krunvm v0.1.6 (/Users/ddd/Work/krunvm)
   Compiling text_io v0.1.8
   Compiling textwrap v0.11.0
   Compiling dirs-sys v0.3.5
   Compiling atty v0.2.14
   Compiling clap v2.33.3
   Compiling directories v2.0.2
   Compiling quote v1.0.9
   Compiling toml v0.5.8
   Compiling confy v0.4.0
error[E0004]: non-exhaustive patterns: `Inspect` not covered
  --> src/utils.rs:47:11
   |
47 |     match cmd {
   |           ^^^ pattern `Inspect` not covered
   |
note: `BuildahCommand` defined here
  --> src/utils.rs:12:5
   |
10 | pub enum BuildahCommand {
   |          --------------
11 |     From,
12 |     Inspect,
   |     ^^^^^^^ not covered
   = note: the matched value is of type `BuildahCommand`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
   |
66 ~         }
67 +         Inspect => todo!()
   |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `krunvm` due to previous error

The build error does not occur on Linux with cargo 1.59.0 (49d8809dc 2022-02-10) (Fedora 36).

c3d commented 2 years ago

Problem does not occur with slp/main, but that seems to be behind (last commit from July 5)

Bisecting from there gives me:

2285182aa254df8af86fca8f3e6e46a9c657418c is the first bad commit
commit 2285182aa254df8af86fca8f3e6e46a9c657418c
Author: Sergio Lopez <slp@redhat.com>
Date:   Thu Aug 4 15:02:38 2022 +0200

    Export container config on microVM creation

    libkrun's init/init.c is now able to read the workload parameters from
    an OCI config file. Use "buildah inspect" to obtain this configuration
    and write it to the expected location ("/.krun_config.json").

    Signed-off-by: Sergio Lopez <slp@redhat.com>

 src/create.rs | 40 ++++++++++++++++++++++++++++++++++++++++
 src/utils.rs  |  2 ++
 2 files changed, 42 insertions(+)