You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've inherited a project and I'm trying to compile and use it on Linux instead of MacOS.
There are several such declarations:
pub static ROLE_CHANGED_SERVER_EVENTS_LIST: [fn(&Context, ServerRole)] = [..];
Which are subsequently called thusly:
extern "C" fn role_changed_callback(
ctx: *mut raw::RedisModuleCtx,
_eid: raw::RedisModuleEvent,
subevent: u64,
_data: *mut ::std::os::raw::c_void,
) {
let new_role = if subevent == raw::REDISMODULE_EVENT_REPLROLECHANGED_NOW_MASTER {
ServerRole::Primary
} else {
ServerRole::Replica
};
let ctx = Context::new(ctx);
ROLE_CHANGED_SERVER_EVENTS_LIST.iter().for_each(|callback| {
callback(&ctx, new_role);
});
}
All of this works fine under MacOS, but when we try to load the module in Linux we receive an error that the following symbol is missing:
__start_linkme_ROLE_CHANGED_SERVER_EVENTS_LIST
Thanks
The text was updated successfully, but these errors were encountered:
If it helps. The problem seems to be related to building using the nightly toolchain. I build with the stable toolchain and everything works fine, when I build with the nightly toolchain I get this error.
I've inherited a project and I'm trying to compile and use it on Linux instead of MacOS.
There are several such declarations:
pub static ROLE_CHANGED_SERVER_EVENTS_LIST: [fn(&Context, ServerRole)] = [..];
Which are subsequently called thusly:
extern "C" fn role_changed_callback(
ctx: *mut raw::RedisModuleCtx,
_eid: raw::RedisModuleEvent,
subevent: u64,
_data: *mut ::std::os::raw::c_void,
) {
let new_role = if subevent == raw::REDISMODULE_EVENT_REPLROLECHANGED_NOW_MASTER {
ServerRole::Primary
} else {
ServerRole::Replica
};
let ctx = Context::new(ctx);
ROLE_CHANGED_SERVER_EVENTS_LIST.iter().for_each(|callback| {
callback(&ctx, new_role);
});
}
All of this works fine under MacOS, but when we try to load the module in Linux we receive an error that the following symbol is missing:
__start_linkme_ROLE_CHANGED_SERVER_EVENTS_LIST
Thanks
The text was updated successfully, but these errors were encountered: