Skip to content

Windows: running GenROSIDL.sh results in code folder from other (non-TempoROS) game plugins being removed #50

@Panics

Description

@Panics

My project folder has a custom game plugin that integrates paho mqtt.
This custom game plugin has a module named 'mqtt' that exposes the following public files:

Public/mqtt/async_client.h
Public/mqtt/buffer_ref.h
Public/mqtt/buffer_view.h
Public/mqtt/callback.h
Public/mqtt/client.h
Public/mqtt/connect_options.h
Public/mqtt/create_options.h
Public/mqtt/delivery_token.h
Public/mqtt/disconnect_options.h
Public/mqtt/exception.h
Public/mqtt/export.h
Public/mqtt/iaction_listener.h
Public/mqtt/iasync_client.h
Public/mqtt/iclient_persistence.h
Public/mqtt/message.h
Public/mqtt/platform.h
Public/mqtt/properties.h
Public/mqtt/response_options.h
Public/mqtt/server_response.h
Public/mqtt/ssl_options.h
Public/mqtt/string_collection.h
Public/mqtt/subscribe_options.h
Public/mqtt/thread_queue.h
Public/mqtt/token.h
Public/mqtt/topic.h
Public/mqtt/topic_matcher.h
Public/mqtt/types.h
Public/mqtt/will_options.h

When GenROSIDL.sh runs, the parent folder Public/mqtt gets falsely marked for deletion in the function GEN_MODULE_MSG_AND_SRVS() at line 228

 # Remove any generated files that were not refreshed this time.
  if [ -d "$PUBLIC_DEST_DIR/$PACKAGE_NAME" ]; then
    for FILE in $(find "$PUBLIC_DEST_DIR/$PACKAGE_NAME" -type f); do
      if [[ ! $REFRESHED_FILES =~ $FILE ]]; then
        rm "$FILE"
      fi
    done
  fi

Needless to say, this should not happen.

This is because the folder name mqtt equals the package name mqtt, which satisfies if [ -d "$PUBLIC_DEST_DIR/$PACKAGE_NAME" ]; then. A quick workaround is to rename Public/mqtt to Public/paho-mqtt to avoid this. A proper fix would be to update the GenROSIDL.sh code to not be too agressive when determining which files/folders to delete

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions