jdx/mise · error
non-strict resolve is infallible
Error message
non-strict resolve is infallible
What it means
`.expect("non-strict resolve is infallible")` asserts that `resolve_managers(requests, options, false)` — i.e. resolution in non-strict mode — can never return `Err`. If it does, the assumption about non-strict mode's error behavior is broken (e.g. a code change made non-strict resolution fallible) and the process panics.
Solutions
- Restore the invariant: make non-strict mode log-and-skip instead of returning Err
- Change this call site to propagate the Result instead of expect-ing
- If an error appears at runtime, check which manager/package input triggers it and fix the non-strict handling in resolve_managers
Example fix
// before
resolve_managers(requests, options, false).expect("non-strict resolve is infallible")
// after
resolve_managers(requests, options, false).unwrap_or_else(|e| {
warn!("skipping manager resolution failure: {e}");
Vec::new()
}) Defensive patterns
Strategy: try-catch
Try / catch
match resolve_managers(requests, options, false) {
Ok(managers) => managers,
Err(e) => { warn!("non-strict resolve failed: {e}"); Vec::new() }
} Prevention
- Keep non-strict mode side-effect-free on error: skip and log
- Add a regression test asserting non-strict resolve returns Ok for malformed inputs
- When changing resolve_managers, grep for expect call sites
When it happens
Trigger: Calling `resolve_managers_from_config_files` (src/system/mod.rs:668) after a refactor where non-strict mode now returns Err (e.g. missing manager binary or unparseable package spec no longer tolerated).
Common situations: Contributors changing `resolve_managers` error semantics without updating this call site; new failure classes (network taps, unknown managers) leaking into non-strict mode.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- affected project exists in graph
- an operation record always has an operation
- attestation requests must not have a streaming body
- bootstrap command is registered
- BootstrapPart values have clap names
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/0d4c7e94b92b4542.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/mod.rs:668
}
}
}
}
}
/// Aggregate `[bootstrap.packages]` across a specific set of config files.
pub(crate) fn packages_from_config_files(config_files: &ConfigMap) -> Vec<ManagerPackages> {
packages_from_config_files_with_brew_taps(config_files, &IndexMap::new(), true)
}
fn packages_from_config_files_with_brew_taps(
config_files: &ConfigMap,
brew_taps: &IndexMap<String, String>,
filter_env: bool,
) -> Vec<ManagerPackages> {
let (requests, options) =
package_requests_from_config_files(config_files, brew_taps, filter_env);
resolve_managers(requests, options, false).expect("non-strict resolve is infallible")
}
fn package_requests_from_config_files(
config_files: &ConfigMap,
brew_taps: &IndexMap<String, String>,
filter_env: bool,
) -> (
IndexMap<String, Vec<PackageRequest>>,
IndexMap<String, ManagerPackageOptions>,
) {
let merged = package_configs_from_config_files(config_files);
let mut by_mgr: IndexMap<String, Vec<PackageRequest>> = IndexMap::new();
#[cfg(unix)]
let brew_adopt = brew_adopt_from_config_files(config_files);
#[cfg(unix)]
let mut cask_adopt = BTreeSet::new();
for (spec, package) in merged {
if !package.is_os_supported() {View on GitHub (pinned to 533346cc37)