Skip to content

Require identical SWIG version across all LALSuite SWIG wrappers

Karl Wette requested to merge ANU-CGA/lalsuite:swig-version-check into master

Description

It appears that SWIG wrappers need to be compiled with the same version of SWIG across different LALSuite packages, otherwise weird issue arise: see #660 (closed), https://git.ligo.org/computing/sccb/-/issues/1294.

This MR enforces that SWIG wrappers of LALSuite packages must use the same version. The version of SWIG used to generate a wrapper is hard-coded into the swiglal<...>.i interface file. When the interface file is %importedd into the interface of another LALSuite package, the hard-coded version is compared against SWIG_VERSION (the version of SWIG being used to %import the interface). If these do not match, a fatal warning is issued, e.g.:

Warning 999: swiglal.i requires SWIG version X.Y.Z

This check is possibly stricter than necessary, as it requires an exact major/minor/patch version check. But we probably can't tell a priori which SWIG versions are compatible (at least not without building the wrappers and running the test suite), so requiring an exact version check seems safest.

Note that this check won't be completely enforced until the next full LALSuite release. This will probably have implications for packaging, i.e. we will essentially need to freeze the SWIG version between full LALSuite releases.

API Changes and Justification

Backwards Compatible Changes

  • This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
  • This change adds new classes/functions/structs/types to a public C header file or Python module

Backwards Incompatible Changes

  • This change modifies an existing class/function/struct/type definition in a public C header file or Python module
  • This change removes an existing class/function/struct/type from a public C header file or Python module

If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.

Review Status

cc @adam-mercer @duncanmmacleod

Merge request reports