@@ -154,23 +154,32 @@ static std::string GenerateActiveRuntimeText(
154154 if (!runtime) {
155155 return std::format (" ❌ Active {} runtime: NONE\n " , archName);
156156 }
157-
158- if (!runtime->mName ) {
159- if (runtime->mName .error () != Runtime::ManifestError::FieldNotPresent) {
160- return std::format (
161- " 🚨 Active {} runtime: CORRUPTED - {}\n " ,
162- archName,
163- runtime->mPath .string ());
164- }
157+ const auto manifest = runtime->mManifestData ;
158+ if (!manifest) {
165159 return std::format (
166- " ✅ Active {} runtime: {}\n " , archName, runtime->mPath .string ());
160+ " ❌ Invalid {} manifest at `{}`: {}\n " ,
161+ archName,
162+ runtime->mPath .string (),
163+ magic_enum::enum_name (manifest.error ()));
164+ }
165+
166+ std::string out = runtime->mPath .string ();
167+ if (manifest->mName != runtime->mPath ) {
168+ out += std::format (" ()" , manifest->mName );
169+ }
170+
171+ bool ok = true ;
172+ if (manifest->mLibrarySignature ) {
173+ out += fmt::format (
174+ " (signed by '{}')" , manifest->mLibrarySignature ->mSignedBy );
175+ } else {
176+ ok = false ;
177+ out += fmt::format (
178+ " - 🚨 bad signature: {}" ,
179+ magic_enum::enum_name (manifest->mLibrarySignature .error ()));
167180 }
168181
169- return std::format (
170- " ✅ Active {} runtime: \" {}\" - {}\n " ,
171- archName,
172- runtime->mName .value (),
173- runtime->mPath .string ());
182+ return std::format (" {} {}\n " , ok ? " ✅" : " 🚨" , out);
174183}
175184
176185static std::string GenerateAvailableRuntimesText (
@@ -183,26 +192,17 @@ static std::string GenerateAvailableRuntimesText(
183192 }
184193
185194 for (auto && runtime: runtimes) {
186- if (runtime.mName ) {
195+ if (! runtime.mManifestData ) {
187196 ret += fmt::format (
188- " - \" {}\" - {}" , runtime.mName .value (), runtime.mPath .string ());
189- } else {
190- using enum Runtime::ManifestError;
191- switch (runtime.mName .error ()) {
192- case FieldNotPresent:
193- ret += fmt::format (" - {}" , runtime.mPath .string ());
194- break ;
195- case FileNotFound:
196- ret += fmt::format (" - ❌ FILE MISSING: {}" , runtime.mPath .string ());
197- break ;
198- case FileNotReadable:
199- case InvalidJson:
200- ret += fmt::format (
201- " - ❌ FILE NOT READABLE: {}" , runtime.mPath .string ());
202- break ;
203- }
197+ " - ❌ {}: 🚨 {}\n " ,
198+ runtime.mPath .string (),
199+ magic_enum::enum_name (runtime.mManifestData .error ()));
200+ continue ;
204201 }
205202
203+ ret += fmt::format (
204+ " - \" {}\" - {}" , runtime.mManifestData ->mName , runtime.mPath .string ());
205+
206206 switch (runtime.mDiscoverability ) {
207207 case AvailableRuntime::Discoverability::Discoverable:
208208 ret += " (discoverable)\n " ;
0 commit comments