简体   繁体   中英

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:

    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:

    -- 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.

The filesystem is not ro, as can be seen in 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):

    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.

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 . I guess this can cause other problems (I used it for a reason), but for the purpose of compiling and installing, it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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