#1145591 meep: FTBFS: typemap_utils.cpp:494:18: error: 'PyInt_AsLong' was not declared in this scope; did you mean 'PyLong_AsLong'?

Package:
src:meep
Source:
src:meep
Submitter:
Santiago Vila
Date:
2026-09-16 17:37:02 UTC
Severity:
normal
Tags:
#1145591#5
Date:
2026-08-25 20:34:25 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202608/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:meep, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
libtool: compile:  x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/python3.14 -I/usr/lib/x86_64-linux-gnu/python3-numpy/numpy/_core/include -I../src -I../libpympb -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/hdf5/serial -I/usr/include/guile/3.0 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -W -c mpb-python.cxx  -fPIC -DPIC -o .libs/_mpb_la-mpb-python.o
libtool: compile:  x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/python3.14 -I/usr/lib/x86_64-linux-gnu/python3-numpy/numpy/_core/include -I../src -I../libpympb -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/hdf5/serial -I/usr/include/guile/3.0 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -W -c meep-python.cxx  -fPIC -DPIC -o .libs/_meep_la-meep-python.o
In file included from mpb-python.cxx:3415:
typemap_utils.cpp: In function 'int pymaterial_grid_to_material_grid(PyObject*, meep_geom::material_data*)':
typemap_utils.cpp:494:18: error: 'PyInt_AsLong' was not declared in this scope; did you mean 'PyLong_AsLong'?
  494 |   long gt_enum = PyInt_AsLong(type);
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
mpb-python.cxx: In function 'const char* pytype_string(PyObject*)':
mpb-python.cxx:3786:9: error: 'PyString_Check' was not declared in this scope; did you mean 'PyMapping_Check'?
 3786 |     if (PyString_Check(  py_obj)) return "string"      ;
      |         ^~~~~~~~~~~~~~
      |         PyMapping_Check
mpb-python.cxx:3787:9: error: 'PyInt_Check' was not declared in this scope; did you mean 'PySet_Check'?
 3787 |     if (PyInt_Check(     py_obj)) return "int"         ;
      |         ^~~~~~~~~~~
      |         PySet_Check
In file included from meep-python.cxx:4090:
typemap_utils.cpp: In function 'int pymaterial_grid_to_material_grid(PyObject*, meep_geom::material_data*)':
typemap_utils.cpp:494:18: error: 'PyInt_AsLong' was not declared in this scope; did you mean 'PyLong_AsLong'?
  494 |   long gt_enum = PyInt_AsLong(type);
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
meep-python.cxx: In function 'const char* pytype_string(PyObject*)':
meep-python.cxx:4697:9: error: 'PyString_Check' was not declared in this scope; did you mean 'PyMapping_Check'?
 4697 |     if (PyString_Check(  py_obj)) return "string"      ;
      |         ^~~~~~~~~~~~~~
      |         PyMapping_Check
meep-python.cxx:4698:9: error: 'PyInt_Check' was not declared in this scope; did you mean 'PySet_Check'?
 4698 |     if (PyInt_Check(     py_obj)) return "int"         ;
      |         ^~~~~~~~~~~
      |         PySet_Check
meep-python.cxx: In function 'meep::structure* create_structure(vector3, std::vector<meep_geom::dft_data>, std::vector<meep::volume>, std::vector<meep::volume>, std::vector<meep::volume>, std::vector<meep::volume>, meep::grid_volume&, const meep::boundary_region&, const meep::symmetry&, int, double, bool, double, int, geometric_object_list, vector3, bool, meep_geom::material_type, meep_geom::absorber_list, meep_geom::material_type_list, bool, bool, meep::structure*, bool, const meep::binary_partition*)':
meep-python.cxx:7380:62: warning: unused parameter 'alist' [-Wunused-parameter]
 7380 |                                     meep_geom::absorber_list alist,
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
meep-python.cxx:7381:67: warning: unused parameter 'extra_materials' [-Wunused-parameter]
 7381 |                                     meep_geom::material_type_list extra_materials,
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
meep-python.cxx:7383:42: warning: unused parameter 'set_materials' [-Wunused-parameter]
 7383 |                                     bool set_materials,
      |                                     ~~~~~^~~~~~~~~~~~~
meep-python.cxx: In function 'meep_geom::geom_epsilon* _set_materials(meep::structure*, vector3, meep::grid_volume&, bool, double, int, geometric_object_list, vector3, bool, meep_geom::material_type, meep_geom::absorber_list, meep_geom::material_type_list, bool, bool, meep_geom::geom_epsilon*, bool, const meep::binary_partition*)':
meep-python.cxx:7427:29: warning: unused parameter 'cell_size' [-Wunused-parameter]
 7427 |                     vector3 cell_size,
      |                     ~~~~~~~~^~~~~~~~~
meep-python.cxx:7428:40: warning: unused parameter 'gv' [-Wunused-parameter]
 7428 |                     meep::grid_volume &gv,
      |                     ~~~~~~~~~~~~~~~~~~~^~
meep-python.cxx:7441:26: warning: unused parameter 'output_chunk_costs' [-Wunused-parameter]
 7441 |                     bool output_chunk_costs,
      |                     ~~~~~^~~~~~~~~~~~~~~~~~
meep-python.cxx:7442:51: warning: unused parameter 'my_bp' [-Wunused-parameter]
 7442 |                     const meep::binary_partition *my_bp) {
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
typemap_utils.cpp: At global scope:
typemap_utils.cpp:115:18: warning: 'PyObject* py_volume_object()' defined but not used [-Wunused-function]
  115 | static PyObject *py_volume_object() {
      |                  ^~~~~~~~~~~~~~~~
make[4]: *** [Makefile:921: _mpb_la-mpb-python.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
meep-python.cxx: In function 'PyObject* _wrap_abort__varargs__(PyObject*, PyObject*, PyObject*)':
meep-python.cxx:23078:87: warning: unused parameter 'varargs' [-Wunused-parameter]
23078 | SWIGINTERN PyObject *_wrap_abort__varargs__(PyObject *self, PyObject *args, PyObject *varargs) {
      |                                                                             ~~~~~~~~~~^~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_abort(PyObject*, PyObject*)':
meep-python.cxx:23111:44: warning: unused parameter 'self' [-Wunused-parameter]
23111 | SWIGINTERN PyObject *_wrap_abort(PyObject *self, PyObject *args) {
      |                                  ~~~~~~~~~~^~~~
meep-python.cxx: In function 'PyObject* _wrap_master_printf__varargs__(PyObject*, PyObject*, PyObject*)':
meep-python.cxx:123774:95: warning: unused parameter 'varargs' [-Wunused-parameter]
123774 | SWIGINTERN PyObject *_wrap_master_printf__varargs__(PyObject *self, PyObject *args, PyObject *varargs) {
       |                                                                                     ~~~~~~~~~~^~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_master_printf(PyObject*, PyObject*)':
meep-python.cxx:123807:52: warning: unused parameter 'self' [-Wunused-parameter]
123807 | SWIGINTERN PyObject *_wrap_master_printf(PyObject *self, PyObject *args) {
       |                                          ~~~~~~~~~~^~~~
meep-python.cxx: In function 'PyObject* _wrap_master_printf_stderr__varargs__(PyObject*, PyObject*, PyObject*)':
meep-python.cxx:123821:102: warning: unused parameter 'varargs' [-Wunused-parameter]
123821 | SWIGINTERN PyObject *_wrap_master_printf_stderr__varargs__(PyObject *self, PyObject *args, PyObject *varargs) {
       |                                                                                            ~~~~~~~~~~^~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_master_printf_stderr(PyObject*, PyObject*)':
meep-python.cxx:123854:59: warning: unused parameter 'self' [-Wunused-parameter]
123854 | SWIGINTERN PyObject *_wrap_master_printf_stderr(PyObject *self, PyObject *args) {
       |                                                 ~~~~~~~~~~^~~~
meep-python.cxx: In function 'PyObject* _wrap_debug_printf__varargs__(PyObject*, PyObject*, PyObject*)':
meep-python.cxx:123868:94: warning: unused parameter 'varargs' [-Wunused-parameter]
123868 | SWIGINTERN PyObject *_wrap_debug_printf__varargs__(PyObject *self, PyObject *args, PyObject *varargs) {
       |                                                                                    ~~~~~~~~~~^~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_debug_printf(PyObject*, PyObject*)':
meep-python.cxx:123901:51: warning: unused parameter 'self' [-Wunused-parameter]
123901 | SWIGINTERN PyObject *_wrap_debug_printf(PyObject *self, PyObject *args) {
       |                                         ~~~~~~~~~~^~~~
meep-python.cxx: In function 'PyObject* _wrap_master_fprintf__varargs__(PyObject*, PyObject*, PyObject*)':
meep-python.cxx:123915:96: warning: unused parameter 'varargs' [-Wunused-parameter]
123915 | SWIGINTERN PyObject *_wrap_master_fprintf__varargs__(PyObject *self, PyObject *args, PyObject *varargs) {
       |                                                                                      ~~~~~~~~~~^~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_master_fprintf(PyObject*, PyObject*)':
meep-python.cxx:123957:53: warning: unused parameter 'self' [-Wunused-parameter]
123957 | SWIGINTERN PyObject *_wrap_master_fprintf(PyObject *self, PyObject *args) {
       |                                           ~~~~~~~~~~^~~~
typemap_utils.cpp: At global scope:
typemap_utils.cpp:115:18: warning: 'PyObject* py_volume_object()' defined but not used [-Wunused-function]
  115 | static PyObject *py_volume_object() {
      |                  ^~~~~~~~~~~~~~~~
make[4]: *** [Makefile:914: _meep_la-meep-python.lo] Error 1
make[4]: Leaving directory '/<<PKGBUILDDIR>>/python'
make[3]: *** [Makefile:767: all] Error 2
make[3]: Leaving directory '/<<PKGBUILDDIR>>/python'
make[2]: *** [Makefile:523: all-recursive] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
make[1]: *** [Makefile:430: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
dh_auto_build: error: make -j2 returned exit code 2
make: *** [debian/rules:29: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1145591#10
Date:
2026-08-29 16:24:03 UTC
From:
To:
Hi,

The current bug is caused by the removal of the Python 2 compatibility
macros in version 4.5.0 of SWIG. [1] According to the SWIG authors, these
macros were retained in the generated code (pyhead.swg) solely for user
typemaps. All typemap using these macros are updated to call the Python 3 C
API directly.

I have submitted a patch to fix the issue as a merge request at Salsa. [2]

The issue appears to have been fixed upstream (commit cb0a0edf [3]), with
explanations given in PR#3268 [4]. However, the associated patch [5] does
not apply cleanly against version 1.29.0-2 of the Debian package.

BTW, the latest upstream version is 1.34.0.

Rafael Laboissière

[1] https://github.com/swig/swig/commit/79f7a2b7cb7ddc256eba09c8770133148025171d
[2] https://salsa.debian.org/alteholz/meep/-/merge_requests/2
[3] https://github.com/NanoComp/meep/commit/cb0a0edf16a9d0e709ef9ffc0f0dfb98e414b8e7
[4] https://github.com/NanoComp/meep/pull/3268
[5] https://github.com/NanoComp/meep/commit/cb0a0edf16a9d0e709ef9ffc0f0dfb98e414b8e7.diff

#1145591#17
Date:
2026-09-16 17:34:28 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
meep, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1145591@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Thorsten Alteholz <debian@alteholz.de> (supplier of updated meep package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 16 Sep 2026 16:42:08 +0200
Source: meep
Architecture: source
Version: 1.29.0-3
Distribution: unstable
Urgency: medium
Maintainer: Thorsten Alteholz <debian@alteholz.de>
Changed-By: Thorsten Alteholz <debian@alteholz.de>
Closes: 1145591
Changes:
 meep (1.29.0-3) unstable; urgency=medium
 .
   * add patch build-with-swig-4.5.0.patch (Closes: #1145591)
     (thanks a lot to Rafael Laboissière for this patch)
   * fix autopkgtest by adding python3-scipy as test dependency
   * debian/control: bump standard to 4.7.4 (no changes)
   * debian/control: remove RRR: and Priority:
Checksums-Sha1:
 75e403bfc7039275980da5f92fc2b192d7edcb81 2450 meep_1.29.0-3.dsc
 fc43932feadd5537184e20304d68a10838b9a6c1 145200 meep_1.29.0-3.debian.tar.xz
 3082bb1619e18ddb81bbc732a65100b6d0315589 11198 meep_1.29.0-3_source.buildinfo
Checksums-Sha256:
 e8916fe2e5c203db95d7a08219a929d17a74663d4d1d7539d07e6c10edfc49f2 2450 meep_1.29.0-3.dsc
 011aff2dd2881153c89e64f97c122cbc25937645eb45414d890b0d42126a6be5 145200 meep_1.29.0-3.debian.tar.xz
 3f32e88e2f71cad133c706553b98a09f11f63a85575bd64c77dec19a51f47790 11198 meep_1.29.0-3_source.buildinfo
Files:
 52a01de140662a6186efacb0e030d3d5 2450 science - meep_1.29.0-3.dsc
 bb45ace874e6b68bcecb599fe9e022d2 145200 science - meep_1.29.0-3.debian.tar.xz
 3179db24aa10950c18ae511069e02a5c 11198 science - meep_1.29.0-3_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQKnBAEBCgCRFiEEYgH7/9u94Hgi6ruWlvysDTh7WEcFAmqqxmtfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYy
MDFGQkZGREJCREUwNzgyMkVBQkI5Njk2RkNBQzBEMzg3QjU4NDcTHGRlYmlhbkBh
bHRlaG9sei5kZQAKCRCW/KwNOHtYR4umD/9QYUgqoCuSuYmBJTVI34rDsdvcYIpw
2rnpWKUZ0JptOezx4nGPy3FndoruhHxIXQkdDRXIspoYcqE/YW5awKOurcgFOx8O
VS1JSsTNbsILNjZU53zuTNVOD5Fo+8pZOSwpZP2TDZ0YCTW3+lV3GPFAoWVr/ClB
LtWpIckCkd+zEddSN3Or0ZYTnB4gVBFniOF3oa1RDuXWTzCcv+Hs+OdZ7ROkkSR7
C8mJLT0TLCOo74Yc6mfSfaBbrOkKp2rAnjD+Gszl/rXhL3wpG2RtSJ/RMOQrcVcZ
z8AMwMHq+QQBpEkWWgcvW/IWNDtk/vsNMBO9JEKAQarIOJVuMsNnU93nfKLjtHsU
0CUy1d2CgLpn2U3Jp3NhrPDNzNIQrjK1Qbz/tGkP7G27mjWN3oyu1v64dZdwSPzs
3a+NHyNI2LFKNBt5FNzkAfDv48RsztOHT5oJz8gbJgIWStXk3iihpuYFx/7us2D/
ooXOji/OFhNQrcXDvxvIsjkYbXgrupV7LdNo4RXgzj6QZXoqkm2Pot+ndqmYC1eD
DkG6qVT5BKNaYhJTqqcOFO39Z1gEoxuIXWm7+jk3fHAQI+L0sJBE8e4ZgzZSEcsa
L6dX83Vk54XbLcry26IRVSuZlvBAm1QgdQ++wXJcqFF4vY2moMZqsB3h9CZOOP5Y
tIiyPkrIBgWBcw==
=gZNf
-----END PGP SIGNATURE-----