OCTAVE_PATCH_VERSION with ~ breaks swiglal_octave build
/bin/mkdir -p swiglal_python/ && \
if env CCACHE_CPP2=1 /usr/bin/swig -python -py3 -relativeimport -O -builtin -globals globalvar -outdir swiglal_python/ -Werror -Wextra -w314,506,511 -I../include -D_ISOC99_SOURCE -D__STDC_CONSTANT_MACROS -D__STD
C_LIMIT_MACROS -D_FORTIFY_SOURCE=2 -MP -MD -MT swiglal_python.c -o swiglal_python.c swiglal.i; then \
: swig-deps-false-mv -f ./.swigdeps/swiglal_python.deps.tmp ./.swigdeps/swiglal_python.deps; \
else \
: swig-deps-false-rm -f ./.swigdeps/swiglal_python.deps.tmp; \
rm -f swiglal_python.c; \
exit 1; \
fi
/bin/bash ../libtool --tag=CXX --tag=disable-static --mode=compile g++ -DHAVE_CONFIG_H -I/usr/include/octave-6.1.1~hg.2021.01.26/octave -shared -I. -I../include -D_ISOC99_SOURCE -D__STDC_CONSTANT_MACROS -D__
STDC_LIMIT_MACROS -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/octave-6.1.1~hg.2021.01.26/octave/.. -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-6.1.1~hg.2021.01.26/octave/
.. -I/usr/include/octave-6.1.1~hg.2021.01.26/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-KF56V6/octave-6.1.1~hg.2021.01.26=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-uni
nitialized -Wno-unused-variable -Wno-unused-but-set-variable -Wno-format-extra-args -Wno-tautological-compare -Wno-deprecated-declarations -fno-strict-aliasing -O0 -Wp,-U_FORTIFY_SOURCE -g -O2 -ffile-prefix-map=
/build/lal-7.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -c -o swiglal_octave_la-swiglal_octave.lo `test -f 'swiglal_octave.cpp' || echo './'`swiglal_octave.cpp
libtool: compile: g++ -DHAVE_CONFIG_H "-I/usr/include/octave-6.1.1~hg.2021.01.26/octave" -I. -I../include -D_ISOC99_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTI
FY_SOURCE=2 "-I/usr/include/octave-6.1.1~hg.2021.01.26/octave/.." -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC "-I/usr/include/octave-6.1.1~hg.2021.01.26/octave/.." "-I/usr/include/octave-6.1.1~hg.2021.01.26/octave" -p
thread -fopenmp -g -O2 "-ffile-prefix-map=/build/octave-KF56V6/octave-6.1.1~hg.2021.01.26=." -fstack-protector-strong -Wformat -Werror=format-security -Wno-uninitialized -Wno-unused-variable -Wno-unused-but-set-
variable -Wno-format-extra-args -Wno-tautological-compare -Wno-deprecated-declarations -fno-strict-aliasing -O0 -Wp,-U_FORTIFY_SOURCE -g -O2 -ffile-prefix-map=/build/lal-7.1.2=. -fstack-protector-strong -Wformat
-Werror=format-security -c swiglal_octave.cpp -fPIC -DPIC -o .libs/swiglal_octave_la-swiglal_octave.o
In file included from /usr/include/octave-6.1.1~hg.2021.01.26/octave/../octave/defun-int.h:35,
from /usr/include/octave-6.1.1~hg.2021.01.26/octave/../octave/defun-dld.h:35,
from /usr/include/octave-6.1.1~hg.2021.01.26/octave/../octave/oct.h:35,
from swiglal_octave.cpp:175:
/usr/include/octave-6.1.1~hg.2021.01.26/octave/../octave/version.h:39:31: error: missing binary operator before token "~"
39 | #define OCTAVE_PATCH_VERSION 1~hg.2021.01.26
| ^
swiglal_octave.cpp:181:63: note: in expansion of macro 'OCTAVE_PATCH_VERSION'
181 | ( (OCTAVE_MAJOR_VERSION<<16) + (OCTAVE_MINOR_VERSION<<8) + (OCTAVE_PATCH_VERSION + 0) >= ((major)<<16) + ((minor)<<8) + (patch) )
| ^~~~~~~~~~~~~~~~~~~~
swiglal_octave.cpp:268:5: note: in expansion of macro 'SWIG_OCTAVE_PREREQ'
268 | #if SWIG_OCTAVE_PREREQ(4,2,0)
| ^~~~~~~~~~~~~~~~~~
swiglal_octave.cpp:271:10: fatal error: octave/toplev.h: No such file or directory
271 | #include <octave/toplev.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[5]: *** [Makefile:981: swiglal_octave_la-swiglal_octave.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: Leaving directory '/build/lal-7.1.2/swig'
make[4]: *** [Makefile:775: all] Error 2
make[4]: Leaving directory '/build/lal-7.1.2/swig'
make[3]: *** [Makefile:623: all-recursive] Error 1
make[3]: Leaving directory '/build/lal-7.1.2'
make[2]: *** [Makefile:520: all] Error 2
make[2]: Leaving directory '/build/lal-7.1.2'
dh_auto_build: error: make -j32 returned exit code 2
The Octave version currently available in Bullseye is versioned 6.1.1~hg.2021.01.26 - a "pre-release version" for 6.1.1 taken from Mercurial on Jan 26 - and it's possible that this will be the version that gets released with Bullseye.
See https://packages.qa.debian.org/o/octave.html for the versions provided with Debian distributions.
Obviously, code using OCTAVE_PATCH_VERSION
needs to sanitize the string more than just adding zero to it as the version doesn't need to be followed by a dash...
This will probably affect all components of LALsuite but I didn't get that far yet.