Skip to content

Commit

Permalink
Avoid failure with swig 4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Nov 27, 2024
1 parent 4ba7cc6 commit df73889
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
25 changes: 16 additions & 9 deletions bindings/python/dlite-misc.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@
return dlite_get_uuid(buff, id);
}

status_t split_url(char *url, char **driver, char **location,
void split_meta_uri(const char *uri, char **name, char **version,
char **namespace) {
dlite_split_meta_uri(uri, name, version, namespace);
}

void split_url(char *url, char **driver, char **location,
char **options, char **fragment) {
status_t retval=0;

char *url2, *drv=NULL, *loc=NULL, *opt=NULL, *frg=NULL;
if (!(url2 = strdup(url))) return dlite_err(1, "allocation failure");
retval = dlite_split_url(url, &drv, &loc, &opt, &frg);
if ((url2 = strdup(url)))
dlite_split_url(url2, &drv, &loc, &opt, &frg);
else
dlite_err(dliteMemoryError, "allocation failure");
if (driver) *driver = strdup((drv) ? drv : "");
if (location) *location = strdup((loc) ? loc : "");
if (options) *options = strdup((opt) ? opt : "");
if (fragment) *fragment = strdup((frg) ? frg : "");
free(url2);
return retval;
if (url2) free(url2);
}

bool asbool(const char *str) {
Expand Down Expand Up @@ -115,8 +121,8 @@ Returns (name, version, namespace)-tuplet from valid metadata `uri`.
%cstring_output_allocate(char **name, if (*$1) free(*$1));
%cstring_output_allocate(char **version, if (*$1) free(*$1));
%cstring_output_allocate(char **namespace, if (*$1) free(*$1));
status_t dlite_split_meta_uri(const char *uri, char **name, char **version,
char **namespace);
void split_meta_uri(const char *uri, char **name, char **version,
char **namespace);

//int dlite_option_parse(char *options, DLiteOpt *opts, int modify);

Expand All @@ -139,11 +145,12 @@ Returns a (driver, location, options, fragment)-tuplet by splitting
into four parts.
") split_url;
%feature("numoutputs", "0") split_url;
%cstring_output_allocate(char **driver, if (*$1) free(*$1));
%cstring_output_allocate(char **location, if (*$1) free(*$1));
%cstring_output_allocate(char **options, if (*$1) free(*$1));
%cstring_output_allocate(char **fragment, if (*$1) free(*$1));
status_t split_url(char *url, char **driver, char **location,
void split_url(char *url, char **driver, char **location,
char **options, char **fragment);


Expand Down
8 changes: 4 additions & 4 deletions doc/contributors_guide/tips_and_tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Debugging tests failing inside docker on GitHub
3. To list all manylinux images for Python 3.12, do

cd dlite # Root of DLite source directory
CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_28_x86_64:latest \
CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_34_x86_64:latest \
CIBW_BUILD=cp312-manylinux_* \
python -m cibuildwheel \
--print-build-identifiers \
Expand All @@ -77,7 +77,7 @@ Debugging tests failing inside docker on GitHub

4. Run image. For example, to run the image `cp312-manylinux_x86_64` do

CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_28_x86_64:latest \
CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_34_x86_64:latest \
CIBW_BUILD=cp312-manylinux_x86* \
python -m cibuildwheel \
--output-dir wheelhouse \
Expand All @@ -92,7 +92,7 @@ Debugging tests failing inside docker on GitHub
the previous command:

CIBW_BEFORE_TEST=cat \
CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_28_x86_64:latest \
CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_34_x86_64:latest \
CIBW_BUILD=cp312-manylinux_x86* \
python -m cibuildwheel \
--output-dir wheelhouse \
Expand Down Expand Up @@ -146,7 +146,7 @@ and get its IP with
You can then rerun `cibuildwheel` with the

CIBW_BUILD_FRONTEND="pip; args: --index-url http://$ip:3141/root/pypi/" \
CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_28_x86_64:latest \
CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/sintef/dlite-python-manylinux_2_34_x86_64:latest \
CIBW_BUILD=cp312-manylinux_x86* \
python -m cibuildwheel \
--output-dir wheelhouse \
Expand Down

0 comments on commit df73889

Please sign in to comment.