Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projects in a windows mount in WSL cannot be built due to a permissions error on the latest version of theos #421

Open
Muirey03 opened this issue Jun 16, 2019 · 3 comments

Comments

@Muirey03
Copy link

What are the steps to reproduce this issue?

  1. Create a new tweak (or any theos project that uses dm.pl) anywhere in /mnt/c (or any windows mount)
  2. Try to compile using make package

What happens?

You will receive the error message:

ERROR: control directory has bad permissions 777 (must be >=0755 and <=0775)

What were you expecting to happen?

It should compile correctly

Any logs, error output, etc?

N/A

Any other comments?

We believe this issue was caused by this commit. The issue is that all files in /mnt/c and similar windows mounts always have the permissions 777 and chmod does nothing on them. The reason this is a problem is because files need to be in a windows mount if you want to edit them with a windows tool such as VSCode or Atom. This means that WSL users can't edit their tweaks with any windows tools anymore on the latest version of theos, and are forced to use CLI tools such as vim or nano, which is less than ideal. This makes the barebones compiler practically unusable for WSL users.

What versions of software are you using?

Operating System: Windows (WSL)

Toolchain Version: N/A

SDK Version: N/A

@Muirey03
Copy link
Author

Muirey03 commented Jun 16, 2019

@kirb Update: adding

[automount]
options="metadata"

to /etc/wsl.conf ("options" must be lowercase) allows files in windows mounts such as /mnt/c to have proper permissions (rather than always being stuck on 777). This mostly fixes the issue. A few other things that would be nice to have is setting umask to 0002 and automatically chmoding files such as control that are strict about permissions. I'll let you decide what theos can automate, what messages could be sent to the user suggesting fixes, etc. Hopefully this shouldn't be too difficult to fully resolve then. Thank you for the time you are putting into this.

@Muirey03
Copy link
Author

Muirey03 commented Jun 16, 2019

DGh0st: "I don't think that can be automated much by theos, other than going back to what it was doing of copying files to /tmp which would have correct permissions and then compiling that source."

Maybe add these fixes to the install script, or even just to the installation docs. I think just telling WSL users to add those options to wsl.conf, setting umask, etc, in the installation docs might be enough. I personally don't see why copying files to /tmp was such a bad thing, but I'm sure you had your reasons.

@FreddieDev
Copy link

FreddieDev commented Jul 22, 2019

Can confirm, that is the commit that causes the compile issues.

Easier fix for anyone reading and stuck with WSL is to rollback Theos:
git checkout 373134ea5a59413e62e2646f93b4813ed31f6460

UPDATE (26/01/2020):
You no longer need to rollback for WSL. Make sure you chmod all directories after /mnt/<drive letter> that are above where you're compiling your tweak from and follow the automount and umask advice above!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants