@@ -2,7 +2,6 @@ use anyhow::Result;
22use clap:: { Parser , Subcommand } ;
33use hyperlight_nanvix:: { cache, RuntimeConfig , Sandbox } ;
44use nanvix:: log;
5- use nanvix:: registry:: Registry ;
65use std:: path:: PathBuf ;
76
87/// A Hyperlight VMM wrapper with out-of-the-box support for running Nanvix microkernel guests
@@ -39,42 +38,40 @@ const DEFAULT_LOG_LEVEL: &str = "info";
3938async fn setup_registry_command ( ) -> Result < ( ) > {
4039 println ! ( "Setting up Nanvix registry..." ) ;
4140
42- // Check cache status first using shared cache utilities
41+ // Check cache status first using local filesystem probes
4342 let kernel_cached = cache:: is_binary_cached ( "kernel.elf" ) ;
4443 let qjs_cached = cache:: is_binary_cached ( "qjs" ) ;
4544 let python_cached = cache:: is_binary_cached ( "python3" ) ;
4645
4746 if kernel_cached && qjs_cached && python_cached {
4847 println ! ( "Registry already set up at ~/.cache/nanvix-registry/" ) ;
4948 } else {
50- // Trigger registry download by requesting key binaries
51- let registry = Registry :: new ( None ) ;
52-
49+ // Download missing binaries via get_cached_binary_path (local first, registry fallback)
5350 if !kernel_cached {
5451 print ! ( "Downloading kernel.elf... " ) ;
55- let _kernel = registry
56- . get_cached_binary ( "hyperlight" , "single-process" , "kernel.elf" )
57- . await ?;
52+ cache :: get_cached_binary_path ( "kernel.elf" )
53+ . await
54+ . ok_or_else ( || anyhow :: anyhow! ( "Failed to download kernel.elf" ) ) ?;
5855 println ! ( "done" ) ;
5956 } else {
6057 println ! ( "kernel.elf already cached" ) ;
6158 }
6259
6360 if !qjs_cached {
6461 print ! ( "Downloading qjs binary... " ) ;
65- let _qjs = registry
66- . get_cached_binary ( "hyperlight" , "single-process" , "qjs" )
67- . await ?;
62+ cache :: get_cached_binary_path ( "qjs" )
63+ . await
64+ . ok_or_else ( || anyhow :: anyhow! ( "Failed to download qjs" ) ) ?;
6865 println ! ( "done" ) ;
6966 } else {
7067 println ! ( "qjs already cached" ) ;
7168 }
7269
7370 if !python_cached {
7471 print ! ( "Downloading python3 binary... " ) ;
75- let _python = registry
76- . get_cached_binary ( "hyperlight" , "single-process" , "python3" )
77- . await ?;
72+ cache :: get_cached_binary_path ( "python3" )
73+ . await
74+ . ok_or_else ( || anyhow :: anyhow! ( "Failed to download python3" ) ) ?;
7875 println ! ( "done" ) ;
7976 } else {
8077 println ! ( "python3 already cached" ) ;
0 commit comments