Page 1 of 1

[SOLVED] problem compiling protobuf3 from SlackBuild

Posted: 24. Apr 2022, 13:17
by tsuren
I've been playing around with the Salix 15 alpha 2 for a few days now. So far things are running fine - except for this one thing this morning. It's nothing critical I guess and probably not related to Salix itself, but I am having some problem compiling protobuf3 from slackbuild with slapt-src.

The error message I got at the end is:
Traceback (most recent call last):
File "setup.py", line 11, in <module>
import pkg_resources
ImportError: No module named pkg_resources
Is it only me who's having this problem? pkg_resources I think is in python-setuptools, and it's well installed...

Thanks for your help!

Re: problem compiling protobuf3 from SlackBuild

Posted: 24. Apr 2022, 22:06
by laprjns
Fails with the same error here. It looks like it is being built with python 2.7 instead of python 3. I took a look at the SLACKBUILD and found the following:

Code: Select all

# Install the python bindings
...
cd python
python setup.py install --root=$PKG
python3 setup.py install --root=$PKG
cd ..
I commented out the "python setup.py install --root=$PKG" line and manually ran the SLACKBUILD.

Code: Select all

sudo sh /usr/src/slapt-src/development/protobuf3/protobuf3.SlackBuild 
The package was successfully built with python3.

I am not sure if this is a problem with the SLACKBUILD or Salix 15 alpha. I was under the impression that python3 was the default in Slackware 15 and hence also in Salix 15, but python is symlinked to python2.7 in /usr/bin.

Code: Select all

rich[~]$ ls -l /usr/bin/python*
lrwxrwxrwx 1 root root     9 Apr 15 10:37 /usr/bin/python -> python2.7
EDIT, Changing the python symlink to point to python3 will result in the original slackbuild successfully building with python3

Re: problem compiling protobuf3 from SlackBuild

Posted: 24. Apr 2022, 23:35
by tsuren
Great! It works after commenting out the line. Thanks!

Just another question. is it a common practice to have two lines like this for python setup? I don't know if I should inform the maintainer of protobuf3 on slackbuild.

Edit: how can I rename the thread title with [solved]?

Re: problem compiling protobuf3 from SlackBuild

Posted: 25. Apr 2022, 16:08
by gapan
laprjns wrote: 24. Apr 2022, 22:06 I am not sure if this is a problem with the SLACKBUILD or Salix 15 alpha. I was under the impression that python3 was the default in Slackware 15 and hence also in Salix 15, but python is symlinked to python2.7 in /usr/bin.
Yes, it's supposed to be like that, even if python3 is the default. According to Python devs, python should always symlink to python2, never python3, even if only python3 is installed. That's why it is like that. I'm guessing nobody really tested the protobuf3 SlackBuild at SBo and that's why it fails.
laprjns wrote: 24. Apr 2022, 22:06 EDIT, Changing the python symlink to point to python3 will result in the original slackbuild successfully building with python3
I suggest you revert that change, due to the reasoning above. Otherwise you might find some trouble.

Re: problem compiling protobuf3 from SlackBuild

Posted: 25. Apr 2022, 16:09
by gapan
tsuren wrote: 24. Apr 2022, 23:35 Just another question. is it a common practice to have two lines like this for python setup? I don't know if I should inform the maintainer of protobuf3 on slackbuild.
Yes, it is, if you want to build both python2 and python3 modules.
tsuren wrote: 24. Apr 2022, 23:35 Edit: how can I rename the thread title with [solved]?
Done. You need to edit the title of your first post.

Re: problem compiling protobuf3 from SlackBuild

Posted: 26. Apr 2022, 16:00
by tsuren
gapan wrote: 25. Apr 2022, 16:09 Yes, it is, if you want to build both python2 and python3 modules.
OK, thanks. I didn't know.
gapan wrote: 25. Apr 2022, 16:09 Done. You need to edit the title of your first post.
Thanks for changing it! I was and am not able to change the contents of the first post.