valkey-io / valkeymodule-rs

Rust valkey SDK for modules
BSD 3-Clause "New" or "Revised" License
40 stars 10 forks source link

Fix compile time mismatched types error when running "cargo build --all --all-targets --release" #139

Open KarthikSubbarao opened 6 days ago

KarthikSubbarao commented 6 days ago

When running the command cargo build --all --all-targets --release, I see this error below. It is likely from the recent ACL change and should be a small change to fix the casting.

error[E0308]: mismatched types
   --> src/context/mod.rs:504:74
    |
504 |             let command = raw::RedisModule_GetCommand.unwrap()(self.ctx, command_name);
    |                           ------------------------------------           ^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
    |                           |
    |                           arguments to this function are incorrect
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

error[E0308]: mismatched types
   --> src/context/mod.rs:505:72
    |
505 |             raw::RedisModule_SetCommandACLCategories.unwrap()(command, acl_flags).into()
    |             -------------------------------------------------          ^^^^^^^^^ expected `*const u8`, found `*const i8`
    |             |
    |             arguments to this function are incorrect
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`
hahnandrew commented 2 days ago

@KarthikSubbarao If you have the time could you check if #143 fixes this build error?

dmitrypol commented 1 day ago

@KarthikSubbarao - did you run cargo build --all --all-targets --release on Windows to repro this?

KarthikSubbarao commented 1 day ago

Hello, I did not run the command on Windows. I can likely to doing so in a day or so

dmitrypol commented 20 hours ago

@KarthikSubbarao - so how did you repro this problem?