Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Somehow interferes with CMake project loading. #39

Closed
peci1 opened this issue Apr 6, 2020 · 14 comments · Fixed by #41
Closed

Somehow interferes with CMake project loading. #39

peci1 opened this issue Apr 6, 2020 · 14 comments · Fixed by #41
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@peci1
Copy link
Contributor

peci1 commented Apr 6, 2020

Describe the bug
After CLion is started and loading a previous project, all project files are reported as not belonging to the project.

To Reproduce

  1. Have a CMake C++ project, set up the ROS plugin for it.
  2. Exit CLion
  3. Start clion
  4. load the previous project

Expected behavior
The project files should be recognized as project files. Sometimes, the non-recognized project files get a weird yellowis-brownish background in the project view, sometimes they have normal background. When I press the "reload cmake project" button, project files are recognized correctly.

Environment Information:

  • OS: Ubuntu 18.04
  • IDE: CLion 2020.1 beta (but has been happening all the time)
  • Plugin Version: 0.1.5 (but has been happening all the time)
  • Related Plugins: hatchery

Additional context
Add any other context about the problem here.

@peci1 peci1 added the bug Something isn't working label Apr 6, 2020
@Noam-Dori Noam-Dori added this to the 0.1.6 milestone Apr 6, 2020
@Noam-Dori Noam-Dori added this to To do in Core via automation Apr 6, 2020
@Noam-Dori
Copy link
Owner

Could you send a screenshot of the bugged project view? Also, what are your ROS settings? more specifically, the three "Environment" paths (ROS Path, Workspace, Additional Package Paths)?

@peci1
Copy link
Contributor Author

peci1 commented Apr 6, 2020

Snímek obrazovky pořízený 2020-04-06 19-31-50
I've also opened the CMake window so that you can see what happened during the project load. Nothing interesting seems to be there.

ROS Path: /opt/ros/melodic
Workspace: /media/data/subt/thirdparty/ws
Additional package path: empty

Here's CLion console output: clion.txt. I see there's a lot of hatchery-related bugs, but I thought this plugin is aware of hatchery and tries to cooperate...

@Noam-Dori
Copy link
Owner

Are you talking about the warning war above the file that says
"This file does not belong to any project target, code insight features might not work properly?"

@peci1
Copy link
Contributor Author

peci1 commented Apr 6, 2020

Yes, this warning. CLion is then unable to suggest project-related inspections and only suggests syntax-based things.

@Noam-Dori
Copy link
Owner

This is actually an extension of a CLion bug:
https://youtrack.jetbrains.com/issue/CPP-10204
The root of the issue is that CLion uses the CMake load action to index information used for most of its code insight features, and thus requires loading the CMake project every time you open CLion. I think this can be solved by turning on auto-reload in Build, Execution, Deployment > CMake but I am not too sure.

@Noam-Dori Noam-Dori removed this from To do in Core Apr 6, 2020
@Noam-Dori Noam-Dori removed this from the 0.1.6 milestone Apr 6, 2020
@peci1
Copy link
Contributor Author

peci1 commented Apr 6, 2020

I tested the plugin with Hatchery disabled. The bug is still there. I reloaded the project, quit clion, started it again, and project files are not recognized.

When I disable ROS integrate and enable Hatchery, the bug is not there.

Auto-reloading CMake project is not an option for me, that would eat up my CPU...

@peci1
Copy link
Contributor Author

peci1 commented Apr 6, 2020

Are you able to replicate this issue?

@Noam-Dori Noam-Dori added this to To do in Core via automation Apr 6, 2020
@Noam-Dori Noam-Dori added this to the 0.1.6 milestone Apr 6, 2020
@Noam-Dori
Copy link
Owner

I stand corrected. Will get to working on a fix.

@peci1
Copy link
Contributor Author

peci1 commented Apr 6, 2020

Thanks!

@Noam-Dori Noam-Dori moved this from To do to In progress in Core Apr 11, 2020
Noam-Dori added a commit that referenced this issue Apr 25, 2020
This fix solves issues where data saved on the module is removed like (#39).

Signed-off-by: Noam Dori <TheNODO55@gmail.com>
@Noam-Dori
Copy link
Owner

The issue seems to be fixed, and is available on a separate branch for now. However:

  1. this was tested in a WSL, not directly on Ubuntu.
  2. In order for the fix to work for all IntelliJ-based IDEs, I created a new module type. This might interfere with the functionality of the original modules of the IDEs in ways I am not aware of, so any tests on actual workspaces in CLion, IntelliJ IDEA, and PyCharm would be greatly appreciated.
    It is for these reasons that I posted this fix in a seperate branch, f-stable-model (see non-interfering module model #41) and added a specific pull request to see if any more problems are raised.

Core automation moved this from In progress to Done Apr 25, 2020
@Noam-Dori Noam-Dori reopened this Apr 25, 2020
@Noam-Dori Noam-Dori linked a pull request Apr 25, 2020 that will close this issue
@peci1
Copy link
Contributor Author

peci1 commented Apr 25, 2020

Great. How can I test it?

@Noam-Dori Noam-Dori moved this from Done to In progress in Core Apr 25, 2020
@Noam-Dori
Copy link
Owner

Noam-Dori commented Apr 25, 2020

First clone this repository from branch f-stable-model.
then open the commandline of your system and change directory to the root of this repository (ros-integrate)
If you are on windows, run gradlew buildPlugin
If you are on linux, run ./gradlew buildPlugin
this should create a new library in build/distributions named ros-integrate-0.1.6.zip
Next, open your IDE and go to the "plugins" tab in the IDE/project settings.
in the top you should see a gear icon next to the Marketplace and Installed tab names.
Click on that gear and select the "install plugin from disk" option.
in the menu that opens select the ros-integrate-0.1.6.zip library you just created.
This should enable the new development version of the plugin.
If you cannot find the .zip library, there is another library in build/libs named ros-intrgrate-0.1.6.jar that could work as well.

@peci1
Copy link
Contributor Author

peci1 commented Apr 25, 2020

Gradlew doesn't work for me because this repo is missing gradle/wrapper/gradle-wrapper.jar file. I tried with system gradle, but:

> Task :compileJava 
/tmp/ros-integrate/src/main/java/ros/integrate/pkg/ROSWorkspacePackageFinder.java:33: error: reference to Module is ambiguous
     private Module loadedModule = null;

Could you maybe provide the built zip instead?

@Noam-Dori
Copy link
Owner

the built zip is available here:
https://github.com/Noam-Dori/ros-integrate/releases/tag/v0.1.6b1
I also updated the branch with the gradle wrappers if you still wish to compile from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Core
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants