sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
264 stars 245 forks source link

PermissionError when trying to install an activity. #946

Closed chimosky closed 3 years ago

chimosky commented 3 years ago

Noticed this while trying to update viewslides activity in F35 SOAS - comes with Python 3.10 -.

Running ./setup.py install --prefix=/usr throws a PermissionError with traceback;

Install /usr/share/sugar/activities/MathHurdler.activity/.bashrc
Traceback (most recent call last):
  File "./setup.py", line 3, in <module>
    bundlebuilder.start()
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/bundlebuilder.py", line 653, in start
    globals()['cmd_' + (options.command or '')](config, options)
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/bundlebuilder.py", line 527, in cmd_install
    options.install_desktop_file)
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/bundlebuilder.py", line 319, in install
    os.makedirs(path)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/share/sugar/activities/MathHurdler.activity'

There's a proposed fix for this in Python but if merged, it'll be included in Python 3.10.

@aperezbios this might stall the update of viewslides downstream, I haven't noticed this with any other package at the moment.

Opening this so I'll not forget to take a look at this later.

quozl commented 3 years ago

Until Python is fixed, your choices include;

chimosky commented 3 years ago

I think using the shell to make the directories seems viable in the short term and might be the best thing to do at the moment.

I was also thinking of momentarily moving the installations to ~/Activities, what do you think?

chimosky commented 3 years ago

Temporary fix exists at sugarlabs/sugar-toolkit-gtk3@9605f81.

chimosky commented 3 years ago

After investigating I'd figured out what was causing the problem in fedora so I've reverted sugarlabs/sugar-toolkit-gtk3@9605f81. Closing this.

quozl commented 3 years ago

Oh wow, yes, I see why now. I guess I should have looked at the Fedora repository before, given this was a problem with Fedora only.

chimosky commented 3 years ago

Oh wow, yes, I see why now. I guess I should have looked at the Fedora repository before, given this was a problem with Fedora only.

And it was a bit subtle, some files that let you run sugar applications outside sugar weren't deleted and they usually are as they break the build and they were being referenced in the buildroot path so I'd changed the path to just the prefix /usr and that was what caused the permission error.

quozl commented 3 years ago

Well done.

chimosky commented 3 years ago

Well done.

Thanks.