Skip to content

Commit 60d05ee

Browse files
authored
Fix all OS builds (#66)
1 parent 1999893 commit 60d05ee

File tree

8 files changed

+35
-43
lines changed

8 files changed

+35
-43
lines changed

.github/workflows/ci.yml

+14-15
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ jobs:
1818
build_and_test_apple:
1919
strategy:
2020
matrix:
21-
platform: [macos-11]
21+
platform: [macos-14]
2222
runs-on: ${{ matrix.platform }}
23-
env:
24-
MG_VERSION: "1.4.0"
2523
steps:
2624
- name: Set-up repository
2725
uses: actions/checkout@v2
@@ -42,7 +40,7 @@ jobs:
4240
fail-fast: false
4341
matrix:
4442
include:
45-
- os: windows-2019
43+
- os: windows-2022
4644
env:
4745
VCPKG_ROOT: "${{ github.workspace }}\\vcpkg"
4846
deps: "openssl:x64-windows"
@@ -78,8 +76,8 @@ jobs:
7876
build_and_test_linux:
7977
strategy:
8078
matrix:
81-
platform: [ubuntu-20.04, ubuntu-22.04]
82-
mgversion: ["2.0.0", "2.3.0"]
79+
platform: [ubuntu-24.04]
80+
mgversion: ["2.19.0"]
8381
packages: ["gcc g++ clang"]
8482
gcc-postfix: [""]
8583
clang-postfix: [""]
@@ -100,11 +98,11 @@ jobs:
10098
if: steps.cache-memgraph-docker.outputs.cache-hit != 'true'
10199
run: |
102100
mkdir ~/memgraph
103-
curl -L https://memgraph.com/download/memgraph/v${{ matrix.mgversion }}/docker/memgraph-${{ matrix.mgversion }}-docker.tar.gz > ~/memgraph/memgraph-docker.tar.gz
101+
curl -L https://download.memgraph.com/memgraph/v${{ matrix.mgversion }}/docker/memgraph-${{ matrix.mgversion }}-docker.tar.gz > ~/memgraph/memgraph-docker.tar.gz
104102
- name: Load and run Memgraph Docker image
105103
run: |
106104
docker load -i ~/memgraph/memgraph-docker.tar.gz
107-
docker run -d -p 7687:7687 memgraph --telemetry-enabled=false
105+
docker run -d -p 7687:7687 memgraph/memgraph --telemetry-enabled=false
108106
- name: Build with gcc, test and install mgclient
109107
run: |
110108
mkdir build-gcc && cd build-gcc
@@ -128,11 +126,11 @@ jobs:
128126
# Memgraph has to be started manually because systemd is not available on
129127
# WSL (init process does not exist).
130128
build_and_test_windows_mingw:
131-
runs-on: windows-2019
129+
runs-on: windows-2022
132130
strategy:
133131
matrix:
134132
include: [
135-
{ msystem: MINGW64, arch: x86_64, mgversion: "1.4.0" }
133+
{ msystem: MINGW64, arch: x86_64, mgversion: "2.19.0" }
136134
]
137135
defaults:
138136
run:
@@ -147,14 +145,15 @@ jobs:
147145
install: git base-devel mingw-w64-${{ matrix.arch }}-toolchain mingw-w64-${{ matrix.arch }}-cmake mingw-w64-${{ matrix.arch }}-openssl
148146
- uses: Vampire/setup-wsl@v1
149147
with:
150-
distribution: Ubuntu-18.04
148+
distribution: Ubuntu-22.04
151149
- name: Download, install and run Memgraph under WSL
152150
shell: wsl-bash {0} # root shell
153151
run: |
154152
mkdir ~/memgraph
155-
curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-18.04/memgraph_${{matrix.mgversion}}-community-1_amd64.deb --output ~/memgraph/memgraph-community.deb
156-
dpkg -i ~/memgraph/memgraph-community.deb
157-
nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' &
153+
# https://download.memgraph.com/memgraph/v2.19.0/ubuntu-24.04/memgraph_2.19.0-1_amd64.deb
154+
curl -L https://download.memgraph.com/memgraph/v${{matrix.mgversion}}/ubuntu-22.04/memgraph_${{matrix.mgversion}}-1_amd64.deb --output ~/memgraph/memgraph.deb
155+
dpkg -i ~/memgraph/memgraph.deb
156+
nohup /usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-cert-file="" --bolt-key-file="" --data-directory="~/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --data-recovery-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-file='' &
158157
sleep 1 # Wait for Memgraph a bit.
159158
- name: Build and test mgclient
160159
run: |
@@ -167,7 +166,7 @@ jobs:
167166
build_and_test_linux_wasm:
168167
strategy:
169168
matrix:
170-
platform: [ubuntu-20.04]
169+
platform: [ubuntu-24.04]
171170
runs-on: ${{ matrix.platform }}
172171
steps:
173172
- name: Set-up repository

include/mgclient.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ extern "C" {
137137
/// Client software version.
138138
///
139139
/// \return Client version in the major.minor.patch format.
140-
MGCLIENT_EXPORT const char *mg_client_version();
140+
MGCLIENT_EXPORT const char *mg_client_version(void);
141141

142142
/// Initializes the client (the whole process).
143143
/// Should be called at the beginning of each process using the client.
144144
///
145145
/// \return Zero if initialization was successful.
146-
MGCLIENT_EXPORT int mg_init();
146+
MGCLIENT_EXPORT int mg_init(void);
147147

148148
/// Finalizes the client (the whole process).
149149
/// Should be called at the end of each process using the client.
150-
MGCLIENT_EXPORT void mg_finalize();
150+
MGCLIENT_EXPORT void mg_finalize(void);
151151

152152
/// An enum listing all the types as specified by Bolt protocol.
153153
enum mg_value_type {
@@ -297,7 +297,7 @@ typedef struct mg_point_3d mg_point_3d;
297297
/// Constructs a nil \ref mg_value.
298298
///
299299
/// \return Pointer to the newly constructed value or NULL if error occurred.
300-
MGCLIENT_EXPORT mg_value *mg_value_make_null();
300+
MGCLIENT_EXPORT mg_value *mg_value_make_null(void);
301301

302302
/// Constructs a boolean \ref mg_value.
303303
///
@@ -1221,7 +1221,7 @@ typedef int (*mg_trust_callback_type)(const char *, const char *, const char *,
12211221
const char *, void *);
12221222

12231223
/// Creates a new `mg_session_params` object.
1224-
MGCLIENT_EXPORT mg_session_params *mg_session_params_make();
1224+
MGCLIENT_EXPORT mg_session_params *mg_session_params_make(void);
12251225

12261226
/// Destroys a `mg_session_params` object.
12271227
MGCLIENT_EXPORT void mg_session_params_destroy(mg_session_params *);

src/apple/mgsocket.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include <string.h>
1818

19-
#include "mgcommon.h"
20-
2119
#define MG_RETRY_ON_EINTR(expression) \
2220
__extension__({ \
2321
long result; \
@@ -27,7 +25,7 @@
2725
result; \
2826
})
2927

30-
int mg_socket_init() { return MG_SUCCESS; }
28+
int mg_socket_init(void) { return MG_SUCCESS; }
3129

3230
int mg_socket_create(int af, int type, int protocol) {
3331
int sockfd = socket(af, type, protocol);
@@ -92,6 +90,6 @@ int mg_socket_pair(int d, int type, int protocol, int *sv) {
9290

9391
int mg_socket_close(int sock) { return MG_RETRY_ON_EINTR(close(sock)); }
9492

95-
char *mg_socket_error() { return strerror(errno); }
93+
char *mg_socket_error(void) { return strerror(errno); }
9694

97-
void mg_socket_finalize() {}
95+
void mg_socket_finalize(void) {}

src/linux/mgsocket.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include <stdlib.h>
1818
#include <string.h>
1919

20-
#include "mgcommon.h"
21-
2220
#ifdef __EMSCRIPTEN__
2321
#include "emscripten.h"
2422
#include "mgwasm.h"
@@ -36,7 +34,7 @@
3634
// Please refer to https://man7.org/linux/man-pages/man2 for more details about
3735
// Linux system calls.
3836

39-
int mg_socket_init() { return MG_SUCCESS; }
37+
int mg_socket_init(void) { return MG_SUCCESS; }
4038

4139
int mg_socket_create(int af, int type, int protocol) {
4240
int sockfd = socket(af, type, protocol);
@@ -151,6 +149,6 @@ int mg_socket_pair(int d, int type, int protocol, int *sv) {
151149

152150
int mg_socket_close(int sock) { return MG_RETRY_ON_EINTR(close(sock)); }
153151

154-
char *mg_socket_error() { return strerror(errno); }
152+
char *mg_socket_error(void) { return strerror(errno); }
155153

156-
void mg_socket_finalize() {}
154+
void mg_socket_finalize(void) {}

src/mgclient.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
#include "mgtransport.h"
3030
#include "mgvalue.h"
3131

32-
const char *mg_client_version() { return MGCLIENT_VERSION; }
32+
const char *mg_client_version(void) { return MGCLIENT_VERSION; }
3333

34-
int mg_init_session_static_vars() {
34+
int mg_init_session_static_vars(void) {
3535
mg_value *n_val = mg_value_make_integer(-1);
3636
if (!n_val) {
3737
goto fatal_failure;
@@ -55,13 +55,13 @@ int mg_init_session_static_vars() {
5555
return MG_ERROR_CLIENT_ERROR;
5656
}
5757

58-
int mg_init() {
58+
int mg_init(void) {
5959
int init_status = mg_init_session_static_vars();
6060
if (init_status != 0) return init_status;
6161
return mg_socket_init();
6262
}
6363

64-
void mg_finalize() { mg_socket_finalize(); }
64+
void mg_finalize(void) { mg_socket_finalize(); }
6565

6666
typedef struct mg_session_params {
6767
const char *address;
@@ -78,7 +78,7 @@ typedef struct mg_session_params {
7878
void *trust_data;
7979
} mg_session_params;
8080

81-
mg_session_params *mg_session_params_make() {
81+
mg_session_params *mg_session_params_make(void) {
8282
mg_session_params *params =
8383
mg_allocator_malloc(&mg_system_allocator, sizeof(mg_session_params));
8484
if (!params) {

src/mgsocket.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ typedef long ssize_t;
5454

5555
/// Initializes underlying resources. Has to be called at the beginning of a
5656
/// process using socket resources.
57-
int mg_socket_init();
57+
int mg_socket_init(void);
5858

5959
/// Returns a descriptor referencing the new socket or MG_ERROR_SOCKET in the
6060
/// case of any failure.
@@ -110,11 +110,11 @@ int mg_socket_close(int sock);
110110

111111
/// Used to get a native error message after some socket call fails.
112112
/// Has to be called immediately after the failed socket function.
113-
char *mg_socket_error();
113+
char *mg_socket_error(void);
114114

115115
/// Should be called at the end of any process which previously called the
116116
/// \ref mg_socket_init function.
117-
void mg_socket_finalize();
117+
void mg_socket_finalize(void);
118118

119119
#ifdef __cplusplus
120120
}

src/mgtransport.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "mgtransport.h"
1616

1717
#include <assert.h>
18-
#include <errno.h>
1918
#include <stdlib.h>
2019
#include <string.h>
2120
#ifdef MGCLIENT_ON_LINUX
@@ -26,7 +25,6 @@
2625

2726
#include "mgallocator.h"
2827
#include "mgclient.h"
29-
#include "mgcommon.h"
3028
#include "mgsocket.h"
3129
#ifdef __EMSCRIPTEN__
3230
#include "mgwasm.h"
@@ -160,7 +158,7 @@ static char *hex_encode(unsigned char *data, unsigned int len,
160158
return encoded;
161159
}
162160

163-
static void mg_openssl_init() {
161+
static void mg_openssl_init(void) {
164162
#if OPENSSL_VERSION_NUMBER < 0x10100000L
165163
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
166164
static int mg_ssl_initialized = 0;

src/mgvalue.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "mgallocator.h"
2121
#include "mgclient.h"
22-
#include "mgconstants.h"
2322

2423
mg_string *mg_string_alloc(uint32_t size, mg_allocator *allocator) {
2524
char *block = mg_allocator_malloc(allocator, sizeof(mg_string) + size);
@@ -178,7 +177,7 @@ mg_point_3d *mg_point_3d_alloc(mg_allocator *allocator) {
178177
return point_3d;
179178
}
180179

181-
mg_value *mg_value_make_null() {
180+
mg_value *mg_value_make_null(void) {
182181
mg_value *value = mg_allocator_malloc(&mg_system_allocator, sizeof(mg_value));
183182
if (!value) {
184183
return NULL;

0 commit comments

Comments
 (0)