-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
xmake root 权限安装问题 #111
Comments
See #61 |
我需要使用 root 运行 xmake |
#61 described why running xmake as root is deprecated xmake can run as root. See -- check run command as root
if not option.get("root") then
local ok, errors = main._check_root()
if not ok then
utils.error(errors)
return -1
end
end That is, when option But, the option After I do this modify, xmake accepts diff --git a/xmake/core/project/task.lua b/xmake/core/project/task.lua
index 35c051ef..7bc08d6c 100644
--- a/xmake/core/project/task.lua
+++ b/xmake/core/project/task.lua
@@ -145,7 +145,8 @@ function task._translate_menu(menu)
, " 1. The Given Command Argument"
, " 2. The Envirnoment Variable: XMAKE_PROJECT_DIR"
, " 3. The Current Directory" })
- table.insert(options, 10, {})
+ table.insert(options, 10, {nil,"root","k",nil,"awd"})
+ table.insert(options, 11, {})
end
But, there are some problems. After I try running xmake as root, That is, I found in // redirect stdout?
if (outfile)
{
// redirect stdout to file
attr.outfile = outfile;
attr.outmode = TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_APPEND;
// remove the outfile first
if (tb_file_info(outfile, tb_null))
tb_file_remove(outfile);
}
// redirect stderr?
if (errfile)
{
// redirect stderr to file
attr.errfile = errfile;
attr.errmode = TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_APPEND;
// remove the errfile first
if (tb_file_info(errfile, tb_null))
tb_file_remove(errfile);
} If the file exists, this function removes it and recreate. As root, the new |
@745275633 我修改了下xmake,master上新版本支持临时允许root运行,通过命令: |
I have modified it as common option.
I have fixed it. |
@745275633 see #113. |
xmake 有没有办法强制在 root 权限下运行?
The text was updated successfully, but these errors were encountered: