Skip to content

Commit

Permalink
fix: make sure all needed libs are required for chatffi (tari-project…
Browse files Browse the repository at this point in the history
…#5659)

Description
---
The ffi relies on a struct in the ChatClient library which was not being
included in the header build.

Motivation and Context
---
Less broken for the mobile teams.

How Has This Been Tested?
---
It build, and the struct is now present in the header file.

Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify
  • Loading branch information
brianp committed Aug 23, 2023
1 parent 61b436c commit 241ca67
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions base_layer/chat_ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ fn main() {
parse: ParseConfig {
parse_deps: true,
include: Some(vec![
"tari_core".to_string(),
"minotari_wallet".to_string(),
"tari_chat_client".to_string(),
"tari_common_types".to_string(),
"tari_contacts".to_string(),
"tari_core".to_string(),
"tari_crypto".to_string(),
"tari_p2p".to_string(),
"minotari_wallet".to_string(),
"tari_contacts".to_string(),
]),
..Default::default()
},
Expand Down
16 changes: 9 additions & 7 deletions base_layer/chat_ffi/chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <stdint.h>
#include <stdlib.h>

struct ApplicationConfig;

struct ChatMessages;

struct ClientFFI;
Expand Down Expand Up @@ -41,7 +43,7 @@ extern "C" {
* # Safety
* The ```destroy_client``` method must be called when finished with a ClientFFI to prevent a memory leak
*/
struct ClientFFI *create_chat_client(ApplicationConfig *config,
struct ClientFFI *create_chat_client(struct ApplicationConfig *config,
const char *identity_file_path,
int *error_out,
CallbackContactStatusChange callback_contact_status_change,
Expand Down Expand Up @@ -75,11 +77,11 @@ void destroy_client_ffi(struct ClientFFI *client);
* # Safety
* The ```destroy_config``` method must be called when finished with a Config to prevent a memory leak
*/
ApplicationConfig *create_chat_config(const char *network_str,
const char *public_address,
const char *datastore_path,
const char *log_path,
int *error_out);
struct ApplicationConfig *create_chat_config(const char *network_str,
const char *public_address,
const char *datastore_path,
const char *log_path,
int *error_out);

/**
* Frees memory for an ApplicationConfig
Expand All @@ -93,7 +95,7 @@ ApplicationConfig *create_chat_config(const char *network_str,
* # Safety
* None
*/
void destroy_config(ApplicationConfig *config);
void destroy_config(struct ApplicationConfig *config);

/**
* Sends a message over a client
Expand Down

0 comments on commit 241ca67

Please sign in to comment.