Remote build and deployment excluded path resets. Cannot read CMakeCache.txt

已完成

I am using the remote build and deployment tools to develop for a local arm64 machine. When I attempt to build for this platform, the file download excludes the CMakeCache.txt. This then means the project doesn't build

File Transfer:

[7/12/18 7:48 AM] Download from remote (d52e82af-beef-4dd9-9c31-6cf6750e1d43)
[7/12/18 7:48 AM] Excluded path '/home/ben/CLionProjects/project/cmake-build-debug-remote/CMakeCache.txt'
[7/12/18 7:48 AM] 1 item excluded

CMake:

-- Build files have been written to: /home/remote/CLionProjects/cmake-build-debug-remote
Cannot read /home/ben/CLionProjects/project/cmake-build-debug-remote/CMakeCache.txt

[Failed to reload]

 

When I attempt to remove /home/ben/CLionProjects/project/cmake-build-debug-remote/ from the Excluded paths as soon as I run 'rebuild the project' I find it is re-added. 

Can someone please explain how I can remedy this to enable building?

 

1

Hi Ben! Do you have installed rsync on the remote host?

2

I am having the same issue. Rsync is installed on the remote. Every time I reload the project, CLion complains "Cannot read /path/to/project/CMakeCache.txt [Failed to reload]".

[Update]

I was compiling with a toolchain in a Docker container, which communicates with CLion using sshd. The aforementioned problem arose when the container was running as root. After creating and logging as a non-root user, the problem disappeared.

1

@Chenzhekl, thanks for describing the solution! Are you on Windows? Maybe the issue you've faced is related to https://youtrack.jetbrains.com/issue/CPP-14881.

0
Avatar
Permanently deleted user

I am having the same issue. Loging as a non-root user can not help, any other solution?

0

@Luoyibu, what OS is in your local client machine? What OS is in your remote host? Is your remote host a Docker container? Is rsync installed on the remote host?

0
Avatar
Permanently deleted user

@Anna Falevskaya, I have the same problem and my remote is a docker container. Is there a known good solution to this?

 

I really like remote development when it works, but it seems to be so fragile. Any minor hiccup between my host and remote gets in to a really horrible state that I can't get out of.

0

Have you tried logging as a non-root user as described here by @Chenzhekl?

0
Avatar
Permanently deleted user

@Anna, yes I have tried that in the past and just again for kicks. That does not solve any problem. Additionally, when I look in the "Deployment" at the deploy server that adding the new toolchain created I see that the cmake folder that the CMake profile is creating is in the "Excluded Paths".

0

@Nate, are you on Windows? If yes, please reproduce the problem and provide the log file (Help -> Show Log ...) in the comments to https://youtrack.jetbrains.com/issue/CPP-14881. Note that logs might contain private user's information (like file paths and names). You can attach it privately (with visibility to CLion team), the instruction is here.

>the cmake folder that the CMake profile is creating is in the "Excluded Paths"

That's intended.

0
Avatar
Permanently deleted user

@Anna It seems that this is also not working on ubuntu 14.04 while it is working perfectly fine on ubuntu 18.04. Is there some requirement about the version of sshd or rsync?

0
Avatar
Permanently deleted user

ubuntu 14.04 is remote host (docker) in this scenario

0

I am experiencing the same issue. The local machine is MacOS Mojave, the remote - Raspbian. 

 

```

usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /tmp/tmp.Ctq2GptMdG
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmp.Ctq2GptMdG/cmake-build-debug-remote
Cannot read /Users/username/project/cmake-build-debug-remote/CMakeCache.txt

[Failed to reload]

```

0

@Pawel Weber, @U Abdullaev,

since your local OS isn't Windows, CPP-14168 looks like a more relevant ticket. Please check comments and workaround section:

  • check that rsync is installed on local and remote host
  • update accordingly .ssh/known_hosts
0
Avatar
Permanently deleted user

In my case the problem was with the known_hosts. I had to remove the localhost and try again. I find this out using the beta version of new Clion which creates report with the stack trace from java. Maybe it is good idea to show that the problem is that host localhost has changed and has different signature in known_hosts file.

Best

3

Hi, I'm use mac os 10.14.5, plan to deploy to remote host, follow upside comments to do 

1. install rsync and remote host
2. remove .ssh/known_hosts on my mac
3. configure toolchains, Cmake and deployment settings. after all above get done, then upload file to remote server.

build project  success on remote host, and get CMakeCache.txt there.

but still get error "Cannot read /Users/xxx/project/cmake-build-debug/CMakeCache.txt"
deployment, mapping like below:

excluded_path: 


get error: 

can anybody help me on this error how to let it work on mac. thanks.

1

Hi @Lidzhu! Please send the idea.log file (Help | Show Log in ...) to clion-support at jetbrains.com. Note that logs might contain private user's information (like file paths and names). 

0

@Pawel Weber's recommendation fixed it for me.

 

 I used:

ssh-keygen -f "/home/remote/.ssh/known_hosts" -R "MY.IP.AD.DR"

to fix it.

0

@... solution worked out for me!!

I was missing rsync on my docker container, I installed it and everything started to work perfectly.

Just for reference I'll show my Dockerfile:

FROM ubuntu:18.04
MAINTAINER King Arthur

ARG user=student

# Install all required packages for
# Data Structures I image, C++ Compiler, valgrind, gdb, ncurses libraries
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
build-essential \
clang \
cmake \
g++ \
gcc \
gdb \
libncurses5 libncurses5-dev \
make \
sudo \
valgrind \
vim \
openssh-server \
rsync


# Expose port 22 to allow connection from CLion
EXPOSE 22

# Create a user to access through SSH from CLion, this parameter is sent with --build-arg
RUN useradd -m $user && echo "$user:$user" | chpasswd && adduser $user sudo

# Create a volume to connect a local directory to a directory in the image
VOLUME /development

# Setup starting script to start SSH server
RUN echo "clear" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "echo Welcome $user to your Docker Container!!" >> ~/.bashrc \
&& echo "echo ----------------------------------------" >> ~/.bashrc \
&& echo "echo Computer Science Rocks" >> ~/.bashrc \
&& echo "echo ----------------------------------------" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "echo" >> ~/.bashrc \
&& echo "service ssh start" >> ~/.bashrc

So when I create the Container I use the following command:

docker build --build-arg user=king -t ubuntu-development .

Wait for it to install everything... then run the container with:

docker run -p 222:22 -i -t d9aff00246d9 /bin/bash

Notice that I "redirect" port 22 from the container to port 222. Then when configuring the CLion remote host:

  • Host: localhost
  • User: king
  • Port: 222
  • Passowrd: king

I hope this helps!

0

请先登录再写评论。