[Debian-med-packaging] Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

Andreas Tille andreas at fam-tille.de
Thu Dec 12 20:15:33 GMT 2019


Hi Scott,

On Thu, Dec 12, 2019 at 11:31:09AM -0500, Scott Talbert wrote:
> On Thu, 12 Dec 2019, Andreas Tille wrote:
> 
> I don't see any Python3 changes in that repository.  Did you push your
> changes?

Argh, its pushed now.
 
> Anyway, the problem is likely in CopySubAction in site_scons/site_init.py.
> 
> On line 111, the file 'sourcefile' is opened as binary.  Then, when then
> next line, 'contents = r.read()' is executed, contents ends up as a bytes
> object.  Thus on line 123, when 'contents = contents.replace(k, v)' is
> executed, contents is a bytes object, whereas k and v are strings.  You
> can't mix strings and bytes objects like that in Python 3.
> 
> You could perhaps try opening the file as a text file instead (remove the
> 'b') from the open function call.

That hint was helpful anyway and I get further now.  I think now the
problem is to convince scons to install in $(CURDIR)/debian/tmp which
seems to try rather /usr/share/pdb2pqr directly:

...
scons: Reading SConscript files ...
not using opal.
scons: done reading SConscript files.
scons: Building targets ...
CopySubAction("pdb2pqr.py", "pdb2pqr.py.in")
scons: *** [pdb2pqr.py] Can't write target file pdb2pqr.py
scons: building terminated because of errors.

TARGETS: ['pdb2pqr.py', 'apbs_cgi.cgi', 'visualize.cgi', 'querystatus.cgi', 'src/aconf.py', 'html/server.html', 'pdb2pqr.cgi', 'pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.

========================
Configuration Parameters
========================

Version: 2.1.1
Install directory: /usr/share/pdb2pqr/
pdb2pka and ligand support: True
Path to the website directory: http://localhost/pdb2pqr/
PDB2PQR jobs run via the web interface will be forked on the server.

The preferred way to configure the build is by editing the file build_config.py

Run scons with the python3 that you intend to use with pdb2pqr.
For example: "scons" will setup pdb2pqr to be run with Debian default Python3 interpreter

Run "scons install" to install pdb2pqr in /usr/share/pdb2pqr/

Run "scons basic-test" for a basic functionality test
Run "scons advanced-test" for a single test of ligand and PROPKA support. Requires numpy and PDB2PKA support compiled.
Run "scons complete-test" for a complete test of all functionality EXCEPT PDB2PKA. Requires numpy and PDB2PKA support compiled.
Run "scons pdb2pka-test" for a test of PDB2PKA functionality.
    Requires numpy, PDB2PKA support compiled AND the APBS python3 libraries compiled and installed in the pdb2pka directory.

To setup a web service create a symbolic link to /usr/share/pdb2pqr/ that enables you to view http://localhost/pdb2pqr/ after running "scons install"

Run "scons msvs" to build Visual Studio projects for the Algorithms and pMC_mult modules.
VS project generation is not well supported in scons. Resulting projects should build using NMAKE but cannot be used for debugging.
The resulting projects will need to modified to use VS natively to compile the code or debug.

FAILED!!!!
Failed building pdb2pqr.py: Can't write target file pdb2pqr.py



Inside the pbuilder chroot I realised that some file .variables.cache
was created from where scons is reading the "environment" (it does
not read some PREFIX variable from shell environment as my debugging
showed).  So I changed this to:


/build/pdb2pqr-2.1.1+dfsg# cat .variables.cache 
PREFIX = '/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr/'
URL = 'http://localhost/pdb2pqr/'
DEBUG = True


but it did not helped in the end even after creating the dir manually.
So I have no idea where scons magically tries to write to but fails.
Is there anybody with some scons knowledge?

Kind regards

      Andreas.

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list