ros-industrial / ros_qtc_plugin

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

wrong path when open a ros workspace #470

Closed jage92 closed 1 year ago

jage92 commented 1 year ago

When I am going to open a workspace with qt installed with snap repository I select the correct .workspace file, but the qt paths are worng, like: /run/user/1000/gnupg/S.gpg-agent:0:1

Screenshot from 2022-11-07 13-16-21

How can I solve this problem?

Thank you Best

christian-rauch commented 1 year ago

I don't see the problem. The path in your screenshot looks fine. My projects also open their cpp files etc. in the correct path.

jage92 commented 1 year ago

Sorry I have explained very bad.

When I want to select a path in the dialog as this capture: Screenshot from 2022-11-07 13-16-21

The result that I obtain is the one shown in this capture: Screenshot from 2022-11-08 09-32-49

I hope this help.

Thank you Best

christian-rauch commented 1 year ago

Not sure what you are trying to do, but the Workspace Path is supposed to be the path to the directory that contains your catkin/colcon workspace. That should be something like /home/jage/jage_ws/. This would then create a new *.workspace file in that catkin/colcon workspace folder.

If you want to open an already existing *.workspace file, you have to open it via File -> Open File or Project....

jage92 commented 1 year ago

I think that de problem is with snap installation. I forgot to mention. Sorry, I am explaining it very bad...

I just do that you say, I open the *.workspace file with File -> Open File or Project and when I click Open button the result is the wrong route.

Maybe the problem could be in the snap sandbox. I installed QtCreator with the --classic flag

christian-rauch commented 1 year ago

I cannot reproduce this with the snap. When I open the *.workspace file, it opens the project in a Qt Creator window. There is no sandbox since the snap has to be installed with --classic. You cannot install it without --classic.

Do you see this issue with other snaps too? Maybe this is a snap problem and not specific to Qt Creator.

jage92 commented 1 year ago

I have tested other snaps and I have not this problem. Concretely, I test with pycharm-community, installed with --classic flag, and it works fine. I am using Ubuntu 20.04. If you need more information, tell me and I try to help you. If you know another snap software to test, I can install it.

christian-rauch commented 1 year ago

Regardless of the path being reformated to point inside the $XDG_RUNTIME_DIR folder, does the project open? The paths might be symlinked, but the project might open and compile correctly regardless.

Otherwise, I don't have an idea right now what might cause this. Maybe you can check https://forum.snapcraft.io and ask your question there if someone has an idea what may cause this.

jage92 commented 1 year ago

The project opens, but some environment variables have other path (the wrong path) and QtCreator can not compile.

That is the exit:

15:11:11: Running steps for project jage_ws...
15:11:11: Starting: "/opt/ros/noetic/bin/catkin_make" 
Base path: /run/user/1000/doc/2e720931
The specified source space "/run/user/1000/doc/2e720931/src" does not exist
15:11:11: The process "/opt/ros/noetic/bin/catkin_make" exited with code 1.
Error while building/deploying project jage_ws (kit: Desktop)
When executing step "CatkinMake Step"
15:11:11: Elapsed time: 00:00.
jage92 commented 1 year ago

In the forum that you recommend me, there are similar questions: https://forum.snapcraft.io/search?q=wrong%20path. Is the first yours? The questioner is also named Christian

christian-rauch commented 1 year ago

Yes, that's me. I remember now that I had the same issue (https://forum.snapcraft.io/t/opening-directory-in-classic-snap-gives-wrong-path/28291) before. I cannot remember how I fixed this issue, but I was not facing this again.

I don't know what I can do about it. I think it's an issue with snap in general as it should not use the portals in a classic non-confined environment. Other than checking and asking in this snapcraft forum, I don't know how to fix this.

I am running the snap successfully on Ubuntu 20.04 and 22.04. What distribution are you using? Can you check if something with your "portals" does not work correctly?

jage92 commented 1 year ago

The uname -a exit is:

Linux 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I do not know what you refer with "check if something with your "portals" does not work correctly" can you give more information about it?

christian-rauch commented 1 year ago

I do not know what you refer with "check if something with your "portals" does not work correctly" can you give more information about it?

The thread in the snapcraft forum mentioned GTK_USE_PORTAL. Other than this, I don't know how to approach the problem.

I am going to close this issue as it is not directly related to the plugin, but rather an issue with snap in general or the snap package specifically. It's also not easily reproducible. There are nearly 1500 downloads for this snap and I would have expected more issue reports like this if it would be a consistent problem.

I would first try to check for solutions in the snapcraft forum. If there is no solution, then open an issue in the snap repo at https://github.com/ros-industrial-snap/ros_qtc_plugin_snap to see if others are also affected by this.

jage92 commented 1 year ago

I did this https://forum.snapcraft.io/t/desktop-portal-testing-notes-for-app-developers/5711 test and portal-test work fine. Then I opened qt-creator-ros with GTK_USE_PORTAL variable equals to 1 and to 0 and the problem persists in both cases.

It is very strange that I only have the problem...

Levi-Armstrong commented 1 year ago

@christian-rauch I have had this issue since I setup my new machine a few months ago. Every time I browse for a file using Qt Creator the path is all messed up. Since this is a rare thing I just copy the path from my system and paste into the box instead of using Qt Creator.