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

Skip root user check on Haiku OS #4513

Merged
merged 2 commits into from
Dec 17, 2023
Merged

Conversation

cmeerw
Copy link
Contributor

@cmeerw cmeerw commented Dec 16, 2023

Haiku OS doesn't have any non-root users, so it doesn't make sense to warn about running as the root user.

@@ -266,7 +266,7 @@ function main.entry()
end

-- check run command as root
if not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' then
if not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' and os.host() ~= 'haiku' then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

@waruqi
Copy link
Member

waruqi commented Dec 16, 2023

Haiku OS doesn't have any non-root users, so it doesn't make sense to warn about running as the root user.

so you should improve os.isroot() to support for haiku.

@SirLynix
Copy link
Member

What if some code errors if os.isroot() returns false on haiku later? for example if we check root privileges before installing to /usr

@cmeerw
Copy link
Contributor Author

cmeerw commented Dec 16, 2023

Haiku OS doesn't have any non-root users, so it doesn't make sense to warn about running as the root user.

so you should improve os.isroot() to support for haiku.

I am not convinced that changing isroot is preferable.

Currently, code checks os.isroot() to ask the question "Do I have the privileges to make system-wide changes?" (in several install_package.lua) On Haiku OS the answer to that question should be "yes", so I'd think os.isroot() should return true on Haiku OS. On the other hand, there is no non-root user on Haiku OS, so warning about running as root doesn't seem helpful.

I am just worried, that trying to return false for os.isroot() on Haiku OS will actually cause more maintenance issues in the future as basically all those os.isroot() calls will need special handling on Haiku OS.

@waruqi
Copy link
Member

waruqi commented Dec 17, 2023

well.

@waruqi waruqi merged commit bf905b6 into xmake-io:dev Dec 17, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants