Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsql: Fix build on older Rust toolchains #1870

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

penberg
Copy link
Collaborator

@penberg penberg commented Dec 6, 2024

The JavaScript SDK is unfortunately stuck with Rust 1.78:

tursodatabase/libsql-js#104

We should fix that, but since that's hard, let's just once again paper over it by fixing build on older Rust toolchains.

@@ -309,7 +309,7 @@ impl SyncContext {
async fn read_metadata(&mut self) -> Result<()> {
let path = format!("{}-info", self.db_path);

if !std::fs::exists(&path).map_err(SyncError::io("metadata file exists"))? {
if !Path::new(&path).exists() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This hides potential errors. Is there an API that does not hide them and works for older build?

Copy link
Contributor

Choose a reason for hiding this comment

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

try_exists seems to do the job and is there since 1.63

The JavaScript SDK is unfortunately stuck with Rust 1.78:

tursodatabase/libsql-js#104

We should fix that, but since that's hard, let's just once again paper
over it by fixing build on older Rust toolchains.
@penberg penberg force-pushed the fix-build-with-old-toolchain branch from 99bccec to 7ddc4f9 Compare December 6, 2024 09:38
@penberg penberg added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit b8f30ff Dec 6, 2024
19 checks passed
@penberg penberg deleted the fix-build-with-old-toolchain branch December 6, 2024 11:48
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.

2 participants