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

Update library_builder.py #105

Closed
wants to merge 1 commit into from
Closed

Update library_builder.py #105

wants to merge 1 commit into from

Conversation

G-Yong
Copy link

@G-Yong G-Yong commented Jun 13, 2023

In the end of function ‘download_mcu_environment’, line139,download_extra_packages once。 but in line 75, download_extra_packages again。
which will cause error [fatal: destination path '/home/xxx/Desktop/arduino/hello_microros/.pio/libdeps/featheresp32/micro_ros_platformio/build/mcu/src/control_msgs' already exists and is not an empty directory.]

In the end of function ‘download_mcu_environment’, line139,download_extra_packages once。
but in line 75, download_extra_packages again。
which will cause error [fatal: destination path '/home/xxx/Desktop/arduino/hello_microros/.pio/libdeps/featheresp32/micro_ros_platformio/build/mcu/src/control_msgs' already exists and is not an empty directory.]
@G-Yong
Copy link
Author

G-Yong commented Jun 13, 2023

Sorry,it is line 65 and line 123 in this repository. I mixed up this repository with another one.
But the mistake and the way to correct it are the same.

@pablogs9
Copy link
Member

We are not removing this line. If the problem is related to an existing folder, please add the correct checks to avoid the error.

@G-Yong
Copy link
Author

G-Yong commented Jun 13, 2023

The "already exists" error occurs when you use extra_packages.repos to add another library(s). This will definitely occur because of [library_builder.py L137], which contains the following code:

        Repository(repo_name, repo_values['url'], self.distro, version).clone(self.mcu_src_folder)

The clone method simply executes a git [repositories.py L27]

      def clone(self, folder):
        self.path = folder + "/" + self.name
        # TODO(pablogs) ensure that git is installed
        command = "git clone -b {} {} {}".format(self.branch, self.url, self.path)
        result = run_cmd(command)

        if 0 != result.returncode:
            print("{} clone failed: \n{}".format(self.name, result.stderr.decode("utf-8")))
            sys.exit(1)

When the first clone operation is executed, the path will be created. However, if a second clone operation is attempted, the error will occur. Therefore, removing this line may be the simplest solution.

@Acuadros95
Copy link
Contributor

@G-Yong Could you detail the steps to replicate your error?

We cannot remove that line, as it would completely remove the extra packages functionality.

@Acuadros95 Acuadros95 self-assigned this Jun 13, 2023
@G-Yong
Copy link
Author

G-Yong commented Jun 14, 2023

@Acuadros95 Sure. The following are the steps to reproduce the error.
Background:

 Git repositories included on the <Project_directory>/extra_packages/extra_packages.repos yaml file.

Steps to reproduce:

  1. Create a new folder named "extra_packages" in the directory where your platformio.ini file is located. Inside the extra_packages folder, create a new file named "extra_packages.repos".
    图片
    The content of the "extra_packages.repos" file is as follows:
 repositories:
  control_msgs:
    type: git
    url: https://github.com/ros-controls/control_msgs
    version: humble
  object_recognition_msgs:
    type: git
    url: https://github.com/wg-perception/object_recognition_msgs
    version: ros2
  octomap_msgs:
    type: git
    url: https://github.com/OctoMap/octomap_msgs
    version: ros2
  moveit_msgs:
    type: git
    url: https://github.com/ros-planning/moveit_msgs
    version: humble

图片

  1. My platformio.ini file is as follows:
[env:featheresp32]
platform = espressif32
board = featheresp32
framework = arduino
board_build.f_cpu = 240000000L
monitor_speed = 115200
lib_deps = 
    https://github.com/micro-ROS/micro_ros_platformio.git

图片

  1. After saving the platformio.ini file, vscode automatically compiled micro_ros. To eliminate any unnecessary misunderstandings, I performed a full clean.
    图片

  2. Then I compiled it and got the following output:

Processing featheresp32 (platform: espressif32; board: featheresp32; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/featheresp32.html
PLATFORM: Espressif 32 (6.3.1) > Adafruit ESP32 Feather
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20009.0 (2.0.9) 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/yong/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/yong/.platformio/penv/lib/python3.10/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/yong/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/yong/.platformio/penv/lib/python3.10/site-packages (2.0.1)
Configuring featheresp32 with transport serial
Downloading micro-ROS dev dependencies
         - Downloaded ament_cmake
         - Downloaded ament_lint
         - Downloaded ament_package
         - Downloaded googletest
         - Downloaded ament_cmake_ros
         - Downloaded ament_index
Building micro-ROS dev dependencies
Downloading micro-ROS library
         - Downloaded microcdr
         - Downloaded microxrcedds_client
         - Downloaded rcl_yaml_param_parser (ignored)
         - Downloaded rcl
         - Downloaded rcl_lifecycle
         - Downloaded rcl_action
         - Downloaded rclc_parameter
         - Downloaded rclc
         - Downloaded rclc_examples (ignored)
         - Downloaded rclc_lifecycle
         - Downloaded micro_ros_utilities
         - Downloaded rcutils
         - Downloaded micro_ros_msgs
         - Downloaded rmw_microxrcedds
         - Downloaded rosidl_typesupport_c
         - Downloaded rosidl_typesupport_cpp (ignored)
         - Downloaded rosidl_typesupport_microxrcedds_c_tests
         - Downloaded rosidl_typesupport_microxrcedds_cpp_tests
         - Downloaded rosidl_typesupport_microxrcedds_test_msg
         - Downloaded rosidl_typesupport_microxrcedds_cpp (ignored)
         - Downloaded rosidl_typesupport_microxrcedds_c
         - Downloaded rosidl_parser
         - Downloaded rosidl_typesupport_introspection_tests
         - Downloaded rosidl_runtime_cpp (ignored)
         - Downloaded rosidl_typesupport_introspection_cpp (ignored)
         - Downloaded rosidl_adapter
         - Downloaded rosidl_typesupport_interface
         - Downloaded rosidl_runtime_c
         - Downloaded rosidl_generator_cpp (ignored)
         - Downloaded rosidl_generator_c
         - Downloaded rosidl_cli
         - Downloaded rosidl_typesupport_introspection_c
         - Downloaded rosidl_cmake
         - Downloaded rmw_implementation_cmake
         - Downloaded rmw
         - Downloaded action_msgs
         - Downloaded rcl_interfaces
         - Downloaded rosgraph_msgs
         - Downloaded builtin_interfaces
         - Downloaded lifecycle_msgs
         - Downloaded statistics_msgs
         - Downloaded composition_interfaces
         - Downloaded test_msgs
         - Downloaded rosidl_default_runtime
         - Downloaded rosidl_default_generators
         - Downloaded unique_identifier_msgs
         - Downloaded std_srvs
         - Downloaded common_interfaces
         - Downloaded diagnostic_msgs
         - Downloaded sensor_msgs
         - Downloaded stereo_msgs
         - Downloaded geometry_msgs
         - Downloaded sensor_msgs_py
         - Downloaded trajectory_msgs
         - Downloaded nav_msgs
         - Downloaded actionlib_msgs
         - Downloaded shape_msgs
         - Downloaded std_msgs
         - Downloaded visualization_msgs
         - Downloaded test_interface_files
         - Downloaded test_rmw_implementation
         - Downloaded rmw_implementation
         - Downloaded rcl_logging_noop
         - Downloaded rcl_logging_interface
         - Downloaded rcl_logging_spdlog (ignored)
         - Downloaded test_tracetools_launch
         - Downloaded tracetools_read
         - Downloaded tracetools_test
         - Downloaded tracetools_trace
         - Downloaded tracetools_launch
         - Downloaded ros2trace
         - Downloaded tracetools
         - Downloaded test_tracetools
         - Downloaded example_interfaces
Checking extra packages
         - Downloaded control_msgs
         - Downloaded object_recognition_msgs
         - Downloaded octomap_msgs
         - Downloaded moveit_msgs
         - Adding extra_packages--.repos
Checking extra packages
control_msgs clone failed: 
fatal: destination path '/home/yong/Desktop/arduino/hello_microros/.pio/libdeps/featheresp32/micro_ros_platformio/build/mcu/src/control_msgs' already exists and is not an empty directory.

===================================================== [FAILED] Took 200.63 seconds =====================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

As you can see, library_builder.py executed two git commands at the end.

@G-Yong
Copy link
Author

G-Yong commented Jun 14, 2023

Sorry, I made a mistake with another repository. This repository did not have this error.

@G-Yong G-Yong closed this Jun 14, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants