Opened 8 years ago

Closed 8 years ago

#1728 closed defect (fixed)

python import and versioned modules

Reported by: jreed Owned by: muks
Priority: medium Milestone: Sprint-20120403
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 5 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

(I originally discussed this on Jabber at end of January.)

Some libtools (such as OpenBSD policy) do not create symlinks for .so shared libraries. So the only files created are versioned (with numbers). This causes errors like:

File "/home/jreed/src/bind10/src/lib/dns/python/tests/edns_python_test.py", line 18, in <module>
    from pydnspp import *
ImportError: No module named pydnspp

Python import assumes .so or .py, but not other suffixes (like 0.0).

Looking on my personal system I don't see any python using shared objects that have versioned names other than bind10. Maybe we shouldn't be versioning them?

Problem files include: pydnspp.so.0.0, pyunittests_util.so.0.0, log.so.0.0, datasrc.so.0.0, libutil_io_python.so.0.0, and others.

A workaround is to create the symlinks.

I think the correct fix is not version the filenames.

If we do want versioning for these python modules, then put them into directories that are versioned and the use PYTHONPATH as needed.

Subtickets

Change History (13)

comment:1 Changed 8 years ago by shane

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:2 Changed 8 years ago by jinmei

I would suggest what other python packages do for OpenBSD (if they do anything).

comment:3 Changed 8 years ago by jelte

  • Estimated Difficulty changed from 0 to 5

comment:4 Changed 8 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20120320

comment:5 Changed 8 years ago by muks

  • Owner changed from UnAssigned to muks
  • Status changed from new to assigned

Picking bug

comment:6 Changed 8 years ago by muks

The trac1728 branch has -avoid-version added to the libtool args to not add version in the .so files.

comment:7 Changed 8 years ago by muks

  • Owner changed from muks to UnAssigned
  • Status changed from assigned to reviewing

make check passes in src/lib/dns/python/

The trac1728 branch is ready for review now. It has -avoid-version added to all places where Python modules are created. You should also check this during review.

comment:8 Changed 8 years ago by vorner

  • Owner changed from UnAssigned to vorner

comment:9 Changed 8 years ago by vorner

  • Owner changed from vorner to muks

Hello

While I can't check it passes the tests on OpenBSD, I did grep for '-module' and all the places that used it use now the -avoid-version. However, is it correct? The ones in datasrc are not python modules, we dlopen them ourself. I don't know if we expect them to be versioned or not, then or if that is intentional.

Thanks

comment:10 Changed 8 years ago by muks

We do require the -avoid-version in src/lib/datasrc too, otherwise it versions them and they fail to load (a similar problem to the Python modules).

comment:11 Changed 8 years ago by muks

  • Owner changed from muks to vorner

comment:12 Changed 8 years ago by vorner

  • Owner changed from vorner to muks

OK, then please merge.

comment:13 Changed 8 years ago by muks

  • Resolution set to fixed
  • Status changed from reviewing to closed

Pushed to master:

* 51b3f09 bug #1728: Add -avoid-version in some more places
* 652ae9e bug #1728: Set LD_LIBRARY_PATH on OpenBSD as well
* ba9dcb4 master: Fix AC_LANG_SOURCE warnings from automake
* c6d6f76 bug #1728: Add -avoid-version to LDFLAGS for Python modules (contd.)
* 927397a bug #1728: Add -avoid-version to LDFLAGS for Python modules

Resolving bug as fixed.

Note: See TracTickets for help on using tickets.