简体   繁体   English

CMake:无法在 ssh 挂载的文件系统上安装符号链接

[英]CMake: Fail to install symlink on ssh-mounted filesystem

I am cross-compiling a project on my desktop, and installing it on a device which is mounted via ssh, using sshfs, like so:我正在我的桌面上交叉编译一个项目,并将其安装在通过 ssh 安装的设备上,使用 sshfs,如下所示:

    sudo sshfs -o allow_other -o follow_symlinks user@192.168.12.100:/ /mnt/remote

The build is successful, but when I try to "sudo make install", I receive the following message:构建成功,但是当我尝试“sudo make install”时,我收到以下消息:

    -- Installing: /mnt/remote/usr/lib/libprop.so.5.1.5
    -- Installing: /mnt/remote/usr/lib/libprop.so.5
    CMake Error: failed to create symbolic link '/mnt/remote/usr/lib/libprop.so.5': i/o error
    CMake Error at cmake_install.cmake:176 (file):file INSTALL cannot duplicate symlink
      "/home/ubuntu/libprop/build/lib/libprop.so.5" at
      "/mnt/remote/usr/lib/libprop.so.5".

The library and the symlink are copied and created.库和符号链接被复制和创建。 That is, it seems that the installation actually succeeds, but CMake thinks otherwise.也就是看起来安装实际上成功了,但是CMake不这么认为。

The filesystem is not ro, as can be seen in mount output:文件系统不是 ro,如mount output 所示:

    user@192.168.12.100:/ on /mnt/remote type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

And I can see the entry under /mnt/ (I chown'd and chmod'd it for user access, thinking it might solve the problem):我可以看到 /mnt/ 下的条目(我 chown'd 和 chmod'd 以供用户访问,认为它可能会解决问题):

    drwxrwxr-x 1 ubuntu ubuntu 4096 Mar 11 13:43 remote

and I can access it event without root permissions, copying and deleting files without a problem.我可以在没有root权限的情况下访问它,复制和删除文件没有问题。

This process has been working for me.这个过程一直对我有用。 I have no idea what was changed that it stopped.我不知道它停止了什么变化。 Could be something in my environment or maybe in the destination platform.可能是我的环境中的某些东西,也可能是目标平台中的某些东西。

I would be grateful for any assistance.如有任何帮助,我将不胜感激。

OK, I have found the problem... I shouldn't be using -o follow_symlinks .好的,我发现了问题......我不应该使用-o follow_symlinks I guess this can cause other problems (I used it for a reason), but for the purpose of compiling and installing, it works.我想这可能会导致其他问题(我使用它是有原因的),但是出于编译和安装的目的,它可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM