Closed Manosgou closed 11 months ago
Thank you for the report. Unfortunately I don't easily have a Windows machine to test on, and there's no logic in ormlite that is conditional on os.
Can you try running cargo expand
on the project from the windows machine and share the output?
I haven't used cargo expand before, but the output doesn't show something special. I ran the command only for the models.rs file with only the Model derive. Am i doing something wrong?
mod models {
use ormlite::model::Model;
use serde::{Deserialize, Serialize};
#[ormlite(table = "EventType")]
pub struct EventType {
pub id: Option<u32>,
pub name: String,
pub color: String,
}
}
I wouldn't expect the latter code example to compile. You don't have the #[derive(Model)]
attribute on that struct.
Of course, because it panics as soon as the cargo expand command is executed.
PS C:\Users\<User>\Desktop\<ProjectName>\src-tauri> cargo expand models
Blocking waiting for file lock on build directory
Checking <ProjectName>v0.0.0 (C:\Users\<User>\Desktop\<ProjectName>\src-tauri)
error: proc-macro derive panicked
--> src\models.rs:13:10
|
13 | #[derive(Model)]
| ^^^^^
|
= help: message: Unexpected token in derive attribute: Punct { char: ':', spacing: Joint, span: #82 bytes(26778..26783) }
error: proc-macro derive panicked
mod models {
use ormlite::model::Model;
use serde::{Deserialize, Serialize};
#[ormlite(table = "EventType")]
pub struct EventType {
pub id: Option<u32>,
pub name: String,
pub color: String,
}
}
That's strange. Would you be able to create a mini repo with repro steps? If I can run the expand myself, even if it's on Mac, I might be able to debug what's happening.
I spun up a Windows VM in Parallels (I'm on Mac), and I was able to run cargo build
for that project in both Windows and on Mac. Can you be more specific about how you're encountering the error?
On Windows, i was on win 11, Visual Studio 2022, and rust 1.74.
I think there is something wrong with my Windows build and the problem is not related to the library. Anyway, I used github actions to compile the Windows version of my app without any issues. Thank you for your time and great work with ormlite, it's a fantastic tool.
Happy to help. LMK if you encounter other issues.
I am creating a Tauri application using the ormlite library to manage a sqlite database. I started developing the application in mac os environment without any problem. However, recently I tried to run the application on windows without success. The following error occurs in all database models.
Ormlite version :"0.17.5"