Fix spacetime version list not showing current version#2680
Merged
Conversation
Collaborator
|
Oh, whoops. I think the actual root cause is in a different function - this should be a thorough fix. It does mean that the current version will have to be re-set for it to work. diff --git a/crates/paths/src/cli.rs b/crates/paths/src/cli.rs
index 28d26fb81..f39761c09 100644
--- a/crates/paths/src/cli.rs
+++ b/crates/paths/src/cli.rs
@@ -85,7 +85,7 @@ impl VersionBinDir {
}
fn link_to(&self, path: &Path) -> anyhow::Result<()> {
- let rel_path = path.strip_prefix(self).unwrap_or(path);
+ let rel_path = path.strip_prefix(self.0.parent().unwrap()).unwrap_or(path);
#[cfg(unix)]
{
// remove the link if it already exists |
Collaborator
Author
Ah okay! thanks for the better fix. Do you have any suggestions for how we fix this for people who already have SpacetimeDB installed? I guess it would just get quietly fixed the next time they upgrade? |
Collaborator
Yeah, that's the idea. |
jdetter
approved these changes
Jul 23, 2025
Shubham8287
pushed a commit
that referenced
this pull request
Jul 28, 2025
Co-authored-by: Zeke Foppa <[email protected]>
mamcx
pushed a commit
that referenced
this pull request
Aug 26, 2025
Co-authored-by: Zeke Foppa <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
See #2679.
At some point, this code was changed so that
currentcontains an entire path, rather than just the version string itself, so the comparison betweenverandcurrentwas always failing.This PR (following advice by @coolreader18) reverts that behavior so that
currentjust contains a relative dir. However, it also adds some behavior to thelistcommand, so that we gracefully handle the users who already have the symlinks with full paths.API and ABI breaking changes
Not a breaking change.
Expected complexity level and risk
1
Testing
I could be convinced to add a smoketest for this.