ros-industrial / ros_qtc_plugin

ROS Qt Creator Plug-in (https://ros-qtc-plugin.readthedocs.io)
396 stars 213 forks source link

reopen a workspace it redirect the source directory to /run/usr/1000/... #478

Closed daleigehhh closed 1 year ago

LIU0703 commented 1 year ago

I meet the same problem, have you solved it?

YMGogre commented 1 year ago

/run/user/1000/doc is a portal that allows apps to access files outside of their sandbox.(Flatpak is also a framework for distributing desktop applications on a variety of Linux distributions. see more...)In this page shows Portal support in Qt and KDE, but I have no idea whether there is a similar situation in Snap.

You can find similar questions in stackoverflow but most of those questions are with their own progeam rather than the software itself

I didn't actually solve this problem, maybe it's a bug in Qt Creator (I don't know). but we can download Qt via online installer and install ros_qtc_plugin manually to bypass this issue.

简单来说,/run/user/1000/doc 是一个门户(Portal),它允许应用程序访问其沙盒之外的文件。通常当我们使用了 --classic 选项来安装 Snap 应用程序时意味着该应用程序不会被安装在严格的沙盒环境中;相反,它将具有对系统的完全访问权,包括用户主目录。

您提到的情况可能是由于 Qt Creator 使用了一个文件选择对话框,该对话框通过 /run/user/1000/doc 门户来访问文件。这种情况下,即使您使用 --classic 选项安装了 qtcreator-ros 应用程序,它仍然可能会通过 /run/user/1000/doc 门户来访问文件。这是因为某些应用程序组件(例如文件选择对话框)可能仍然使用了沙盒机制。

stackoverflow 上有人通过 Snap 安装 1.77 版本的 VS Code 时也遇到了类似情况,这个 bug 在后来的 1.78 版本得到了修复;所以我推测这个问题可能需要 Qt 官方的开发人员来解决。

实际上最终我也没有解决这个问题,但是我们可以直接安装原生的 Qt 框架并手动安装 ros_qtc_plugin 以绕开这个问题。您可以参考这篇博客

christian-rauch commented 1 year ago

Please write in English so others can participate in the conversation.

In any case, I think this is an issue with the snap package or the partials and not the plugin in this repo itself. Also, this seems to be only an issue on some (unknown) configurations. If you continue to have problems with the snap package, then report it to the snap package repo with more details and steps on how to reproduce the issue.