Discussion:
[Swig-devel] SWIG 3.0.10 release candidate testing
William S Fulton
2016-06-07 21:10:14 UTC
Permalink
Hi Jitka

Could you kindly download and test the release candidate on Fedora
from http://prdownloads.sourceforge.net/swig/swig-3.0.10-rc1.tar.gz?
We've fixed the Python import problems, so you should hopefully get a
clean run compared to 3.0.9.

I'll hold off releasing this until we get your feedback. Finally
thanks very much in advance, this is quite fantastic being able to
test so many projects dependent on SWIG.

William
Jitka Plesníková
2016-06-08 10:47:24 UTC
Permalink
Post by William S Fulton
Hi Jitka
Could you kindly download and test the release candidate on Fedora
fromhttp://prdownloads.sourceforge.net/swig/swig-3.0.10-rc1.tar.gz?
We've fixed the Python import problems, so you should hopefully get a
clean run compared to 3.0.9.
I'll hold off releasing this until we get your feedback. Finally
thanks very much in advance, this is quite fantastic being able to
test so many projects dependent on SWIG.
William
Hi,

I start with test rebuild with release candidate. I'll let you know the
result when it finish.
The rebuild of all packages probably finish later today.

However, I have finished rebuild of subversion and nordugrid-arc.
Subversion passed.

nordugrid-arc fails with following error:

cp -p ./../MappingOf_time_t_and_uint32_t_CTypesToPythonRegressionTest.py
MappingOf_time_t_and_uint32_t_CTypesToPythonRegressionTest.py
Traceback (most recent call last):
File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/common.py",
line 18, in swig_import_helper
return importlib.import_module(mname)
File "/usr/lib64/python3.5/importlib/__init__.py", line 126, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in
_find_and_load_unlocked
ImportError: No module named 'arc._common'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./DeletingSwigIteratorObtainedFromPublicListRegTest.py", line
7, in <module>
import arc
File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/__init__.py",
line 5, in <module>
from arc.common import *
File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/common.py",
line 21, in <module>
_common = swig_import_helper()
File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/common.py",
line 20, in swig_import_helper
return importlib.import_module('_common')
File "/usr/lib64/python3.5/importlib/__init__.py", line 126, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_common'

No _common.so file exists. I found only libarccommon.so

/builddir/build/BUILD/nordugrid-arc-5.1.1/src/hed/libs/common/.libs/libarccommon.so

$ find ./nordugrid-arc-5.1.1/python/altpython/ -name *common*
./nordugrid-arc-5.1.1/python/altpython/arc/__pycache__/common.cpython-35.pyc
./nordugrid-arc-5.1.1/python/altpython/arc/common.py
./nordugrid-arc-5.1.1/python/altpython/arc/common_wrap.cpp
./nordugrid-arc-5.1.1/python/altpython/arc/.deps/common_wrap.deps
./nordugrid-arc-5.1.1/python/altpython/arc/_arc_la-common_wrap.lo
./nordugrid-arc-5.1.1/python/altpython/arc/.libs/_arc_la-common_wrap.o

$ find ./nordugrid-arc-5.1.1/python/altpython/ -name __init__.py
./nordugrid-arc-5.1.1/python/altpython/arc/__init__.py

I don't know what could be wrong with the libtool stuff.

Jitka
m***@comcast.net
2016-06-08 18:15:06 UTC
Permalink
...
Post by Jitka Plesníková
However, I have finished rebuild of subversion and
nordugrid-arc. Subversion passed.
...
Post by Jitka Plesníková
Traceback (most recent call last): File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/common.py",
line 18, in swig_import_helper return
importlib.import_module(mname) File
"/usr/lib64/python3.5/importlib/__init__.py", line 126, in
import_module return _bootstrap._gcd_import(name[level:],
package, level) File "<frozen importlib._bootstrap>", line 986,
in _gcd_import File "<frozen importlib._bootstrap>", line 969,
in _find_and_load File "<frozen importlib._bootstrap>", line
956, in _find_and_load_unlocked ImportError: No module named
'arc._common'
Right here the swig code was trying to load 'arc._common'. Which is
the _common.so module from the same package common.py is part of.
Post by Jitka Plesníková
During handling of the above exception,
And then the swig wrapper code catches the ImportError and tried to
load _common.so as a global module.
Post by Jitka Plesníková
another
exception occurred: Traceback (most recent call last): File
"./DeletingSwigIteratorObtainedFromPublicListRegTest.py", line
7, in <module> import arc File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/__init__.py",
line 5, in <module> from arc.common import * File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/common.py",
line 21, in <module> _common = swig_import_helper() File
"/builddir/build/BUILD/nordugrid-arc-5.1.1/python/altpython/arc/common.py",
line 20, in swig_import_helper return
importlib.import_module('_common') File
"/usr/lib64/python3.5/importlib/__init__.py", line 126, in
import_module return _bootstrap._gcd_import(name[level:],
package, level) ImportError: No module named '_common'
No _common.so file exists. I found only libarccommon.so
And _common does not exist as a global module *anywhere* on the
PYTHONPATH.
Post by Jitka Plesníková
$ find ./nordugrid-arc-5.1.1/python/altpython/ -name *common*
./nordugrid-arc-5.1.1/python/altpython/arc/__pycache__/common.cpython-35.pyc
./nordugrid-arc-5.1.1/python/altpython/arc/common.py
./nordugrid-arc-5.1.1/python/altpython/arc/common_wrap.cpp
./nordugrid-arc-5.1.1/python/altpython/arc/.deps/common_wrap.deps
./nordugrid-arc-5.1.1/python/altpython/arc/_arc_la-common_wrap.lo
./nordugrid-arc-5.1.1/python/altpython/arc/.libs/_arc_la-common_wrap.o
$ find ./nordugrid-arc-5.1.1/python/altpython/ -name
__init__.py
./nordugrid-arc-5.1.1/python/altpython/arc/__init__.py
If this nordugrid-arc package does work with swig-3.0.8 then it
would be super interesting to know where in the heck it is finding a
python module named _common. It would be very interesting to see a:

find /builddir/build/BUILD/nordugrid-arc-5.1.1/ -name "*_common*"

and maybe even better:

find / -name "*_common*"

It could be that the nordugrid-arc package sets PYTHONPATH
*anywhere* on the filesystem and was pulling in a _common module from
some place that it is not even a part of the package.

Mike
Jitka Plesníková
2016-06-09 07:10:58 UTC
Permalink
Post by William S Fulton
Hi Jitka
Could you kindly download and test the release candidate on Fedora
from http://prdownloads.sourceforge.net/swig/swig-3.0.10-rc1.tar.gz?
We've fixed the Python import problems, so you should hopefully get a
clean run compared to 3.0.9.
I'll hold off releasing this until we get your feedback. Finally
thanks very much in advance, this is quite fantastic being able to
test so many projects dependent on SWIG.
William
Hi,

the rebuild finished and everything works fine except nordugrid-arc as I
wrote yesterday.

Jitka
William S Fulton
2016-06-09 07:19:01 UTC
Permalink
Post by Jitka Plesníková
Post by William S Fulton
Hi Jitka
Could you kindly download and test the release candidate on Fedora
from http://prdownloads.sourceforge.net/swig/swig-3.0.10-rc1.tar.gz?
We've fixed the Python import problems, so you should hopefully get a
clean run compared to 3.0.9.
I'll hold off releasing this until we get your feedback. Finally
thanks very much in advance, this is quite fantastic being able to
test so many projects dependent on SWIG.
William
Hi,
the rebuild finished and everything works fine except nordugrid-arc as I
wrote yesterday.
Thanks, that's much appreciated. Do you have a simple guilde / link as
to how to replicate this? I presume it is a case of downloading the
source and running ./configure && make && make check ? What would be
useful is to know the dependencies required to build this package....
maybe a full build log contains all this info?

William
Jitka Plesníková
2016-06-09 08:36:22 UTC
Permalink
Post by William S Fulton
Thanks, that's much appreciated. Do you have a simple guilde / link as
to how to replicate this? I presume it is a case of downloading the
source and running ./configure && make && make check ? What would be
useful is to know the dependencies required to build this package....
maybe a full build log contains all this info?
William
I built nordugrid-arc from Fedora source rpm. You can find complete
build.log here.
https://jplesnik.fedorapeople.org/nordugrid-arc/

I attached the list of dependencies requires by source rpm.
I also attached the list of some commands which are running during the build
and you should be able to reproduce the failure with it.

Jitka
Jitka Plesníková
2016-06-09 09:59:49 UTC
Permalink
Post by Jitka Plesníková
I built nordugrid-arc from Fedora source rpm. You can find complete
build.log here.
https://jplesnik.fedorapeople.org/nordugrid-arc/
I attached the list of dependencies requires by source rpm.
I also attached the list of some commands which are running during the build
and you should be able to reproduce the failure with it.
Jitka
The test failed when option "--with-altpython=python3" is used for
configure.

Tests passed without that option.

Jitka
m***@comcast.net
2016-06-09 18:16:07 UTC
Permalink
Post by Jitka Plesníková
Post by Jitka Plesníková
I built nordugrid-arc from Fedora source rpm. You can find
complete build.log here.
https://jplesnik.fedorapeople.org/nordugrid-arc/
I attached the list of dependencies requires by source rpm. I
also attached the list of some commands which are running
during the build and you should be able to reproduce the
failure with it.
Jitka
The test failed when option "--with-altpython=python3" is used
for configure.
I've been able to build nordugrid-arc from source found on the
projects main site. The tests must have some run-time dependency I
don't have installed. But looking at the source, I can tell a bit
about what is going on.

They have a python package called arc. All of the swig generated
C wrapper modules are combined into a single shared object called
_arc.so that the packages __init__.py is loading. _arc.so bypasses
the normal python import machinery and calls each swig wrappers
PyModule_init() method. It also injects attributes (_common, _loader,
_message, etc) into the arc package module.

Right before it (_arc.so) initializes the embedded modules it
"imports" a reference to it's package with the following line of code:


// Initialise all the SWIG low level modules
PyObject *package = PyImport_AddModule((char *)"arc"); // a means to get a ha\
ndle to the package, not sure if this is a great idea but it works


The documentation for PyImport_AddModule has this to say:

Note: This function does not load or import the module; if the module
wasn’t already loaded, you will get an empty module object. Use
PyImport_ImportModule() or one of its variants to import a
module. Package structures implied by a dotted name for name are not
created if not already present.


What concerns me is that all this is going on while the package arc
is still being initialized. arc/__init__.py is the one which loads
_arc. This module is loaded as a global by python since (like with
SVN) it is not in the arc package. This in itself is fine and should
not cause a problem now.

However __init__.py (the arc package itself) is not done being
loaded by python and _arc then begins messing around with the python
loading machinery as mentioned above. The end result is that the new
code in swig:

importlib.import_module('_common') # fails

but the older way apparently works:

from arc import _common

I was told by Brett Cannon (core python developer) just a few months
ago that importlib.import_module() was the preferred way to import
named modules. My guess is that what _arc.so is doing is messing up
the normal python import machinery.

As I read the code, _arc.so initializes _common but goes totally
around the python import system. It then adds this module (not part
of a package and not in sys.modules as far as I can tell) as an attribute
to arc. So, 'from arc import _common' "works" because the import
statement is sucking in an attribute from arc and not really loading a
module at all.

Here is a little experiment simply loading _arc (as arc/__init__.py
does):

lrd > pwd
/home/romberg/kde/Downloads/nordugrid-arc-5.1.1/python/altpython
lrd > setenv PYTHONPATH arc/.libs
lrd > python3
Python 3.4.3 (default, Mar 31 2016, 20:42:37)
[GCC 5.3.1 20151207 (Red Hat 5.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Post by Jitka Plesníková
Post by Jitka Plesníková
import _arc
import sys
sys.modules.keys()
dict_keys(['_locale', 'marshal', '_warnings', '__main__', 'sys',
'abc', '_codecs', '_arc', 'encodings.utf_8', 'readline', '_thread',
'encodings.aliases', 'sysconfig', 'io', 'abrt_exception_handler3',
'_collections_abc', 'codecs', 'os.path', 'builtins', '_imp',
'posixpath', '_frozen_importlib', 'errno', 'swig_runtime_data4',
'genericpath', 'posix', 'stat', 'site', 'zipimport', '_weakref', 'os',
'atexit', '_weakrefset', 'encodings.latin_1', '_io', 'encodings',
'_sitebuiltins', 'arc', 'signal', '_stat', 'rlcompleter',
'_bootlocale', '_sysconfigdata'])

So, _common and the other modules have had their init() methods
called. But they are not in sys.modules. So, none of the normal
python import machinery can find them.

In a nutshell, I think the method arc is using to combine their swig
modules works with swig-3.0.8 because of a strange undocumented side
case of how 'from arc import X' works when arc is still under
construction. As it is being constructed _arc is adding attributes to
it. And also counting on 'from arc import X' going directly into the
currently under construction module and pulling out attributes to
use. The whole thing looks somewhat sketchy. The arc developer
mentions this in the comment above.

Swig could simply pull out all my changes and the above "method" of
how arc imports C modules will continue to work (until someone tweaks
the python machinery :). Switching to using importlib was/is intended to make
things easier for folks like the arc developers. With the changes in
swig-3.0.10 they can now actually put all the swig .so objects into
the arc package like they are clearly trying to do. The swig-3.0.8
code prevents them from doing so because all _foo.so modules are being
loaded as globals.

Or I can add another test case to swig and this could become another
supported method of module/package loading.

Mike

P.S. Sorry for the wall of text. But it is sorta complicated.
m***@comcast.net
2016-06-09 18:38:15 UTC
Permalink
...
Post by Jitka Plesníková
The test failed when option "--with-altpython=python3" is used
for configure.
Another alternative is that I could *try* to provide a patch for
_arc.so so that it simply loads things like _common.so as arc._common
like it is trying to do. This way after 'import _arc' sys.modules
would contain an entry for things like 'arc._common'.

Mike
m***@comcast.net
2016-06-09 20:02:12 UTC
Permalink
Post by m***@comcast.net
Another alternative is that I could *try* to provide a patch
for _arc.so so that it simply loads things like _common.so as
arc._common like it is trying to do. This way after 'import
_arc' sys.modules would contain an entry for things like
'arc._common'.
Here is the patch. Their init_extension_module() is not really
python3 compliant. An extensions, init() method is suppose to return
a single module object for the newly loaded module. Here they are
loading a half dozen or so modules and return the module only for the
python package module. It currently "works" due to undocumented edge
cases in the python loader.

This patch adds those otherwise hidden
modules to sys.modules. The import of the arc package now works. I
did not run the tests as I don't feel up to hunting down and
installing all the other dependent packages. But I see no reason why
al of its tests should not work with this patch:
William S Fulton
2016-06-09 22:37:38 UTC
Permalink
Thanks for diagnosing. Given the unusual importing it seems reasonable to
not support this their quirky module loading and I'm all for helping fix
nordugrid-arc with some more standard module loading. I will mark this
change in SWIG's changes file as potentially breaking backwards
compatibility. Can you send a Sunday of what to look out for and maybe some
info on what to change. Let's work with nordugrid-arc to accept your patch.
Does the patch work with older versions of SWIG too?
Post by m***@comcast.net
Post by m***@comcast.net
Another alternative is that I could *try* to provide a patch
for _arc.so so that it simply loads things like _common.so as
arc._common like it is trying to do. This way after 'import
_arc' sys.modules would contain an entry for things like
'arc._common'.
Here is the patch. Their init_extension_module() is not really
python3 compliant. An extensions, init() method is suppose to return
a single module object for the newly loaded module. Here they are
loading a half dozen or so modules and return the module only for the
python package module. It currently "works" due to undocumented edge
cases in the python loader.
This patch adds those otherwise hidden
modules to sys.modules. The import of the arc package now works. I
did not run the tests as I don't feel up to hunting down and
installing all the other dependent packages. But I see no reason why
m***@comcast.net
2016-06-09 23:08:18 UTC
Permalink
Post by William S Fulton
Thanks for diagnosing. Given the unusual importing it seems
reasonable to not support this their quirky module loading and
I'm all for helping fix nordugrid-arc with some more standard
module loading. I will mark this change in SWIG's changes file
as potentially breaking backwards compatibility. Can you send a
Sunday of what to look out for and maybe some info on what to
change.
Yes. Should I add this to the pull request I already have for swig
and python documentation changes?

https://github.com/swig/swig/pull/702
Post by William S Fulton
Let's work with nordugrid-arc to accept your patch.
Does the patch work with older versions of SWIG too?
I think it should. All my patch does is to inject the module names
of their C interface modules (such as _common, _message, etc) into
sys.modules. This is what would happen if these modules were added in
the normal fashion. There is a small side effect.

Before, all of these modules did not really exist to python. Their
init() methods were being called. So, they were initialized. But
python3 itself never saw them because they were not properly loaded.

Instead an attribute was added to the arc package. Which 'from arc
import _common' loads just as it would be loading a string or
integer. Python has no clue that arc._common is really a module
object. This patch continues the kludge but also now adds '_common'
to sys.modules so future imports can find it and know that it is
indeed a module. The side effect is that '_common' is now a global
name. And will conflict with any other module with the same name.

The correct fix is for nordugrid-arc to correctly load each of these
modules into the arc package. But that is a more extensive change.
Swig-3.0.10 will support this when they do it. But it will require a
bit more work. I just created a patch that redhat may wish to use to
make nordugrid-arc work in the meantime.

Mike
William S Fulton
2016-06-11 00:06:28 UTC
Permalink
Post by m***@comcast.net
Post by William S Fulton
Thanks for diagnosing. Given the unusual importing it seems
reasonable to not support this their quirky module loading and
I'm all for helping fix nordugrid-arc with some more standard
module loading. I will mark this change in SWIG's changes file
as potentially breaking backwards compatibility. Can you send a
Sunday of what to look out for and maybe some info on what to
change.
Yes. Should I add this to the pull request I already have for swig
and python documentation changes?
https://github.com/swig/swig/pull/702
I've merged that in now, so probably just email a short summary for
users to go into the CHANGES.current file of what is not backwards
compatible. Or no harm done extending the docs further.
Post by m***@comcast.net
Post by William S Fulton
Let's work with nordugrid-arc to accept your patch.
Does the patch work with older versions of SWIG too?
I think it should. All my patch does is to inject the module names
of their C interface modules (such as _common, _message, etc) into
sys.modules. This is what would happen if these modules were added in
the normal fashion. There is a small side effect.
Before, all of these modules did not really exist to python. Their
init() methods were being called. So, they were initialized. But
python3 itself never saw them because they were not properly loaded.
Instead an attribute was added to the arc package. Which 'from arc
import _common' loads just as it would be loading a string or
integer. Python has no clue that arc._common is really a module
object. This patch continues the kludge but also now adds '_common'
to sys.modules so future imports can find it and know that it is
indeed a module. The side effect is that '_common' is now a global
name. And will conflict with any other module with the same name.
The correct fix is for nordugrid-arc to correctly load each of these
modules into the arc package. But that is a more extensive change.
Swig-3.0.10 will support this when they do it. But it will require a
bit more work. I just created a patch that redhat may wish to use to
make nordugrid-arc work in the meantime.
I think you should post the patch to the nordugrid-arc community too.
Jitka, will probably want the patch pushed upstream to them.

I'm still not clear if the patch to nordugrid-arc will work with both
swig-3.0.8 and swig-3.0.10? I'll hopefully get a chance tomorrow to
set up a Fedora machine and download the source and use your patch and
run their tests.

William
m***@comcast.net
2016-06-11 01:09:44 UTC
Permalink
...
Post by William S Fulton
I've merged that in now, so probably just email a short summary
for users to go into the CHANGES.current file of what is not
backwards compatible. Or no harm done extending the docs
further.
I'll do both. Probably tomorrow when I get a chance.

...
Post by William S Fulton
I'm still not clear if the patch to nordugrid-arc will work with
both swig-3.0.8 and swig-3.0.10? I'll hopefully get a chance
tomorrow to set up a Fedora machine and download the source and
use your patch and run their tests.
The nordugrid-arc still adds atributes called _common, etc. to the
arc package. That is the module that is the package (in python
packages are also modules). So, the 3.0.8 code should still work as
before because it is "loading" then with:

from arc import _common

This is not really an import at all. It is the same as having a
module like this:

==== arthur.py =====
_king = "I am your King!"
==== end arthur.py ==
Post by William S Fulton
python3
Python 3.4.3 (default, Mar 31 2016, 20:42:37)
[GCC 5.3.1 20151207 (Red Hat 5.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Post by William S Fulton
from arthur import _king
_king
'I am your king!'
Here _king is a simple string. In nordugrid-arc's case the
attribute is a module that no one knows about except the arc package.
It just happens to work because swig-3.0.8 was using the "from foo
import bar" which can mean one of two things. Either import a new
module or pull an attribute from one module into another.

My patch keeps all this in place. So, it should still work with
3.0.8. What it does do is add these symbols (_common and the rest) to
sys.modules so that importlib and any other python loader will see
them in the cache and can get them from there without looking on disk
(where they will never be found since they are linked into _arc.so).

I tested it as far as doing an "import arc" with python3 and it no
longer failed. It did fail before my patch. It would be good to
actually run their test suite. I was not able to do so because of
missing dependencies.

Mike

P.S. The real way for them is to properly load/register the modules
the way the python3 docs say you should. I'll go over the swig docs
on this and update them. There is a good chance they are not up to
date with what is going on with python3.

In the past (before python3) one could simply call what was the
init() method that would have been called by the shared library
loader. In python3, this is not good enough anymore. Your Python
module's init() needs to be called from python itself, or you need to
register your embeded module with python *before* Python_Init() is
called. Going around this (which is what nordugrid-arc is doing) is
treading on thin ice.

I'll make sure the swig docs point out the correct way to link
static/embeded modules with python2 and python3.
William S Fulton
2016-06-11 19:55:06 UTC
Permalink
Post by m***@comcast.net
My patch keeps all this in place. So, it should still work with
3.0.8. What it does do is add these symbols (_common and the rest) to
sys.modules so that importlib and any other python loader will see
them in the cache and can get them from there without looking on disk
(where they will never be found since they are linked into _arc.so).
I tested it as far as doing an "import arc" with python3 and it no
longer failed. It did fail before my patch. It would be good to
actually run their test suite. I was not able to do so because of
missing dependencies.
The nordugrid-arc tests pass (make check) with your patch with
swig-3.0.10-rc1. For the record I 'discovered' rpmbuild for an easy
way to build packages and test it all by setting up a Fedora 23
virtual machine, then:

sudo dnf download --source nordugrid-arc
sudo dnf install rpm-build
rpmbuild --rebuild nordugrid-arc-5.1.1-1.fc23.src.rpm

This then failed with a list of dependencies needed (I think the same
list that Jitka provided). Then install the dependencies required:

sudo dnf install canl-c++-devel cppunit-devel gfal2-devel glib2-devel
glibmm24-devel globus-common-devel globus-ftp-client-devel
globus-ftp-control-devel junit libdb-cxx-devel libs3-devel
libtool-ltdl-devel libuuid-devel libxml2-devel nss-devel
openldap-devel openssl-devel "perl(DBI)" "perl(Test::Harness)"
"perl(Test::Simple)" "perl(XML::Simple)" pyOpenSSL pylint python-devel
python-twisted-core python-twisted-web python3-devel
selinux-policy-devel sqlite-devel swig xmlsec1-devel
xmlsec1-openssl-devel xrootd-client-devel

rpmbuild --rebuild --noclean nordugrid-arc-5.1.1-1.fc23.src.rpm

to build. This will pass with the installed version of swig and the
untarred package will be built in ~/rpmbuild/BUILD/nordugrid-arc-5.1.1
where you can then make customisations and run the usual 'configure &&
make && make check' commands.

As this all looks sorted now, I'll release swig-3.0.10 tomorrow once I
have Mike's latest doc changes. Mike, can you and Jitka organise to
get your patch into nordugrid-arc please?

William
m***@comcast.net
2016-06-11 22:37:07 UTC
Permalink
Post by William S Fulton
...
Thanks for the pointers on the source rpms. I'm still learning
about how they operate.
Post by William S Fulton
As this all looks sorted now, I'll release swig-3.0.10 tomorrow
once I have Mike's latest doc changes.
I've put out a new pull request which has more documentation
covering the init() function and how it relates to statically linked
modules for python2 and python3. Feel free to edit any of it.

For a release note, I don't think we should get real specific about
the way in which the nordugrid-arc package was broken as it is a
fairly strange setup. They were calling swig modules embeded into a
dynamically linked module. It is an idea, that is probably best not
talked about further. :)

However I'd mention something along these lines:

Swig-3.0.10 has been modified to ease the creation of wrapper modules
that can be fully made part of a python package. Swig no longer
assumes the dynamically linked C module is a global module.
With Swig-3.0.10 the dynamic module can now be placed
into either the same package as the pure python module or as a global
module. Both locations are used by the python wrapper to locate the C
module.

However this could cause a backwards incompatibility with some code
that was relying on the ability of "from package import _module" to
pull attributes out of the package directly. If your code populates a
module (which is also a package) with attributes that are swig
generated modules which were not loaded in a conventional way,
swig-3.0.8 and earlier may have worked due to 'from package import
_module' bypassing a real import and pulling your module in as an
attribute. This will no longer work. Since this is not a common (or
even recommend) practice, most folks should not be affected.
Post by William S Fulton
Mike, can you and Jitka
organise to get your patch into nordugrid-arc please?
Jitka could add the patch to the rpm (I know rpm has the ability to
do this) if desired. And if Jitka would like to push the patch
further upstream, the nordugrid-arc folks can feel free to contact me
about it.

Mike
Jitka Plesníková
2016-06-14 07:46:41 UTC
Permalink
Post by m***@comcast.net
Post by William S Fulton
Mike, can you and Jitka
organise to get your patch into nordugrid-arc please?
Jitka could add the patch to the rpm (I know rpm has the ability to
do this) if desired. And if Jitka would like to push the patch
further upstream, the nordugrid-arc folks can feel free to contact me
about it.
Mike
The patch works with SWIG 3.0.10 and 3.0.8 in Fedora.
I reported the issue and provided the patch to package maintainer of
nordugrid-arc.

Thank you all for your effort,
Jitka
William S Fulton
2016-06-15 18:12:30 UTC
Permalink
Post by Jitka Plesníková
Post by m***@comcast.net
Post by William S Fulton
Mike, can you and Jitka
organise to get your patch into nordugrid-arc please?
Jitka could add the patch to the rpm (I know rpm has the ability to
do this) if desired. And if Jitka would like to push the patch
further upstream, the nordugrid-arc folks can feel free to contact me
about it.
Mike
The patch works with SWIG 3.0.10 and 3.0.8 in Fedora.
I reported the issue and provided the patch to package maintainer of
nordugrid-arc.
Thank you all for your effort,
Well, an even bigger thanks to you and presumably Redhat for testing
so many packages.

William

Loading...