From 239ffe4b5b098d78de2be84d5fe9297b91b135c5 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 16 Mar 2022 17:55:33 +1300 Subject: [PATCH 1/3] [ci] Add testing for guile 2.2 and 3.0 --- .github/workflows/ci.yml | 4 ++++ Tools/CI-linux-install.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 427c5c381..2166d9879 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,10 @@ jobs: - SWIGLANG: go VER: '1.17' - SWIGLANG: guile + - SWIGLANG: guile + VER: '2.2' + - SWIGLANG: guile + VER: '3.0' - SWIGLANG: java - SWIGLANG: javascript ENGINE: node diff --git a/Tools/CI-linux-install.sh b/Tools/CI-linux-install.sh index 525121e8c..ea811f506 100644 --- a/Tools/CI-linux-install.sh +++ b/Tools/CI-linux-install.sh @@ -62,7 +62,7 @@ case "$SWIGLANG" in esac ;; "guile") - $RETRY sudo apt-get -qq install guile-2.0-dev + $RETRY sudo apt-get -qq install guile-${VER:-2.0}-dev ;; "lua") if [[ -z "$VER" ]]; then From 336de2f745fec4e1979d24e9d7991dbf05fa90fb Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 16 Mar 2022 18:04:44 +1300 Subject: [PATCH 2/3] [guile] Stop using deprecated aliases The replacements should all work with Guile 1.8.0, which is the oldest version we still aim to support. Fixes #1624 --- .../guile/guile_ext_test_external.cxx | 2 +- Lib/guile/guile_scm_run.swg | 18 +++++++++--------- Lib/guile/typemaps.i | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Examples/test-suite/guile/guile_ext_test_external.cxx b/Examples/test-suite/guile/guile_ext_test_external.cxx index c4f906a97..2729537bd 100644 --- a/Examples/test-suite/guile/guile_ext_test_external.cxx +++ b/Examples/test-suite/guile/guile_ext_test_external.cxx @@ -19,6 +19,6 @@ SCM test_create() SCM test_is_pointer(SCM val) { #define FUNC_NAME "test-is-pointer" - return SCM_BOOL(SWIG_IsPointer(val)); + return scm_from_bool(SWIG_IsPointer(val)); #undef FUNC_NAME } diff --git a/Lib/guile/guile_scm_run.swg b/Lib/guile/guile_scm_run.swg index 84444e33e..3752d3c8a 100644 --- a/Lib/guile/guile_scm_run.swg +++ b/Lib/guile/guile_scm_run.swg @@ -131,7 +131,7 @@ SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner) else SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); - if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) { + if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) { return smob; } else { /* the scm_make() C function only handles the creation of gf, @@ -151,7 +151,7 @@ SWIGINTERN unsigned long SWIG_Guile_PointerAddress(SCM object) { SCM smob = SWIG_Guile_GetSmob(object); - if (SCM_NULLP(smob)) return 0; + if (scm_is_null(smob)) return 0; else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { @@ -164,7 +164,7 @@ SWIGINTERN swig_type_info * SWIG_Guile_PointerType(SCM object) { SCM smob = SWIG_Guile_GetSmob(object); - if (SCM_NULLP(smob)) return NULL; + if (scm_is_null(smob)) return NULL; else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob) || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { @@ -192,7 +192,7 @@ SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags) swig_type_info *from; SCM smob = SWIG_Guile_GetSmob(s); - if (SCM_NULLP(smob)) { + if (scm_is_null(smob)) { *result = NULL; return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; #if SCM_MAJOR_VERSION >= 2 @@ -258,7 +258,7 @@ SWIGINTERN void SWIG_Guile_MarkPointerNoncollectable(SCM s) { SCM smob = SWIG_Guile_GetSmob(s); - if (!SCM_NULLP(smob)) { + if (!scm_is_null(smob)) { if (SWIG_Guile_IsValidSmob(smob)) { SCM_SET_CELL_TYPE(smob, swig_tag); } @@ -271,7 +271,7 @@ SWIGINTERN void SWIG_Guile_MarkPointerDestroyed(SCM s) { SCM smob = SWIG_Guile_GetSmob(s); - if (!SCM_NULLP(smob)) { + if (!scm_is_null(smob)) { if (SWIG_Guile_IsValidSmob(smob)) { SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); } @@ -492,20 +492,20 @@ SWIG_Guile_GetArgs (SCM *dest, SCM rest, int i; int num_args_passed = 0; for (i = 0; i Date: Wed, 16 Mar 2022 18:03:14 +1300 Subject: [PATCH 3/3] [guile] Update supported guile versions in docs Document that Guile 2.2.x and 3.0.x work. Document that Guile 1.8.x is believed to still work, but that we're no longer able to easily test this. --- Doc/Manual/Guile.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/Manual/Guile.html b/Doc/Manual/Guile.html index f72a4287b..5a95f3b7d 100644 --- a/Doc/Manual/Guile.html +++ b/Doc/Manual/Guile.html @@ -52,9 +52,10 @@ This section details guile-specific support in SWIG.

-SWIG works with Guile versions 1.8.x and 2.0.x. Support for version -1.6.x has been dropped. The last version of SWIG that still works with -Guile version 1.6.x is SWIG 2.0.9. +SWIG is known to work with Guile versions 2.0.x, 2.2.x and 3.0.x. We believe +it still works with 1.8.x, but we're no longer able to easily test this. +Support for version 1.6.x has been dropped. The last version of SWIG that still +works with Guile version 1.6.x is SWIG 2.0.9.

Note that starting with guile 2.0, the guile sources can be compiled for