Skip to content

Conversation

@adamspofford-dfinity
Copy link
Contributor

No description provided.

@adamspofford-dfinity adamspofford-dfinity marked this pull request as ready for review February 12, 2026 19:09
@adamspofford-dfinity adamspofford-dfinity requested a review from a team as a code owner February 12, 2026 19:09
Comment on lines 24 to 26
} else {
format!("v{version}")
version.to_owned()
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else if version.starts_with('v') {
    version.to_owned()
} else {
    format!("v{version}")
};

The v-prefix normalization currently lives only in the From<Mode> for Configuration impl in mod.rs. If cache.rs is ever called from a different path (or someone constructs a ManagedLauncherConfig directly with a bare version like "12.0.0"), it’ll look up the wrong cache directory and try to download a nonexistent release. Can we add defensive normalization here too?

Copy link
Contributor Author

@adamspofford-dfinity adamspofford-dfinity Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My goal here was to avoid needing defensive normalization everywhere that touches the version including adding it to new places that touch it, and instead pipeline it through exactly one spot.

When we deal with the config, it's always in canonical form, but when it's altered by the user, it's always in manifest form; performing things like this is a lot of the point of having the two forms, you similarly don't need more than one place in the code that fills in the default value for an optional field. I don't see the harm in adding an assertion, but I think accommodating it as a code path is defeating the point of the normalization.

Comment on lines 71 to 73
} else {
format!("v{version_req}")
version_req.to_owned()
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else if version.starts_with('v') {
    version.to_owned()
} else {
    format!("v{version}")
};

Same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants