Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Afif Elghraoui Newsgroups: linux.debian.maint.python Subject: pybuild renaming extensions breaks upstream code Date: Sun, 03 Jul 2016 01:40:01 +0200 Message-ID: X-Mailbox-Line: From debian-python-request@lists.debian.org Sat Jul 2 23:36:10 2016 Old-Return-Path: X-Amavis-Spam-Status: No, score=-4.18 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, BODY_8BITS=1.5, LDO_WHITELIST=-5, MEDS2=2, MURPHY_DRUGS_REL8=0.02, RCVD_IN_DNSWL_LOW=-0.7] autolearn=no autolearn_force=no X-Policyd-Weight: using cached result; rate: -5 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailing-List: archive/latest/13961 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/c472b966-1986-ac21-6b1d-e348d7b544fc@debian.org Approved: robomod@news.nic.it Lines: 46 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sat, 2 Jul 2016 16:20:11 -0700 X-Original-Message-ID: Xref: csiph.com linux.debian.maint.python:8627 Hello, I'm maintaining a set of python modules that have this pattern of code for finding compiled extensions (this example is from the kineticstools package): ~~~ if platform.system() == "Windows": libfn = "tree_predict.dll" path = os.path.dirname(os.path.abspath(__file__)) windowsLib = path + os.path.sep + libfn if os.path.exists(windowsLib): self._lib = np.ctypeslib.load_library(libfn, path) else: raise Exception("can't find tree_predict.dll") else: DLL_PATH = _getAbsPath("tree_predict.so") if os.path.exists(DLL_PATH): self._lib = np.ctypeslib.load_library("tree_predict.so", DLL_PATH) else: raise Exception("can't find tree_predict.so") ~~~ When the package is built and the architecture is renamed: I: dh_python2 fs:322: renaming tree_predict.so to tree_predict.x86_64-linux-gnu.so the upstream code breaks. What I've done in the past is patch it so that it searches for the extension the way we rename it (which I get using sysconfig.get_config_var('MULTIARCH')) as in the patch at http://anonscm.debian.org/git/debian-med/pbh5tools.git/tree/debian/patches/multiarch-module-path.patch Is there a better way around this problem? Many thanks and regards Afif -- Afif Elghraoui | عفيف الغراوي http://afif.ghraoui.name