Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8aa517e

Browse files
committedDec 26, 2021
install: Enabled installing binary dependencies. Fix some memory issues.
1 parent 7b6efff commit 8aa517e

File tree

6 files changed

+12
-24
lines changed

6 files changed

+12
-24
lines changed
 

‎.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
shell: bash
4141
run: |
4242
mkdir -p dockcross
43-
sudo docker run --rm dockcross/windows-static-64-posix > dockcross-windows-x64
43+
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
4444
cat dockcross-windows-x64
4545
chmod +x dockcross-windows-x64
4646
wget https://curl.haxx.se/download/curl-7.76.0.tar.gz
@@ -52,4 +52,4 @@ jobs:
5252
- name: Run Tests
5353
run: |
5454
## if builds pass then its passing for now
55-
./dockcross-windows-x64 make all NO_PTHREADS=1 STATIC=true EXE=true
55+
./dockcross-windows-x64 make all STATIC=true EXE=true

‎deps/url/url.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ url_parse (const char *url) {
175175
int pathname_len = (int)strlen(pathname);
176176
data->pathname = pathname;
177177

178-
char *search = (char *) malloc(sizeof(search));
178+
char *search = (char *) malloc(strlen(tmp_path)+1);
179179
if (!search) {
180180
free(tmp_url);
181181
url_free(data);
@@ -190,7 +190,7 @@ url_parse (const char *url) {
190190
int search_len = (int)strlen(search);
191191
free(tmp_path);
192192

193-
char *query = (char *) malloc(sizeof(char));
193+
char *query = (char *) malloc(search_len+1);
194194
if (!query) {
195195
free(tmp_url);
196196
url_free(data);
@@ -199,7 +199,7 @@ url_parse (const char *url) {
199199
sscanf(search, "?%s", query);
200200
data->query = query;
201201

202-
char *hash = (char *) malloc(sizeof(char));
202+
char *hash = (char *) malloc(strlen(path)+1);
203203
if (!hash) {
204204
free(tmp_url);
205205
url_free(data);

‎src/clib-build.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int build_package_with_manifest_name(const char *dir, const char *file) {
193193
#endif
194194
} else {
195195
#ifdef DEBUG
196-
package = clib_package_new_from_slug(dir, 1);
196+
package = clib_package_new_from_slug_and_url(dir, "FIXME", 1);
197197
#else
198198
package = clib_package_new_from_slug_and_url(dir, "FIXME", 0);
199199
#endif

‎src/clib-configure.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ int configure_package_with_manifest_name(const char *dir, const char *file) {
186186
#endif
187187
} else {
188188
#ifdef DEBUG
189-
package = clib_package_new_from_slug(dir, 1);
189+
package = clib_package_new_from_slug_and_url(dir, "FIXME", 1);
190190
#else
191191
package = clib_package_new_from_slug_and_url(dir, "FIXME", 0);
192192
#endif

‎src/clib-settings.h

-13
This file was deleted.

‎src/common/clib-package-installer.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ int clib_package_install_executable(clib_package_t *pkg, const char *dir, int ve
195195
E_FORMAT(&file, "%s-%s.tar.gz", reponame, pkg->version);
196196
E_FORMAT(&tarball, "%s/%s", tmp, file);
197197

198+
// TODO, move to repository
198199
rc = http_get_file(url, tarball, NULL, 0);
199200

200201
if (0 != rc) {
@@ -517,6 +518,7 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) {
517518
repository_file_free(handles[j]);
518519
}
519520
#endif
521+
free(handles);
520522

521523
#ifdef HAVE_PTHREADS
522524
pthread_mutex_lock(&lock.mutex);
@@ -539,10 +541,9 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) {
539541
goto cleanup;
540542
}
541543

542-
// TODO, check if we want to enable this.
543-
//if (pkg->install) {
544-
// rc = clib_package_install_executable(pkg, dir, verbose);
545-
//}
544+
if (pkg->install) {
545+
rc = clib_package_install_executable(pkg, dir, verbose);
546+
}
546547

547548
if (0 == rc) {
548549
rc = clib_package_install_dependencies(pkg, dir, verbose);

0 commit comments

Comments
 (0)
Please sign in to comment.