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

Does not support Qt Creator Device functionality #497

Open
Levi-Armstrong opened this issue Apr 5, 2024 · 13 comments
Open

Does not support Qt Creator Device functionality #497

Levi-Armstrong opened this issue Apr 5, 2024 · 13 comments

Comments

@Levi-Armstrong
Copy link
Member

Qt Creator provides different devices to allow you to build code like on remote device, docker device, etc., but there a few things with this plugin which prevent it from being used with these types of devices. Any where in the plugin where we create a process for calling source to get environment variables, etc. need to be updated to use the device object for running these so they are compatible with Qt Creator device functionality.

@Levi-Armstrong
Copy link
Member Author

@christianrauch what is the best way for me to build and test changes to the plugin on Ubuntu?

@Levi-Armstrong
Copy link
Member Author

Levi-Armstrong commented Apr 5, 2024

Another option is to just move away from using our build,run and clean steps and just use the Qt Creator built in Custom Process Step, which is what I am currently using to work around this along with the clangd plugin for code completion.

@christian-rauch
Copy link
Member

@christianrauch what is the best way for me to build and test changes to the plugin on Ubuntu?

I updated the README in #498 with information on how to run Qt Creator with the plugin in Debug mode from the command line (section Build (Source)). You should just need to copy & paste the commands there. Take note of the Debug if you want to debug crashes etc.

Please have a look at the PR and let me know if this helps or if you need me to add more information.

@Levi-Armstrong
Copy link
Member Author

Thank you, I will go through the process and let you know how it goes.

@collinthornton
Copy link

@Levi-Armstrong What's the process you're using to run a custom process in the docker environment? I put a bit of effort into running a Custom Process Stepwith /usr/lib/catkin build -cs in a docker container, but didn't get very far.

@Levi-Armstrong
Copy link
Member Author

image

image

Also had to clear out addition environment variables because those are generated running a command on the host machine.

@collinthornton
Copy link

Thanks. What have you changed for the kit and/or device settings?

@Levi-Armstrong
Copy link
Member Author

  • Create docker device pointing to the image to use.
    • Provide necessary extra arguments for mounting workspace
  • Click -> Remove Auto-Detected Kit Items
  • Click -> Auto-detect Kit Items (This will create the kit you will use when building your workspace)

@Levi-Armstrong
Copy link
Member Author

@christian-rauch What are your thoughts on removing our custom steps and just have the this populate the build and run with the necessary custom process steps? This may be better long term.

@christian-rauch
Copy link
Member

At the moment we have a "Colcon Step" etc. that can be further extended with colcon or CMake arguments. Are you suggesting that we remove that and automatically create a custom step with a predefined command and arguments? How would we set the environment in this case? This would reduce the maintenance costs for updating the plugin API but it would prevent us from parsing the colcon output for progress.

@marip8
Copy link
Member

marip8 commented Jun 18, 2024

I'm also trying to build a project within a docker image with this plugin and am running into some issues. My docker device and corresponding kit seems to be set up correctly as far as I can tell.

First it seems like the provided Colcon Step for building (possibly) invokes my local instance of colcon and sets a lot of environment variables from my host computer rather than the docker image (e.g., PATH, AMENT_PREFIX_PATH, etc.). This makes my build fail because my host computer is on foxy and the docker image is on humble.

I tried using the custom process step to "manually" invoke colcon, but the build fails because it seems to be running this custom process on my local machine rather than the docker device. The build log shows that it doesn't think /opt/ros/humble is a real directory (it exists in the docker image, but not on my host machine) and that the failure happens because it can't find ROS2 packages. The build command and environment variables seem to correspond to the docker image, but it doesn't seem to run the custom process step within the docker image. Any ideas on how to fix or get around this?

Screenshot_2024-06-18_13-55-54

13:49:55: Starting: "/usr/bin/colcon" build --symlink-install
[0.462s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/opt/ros/humble' in the environment variable AMENT_PREFIX_PATH doesn't exist
Starting >>> cartesian_controller_base
Starting >>> cartesian_controller_utilities
--- stderr: cartesian_controller_base
CMake Error at CMakeLists.txt:30 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake" with
  any of the following names:

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

  Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" to a directory containing one of the above files.  If
  "ament_cmake" provides a separate development package or SDK, be sure it
  has been installed.


---
Failed   <<< cartesian_controller_base [0.05s, exited with code 1]
Aborted  <<< cartesian_controller_utilities [0.34s]

Summary: 0 packages finished [0.65s]
  1 package failed: cartesian_controller_base
  1 package aborted: cartesian_controller_utilities
  2 packages had stderr output: cartesian_controller_base cartesian_controller_utilities
  7 packages not processed
13:49:56: The process "/usr/bin/colcon" exited with code 1.

@Levi-Armstrong
Copy link
Member Author

There are several things under the hood that run a process to get things like environment and other things which need to be updated to make the call through the device to fix the issue.

@Levi-Armstrong
Copy link
Member Author

I think everything in the ros_utils.h/cpp take a QProcess and these need to be updated to leverage the active device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants