Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
015bd565
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
015bd565
编写于
12月 23, 2020
作者:
N
Nikita Mikhaylov
提交者:
GitHub
12月 23, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18201 from nikitamikhaylov/clickhouse-install
Try to make clickhouse-install work on mac
上级
424df030
b1d1ea0e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
1 deletion
+20
-1
programs/install/Install.cpp
programs/install/Install.cpp
+20
-1
未找到文件。
programs/install/Install.cpp
浏览文件 @
015bd565
...
...
@@ -10,6 +10,10 @@
#include <linux/capability.h>
#endif
#if defined(OS_DARWIN)
#include <mach-o/dyld.h>
#endif
#include <Common/Exception.h>
#include <Common/ShellCommand.h>
#include <Common/formatReadable.h>
...
...
@@ -147,9 +151,24 @@ int mainEntryClickHouseInstall(int argc, char ** argv)
try
{
/// We need to copy binary to the binary directory.
/// The binary is currently run. We need to obtain its path from procfs.
/// The binary is currently run. We need to obtain its path from procfs (on Linux).
#if defined(OS_DARWIN)
uint32_t
path_length
=
0
;
_NSGetExecutablePath
(
nullptr
,
&
path_length
);
if
(
path_length
<=
1
)
Exception
(
ErrorCodes
::
FILE_DOESNT_EXIST
,
"Cannot obtain path to the binary"
);
std
::
string
path
(
path_length
,
std
::
string
::
value_type
());
auto
res
=
_NSGetExecutablePath
(
&
path
[
0
],
&
path_length
);
if
(
res
!=
0
)
Exception
(
ErrorCodes
::
FILE_DOESNT_EXIST
,
"Cannot obtain path to the binary"
);
fs
::
path
binary_self_path
(
path
);
#else
fs
::
path
binary_self_path
=
"/proc/self/exe"
;
#endif
if
(
!
fs
::
exists
(
binary_self_path
))
throw
Exception
(
ErrorCodes
::
FILE_DOESNT_EXIST
,
"Cannot obtain path to the binary from {}, file doesn't exist"
,
binary_self_path
.
string
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录