[SOLVED] problem compiling protobuf3 from SlackBuild

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
tsuren
Posts: 206
Joined: 7. Jun 2009, 17:32
Location: France

[SOLVED] problem compiling protobuf3 from SlackBuild

Post 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!
'Tommorow is like today, just happens tomorrow.'
User avatar
laprjns
Salix Warrior
Posts: 1105
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: problem compiling protobuf3 from SlackBuild

Post 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
“Don’t you see that the whole aim of Newspeak is to narrow the range of thought?"
User avatar
tsuren
Posts: 206
Joined: 7. Jun 2009, 17:32
Location: France

Re: problem compiling protobuf3 from SlackBuild

Post 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]?
'Tommorow is like today, just happens tomorrow.'
User avatar
gapan
Salix Wizard
Posts: 6236
Joined: 6. Jun 2009, 17:40

Re: problem compiling protobuf3 from SlackBuild

Post 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.
Image
Image
User avatar
gapan
Salix Wizard
Posts: 6236
Joined: 6. Jun 2009, 17:40

Re: problem compiling protobuf3 from SlackBuild

Post 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.
Image
Image
User avatar
tsuren
Posts: 206
Joined: 7. Jun 2009, 17:32
Location: France

Re: problem compiling protobuf3 from SlackBuild

Post 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.
'Tommorow is like today, just happens tomorrow.'
Post Reply