Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

bug: PermissionError when shell themeing on 0.8.0-beta1 nixos #799

Open
2 tasks done
Givlucas opened this issue Jul 5, 2023 · 5 comments · May be fixed by #808
Open
2 tasks done

bug: PermissionError when shell themeing on 0.8.0-beta1 nixos #799

Givlucas opened this issue Jul 5, 2023 · 5 comments · May be fixed by #808
Labels
type/bug Something isn't working
Milestone

Comments

@Givlucas
Copy link

Givlucas commented Jul 5, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When attempting to theme the shell on nixos using 0.8.0-beta 1 I get the following traceback:

Traceback (most recent call last):
  File "/nix/store/a6xacb4nc96y5swab1g5lzf97b4k84ps-gradiencetest-0.8.0-beta3/lib/python3.10/site-packages/gradience/frontend/widgets/shell_theming_group.py", line 115, in on_apply_button_clicked
    ShellTheme().THEME_EXT_NAME, check_enabled=True)
  File "/nix/store/a6xacb4nc96y5swab1g5lzf97b4k84ps-gradiencetest-0.8.0-beta3/lib/python3.10/site-packages/gradience/backend/theming/shell.py", line 95, in __init__
    shutil.rmtree(self.source_dir)
  File "/nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/lib/python3.10/shutil.py", line 725, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/lib/python3.10/shutil.py", line 658, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/lib/python3.10/shutil.py", line 658, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/lib/python3.10/shutil.py", line 681, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/lib/python3.10/shutil.py", line 679, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: '_a11y.scss'

Attached is the nix file I used to build gradience. (in txt because github wouldnt let me attach the .nix

gradience.txt

To Reproduce

  1. Attempt to theme the shell on gradience 0.8.0-beta1

Expected behavior

Theme is applied

Screenshots

No response

OS

Nixos 23.05

DE/WM version

Gnome 44.2

Version

0.8.0-beta1

Installation method

Manual using meson

Enabled system extensions (GNOME specific)

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Givlucas Givlucas added the type/bug Something isn't working label Jul 5, 2023
@github-project-automation github-project-automation bot moved this to Todo in Gradience Jul 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 5, 2023

Welcome on Gradience. 🥳 We really appreciate your contribution. The core team will review your issue as soon as possible. You can also join the Matrix room: https://matrix.to/#/#Gradience-space:envs.net or the Discord server: https://discord.com/invite/4njFDtfGEZ

@0xMRTT
Copy link
Member

0xMRTT commented Jul 12, 2023

@Givlucas This is unsupported BUT could you check if there is this file in whereisyourdatadir/gradience/shell/{42,43,44}/

@Givlucas
Copy link
Author

Yes there is

@0xMRTT
Copy link
Member

0xMRTT commented Jul 16, 2023

@Givlucas here, gradience is trying to remove the cache dir for generating a new theme ((GLib.get_home_dir(), ".cache", "gradience", "gradience-shell", str(self.version_target)), normally GLib.get_home_dir() is set to ~ so could you check if you have write access to ~/.cache/gradience

@computercam
Copy link

Getting the same error using the same package as OP. The error seems to be that because nixos stores files in an immutable way (removing write permissions to files in the nix store), when the files are copied over (

shutil.copytree(os.path.join(datadir, "gradience", "shell",
), they're copied over with read only permissions.

I'm 99% certain this can't be fixed in the nixos store as the OS enforces read only permissions. I believe this will have to be fixed by utilizing the copy_function argument of the copytree method of shutil. I will try to get a PR in for this.

@computercam computercam linked a pull request Aug 16, 2023 that will close this issue
5 tasks
@tfuxu tfuxu added this to the 0.8.0 milestone Aug 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/bug Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

4 participants