Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))
On Thu, 12 Dec 2019, Andreas Tille wrote: 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: Looks like the debian/rules file is specifying /usr/share/pdb2pqr as PREFIX: https://salsa.debian.org/med-team/pdb2pqr/blob/master/debian/rules#L33 Arrghh, good if somebody else is proof-reading. However, setting this does not help: mkdir -p /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr scons \ URL="http://localhost/pdb2pqr/"; \ PREFIX="/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr" 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. I think you need to change the other open() call in that function to write in text mode also. Scott
Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))
On Thu, Dec 12, 2019 at 03:49:13PM -0500, Scott Talbert wrote: > > > > 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: > > Looks like the debian/rules file is specifying /usr/share/pdb2pqr as PREFIX: > > https://salsa.debian.org/med-team/pdb2pqr/blob/master/debian/rules#L33 Arrghh, good if somebody else is proof-reading. However, setting this does not help: mkdir -p /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr scons \ URL="http://localhost/pdb2pqr/"; \ PREFIX="/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr" 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.so', 'pdb2pka/_pMC_mult.cpython-37m-x86_64-linux-gnu.so'] Configuration Parameters Version: 2.1.1 Install directory: /build/pdb2pqr-2.1.1+dfsg/debian/tmp/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 /build/pdb2pqr-2.1.1+dfsg/debian/tmp/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 /build/pdb2pqr-2.1.1+dfsg/debian/tmp/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 make[1]: *** [debian/rules:29: override_dh_auto_configure] Error 2 make[1]: Leaving directory '/build/pdb2pqr-2.1.1+dfsg' make: *** [debian/rules:13: build] Error 2 dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 I: copying local configuration E: Failed autobuilding of package I intentionally created the dir /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr/ before the fixed scons call - but the result is the same. :-( Kind regards Andreas. -- http://fam-tille.de
Re: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))
On Thu, 12 Dec 2019, Andreas Tille 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: Looks like the debian/rules file is specifying /usr/share/pdb2pqr as PREFIX: https://salsa.debian.org/med-team/pdb2pqr/blob/master/debian/rules#L33 Scott
Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))
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
Re: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)
On Thu, 12 Dec 2019, Andreas Tille wrote: Control: tags -1 help Hi, it seems pdb2pqr is orphaned upstream. However, it seems to be worth keeping inside Debian thus I tried my luck to port it to Python3 in Git[1]. Unfortunately the build runs into scons: Building targets ... CopySubAction("pdb2pqr.py", "pdb2pqr.py.in") scons: *** [pdb2pqr.py] TypeError : a bytes-like object is required, not 'str' Traceback (most recent call last): File "/usr/lib/scons/SCons/Action.py", line 1209, in execute result = self.execfunction(target=target, source=rsources, env=env) File "/usr/lib/scons/SCons/Action.py", line 1371, in __call__ return self.parent.actfunc(*args, **kw) File "./site_scons/site_init.py", line 123, in CopySubAction contents = contents.replace(k, v) TypeError: a bytes-like object is required, not 'str' scons: building terminated because of errors. I wonder whether it might just be a scons issue. Please note that I'm using scons 3.1.1-4 from experimental that is supposed to run with Python3. Any hint would be welcome. Kind regards Andreas. [1] https://salsa.debian.org/med-team/pdb2pqr I don't see any Python3 changes in that repository. Did you push your changes? 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. Scott
Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)
Control: tags -1 help Hi, it seems pdb2pqr is orphaned upstream. However, it seems to be worth keeping inside Debian thus I tried my luck to port it to Python3 in Git[1]. Unfortunately the build runs into scons: Building targets ... CopySubAction("pdb2pqr.py", "pdb2pqr.py.in") scons: *** [pdb2pqr.py] TypeError : a bytes-like object is required, not 'str' Traceback (most recent call last): File "/usr/lib/scons/SCons/Action.py", line 1209, in execute result = self.execfunction(target=target, source=rsources, env=env) File "/usr/lib/scons/SCons/Action.py", line 1371, in __call__ return self.parent.actfunc(*args, **kw) File "./site_scons/site_init.py", line 123, in CopySubAction contents = contents.replace(k, v) TypeError: a bytes-like object is required, not 'str' scons: building terminated because of errors. I wonder whether it might just be a scons issue. Please note that I'm using scons 3.1.1-4 from experimental that is supposed to run with Python3. Any hint would be welcome. Kind regards Andreas. [1] https://salsa.debian.org/med-team/pdb2pqr -- http://fam-tille.de