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

[22704] Support compiler MSYS2-MinGW #5600

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

RookieCLY
Copy link
Contributor

@RookieCLY RookieCLY commented Jan 25, 2025

Support compilation using MinGW. Version: MSYS2-MinGW-V14.2, x86_64-w64-mingw32.

Description

  1. The ‘COMPILE_TOOLS’ compilation option is turned off when compiling with MinGW because there are still some issues that have not been resolved here, but it does not affect the use of the main body of fastdds.
  2. The import and export settings in thefastdds_dll.hpp file were changed to adapt to the symbol import and export rules of mingw. Tests found that these changes were effective.
  3. The macro definition 'MINGW_COMPILER' has been added in cmakelists.txt to control some code to move towards new branches, which are used to resolve library dependency differences between compilers.
  4. Some compile-time warnings that do not affect use have been canceled. 'ws2_32' and 'mswsock' libraries have been manually linked. The above changes are written in cmakelists.txt and will only take effect when the compiler is MinGW.
  5. Almost all changes only take effect when the compiler is MinGW. Before compiling Fast-DDS with MinGW, it was best to use MinGW to compile its dependent libraries, such as fastcdr, tinyxml2 and foonathan_memory.

@Mergifyio backport 3.1.x 3.0.x 2.14.x 2.10.x

Fixes #5575

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • Any new/modified methods have been properly documented using Doxygen.
  • Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • _N/A_New feature has been added to the versions.md file (if applicable).
  • New feature has been documented/Current behavior is correctly described in the documentation.
  • N/A Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@Javgilavi Javgilavi changed the title Support compiler MSYS2-MinGW [22704] Support compiler MSYS2-MinGW Jan 27, 2025
@Javgilavi Javgilavi self-requested a review February 4, 2025 15:02
@Javgilavi Javgilavi added this to the v3.2.0 milestone Feb 4, 2025
Copy link
Contributor

@Javgilavi Javgilavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request looks great overall!
Could you please make a few minor adjustments to align it with our uncrustify style guidelines so that it passes our CI checks?

src/cpp/utils/SystemInfo.cpp Outdated Show resolved Hide resolved
src/cpp/utils/SystemInfo.cpp Outdated Show resolved Hide resolved
src/cpp/utils/TimedConditionVariable.cpp Outdated Show resolved Hide resolved
@RookieCLY
Copy link
Contributor Author

Hi, @Javgilavi . Thanks for the advice, I will do it soon. By the way, are there any other advice for the CI checks, like DCO and so on?

@Javgilavi
Copy link
Contributor

Hi @RookieCLY,

Thanks for asking! I was actually about to mention the DCO issue, so you beat me to it.

In the CI output, you can click on the DCO Details link, which provides clear instructions on how to fix the problem. Essentially, you need to sign off your commits. Everything you need is explained in that section.

If you have any further questions or need additional help, feel free to ask.

Copy link
Contributor

@Javgilavi Javgilavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being a bit picky with the review, but these changes are necessary to pass the CI.

src/cpp/utils/SystemInfo.cpp Outdated Show resolved Hide resolved
@Javgilavi
Copy link
Contributor

And for the DCO looks like it's still giving error.

Your new commit is fine:
image

But in your original commit it still appears wrongly:
image
The "Signed-off-by: RookieCLY … " should appear in the second line (this automatically do with the commit -s) and also it says the commiter was "cuily" and not "RookieCLY", they need to be the same.

Follow the instruction of the DCO
image

If you have ant doubt about how to do it, just ask!!
And also thanks for the PR!!

@RookieCLY RookieCLY force-pushed the feature/mingw-compile branch 2 times, most recently from 4c9dfd3 to 680e6e4 Compare February 6, 2025 12:25
@Javgilavi Javgilavi self-requested a review February 6, 2025 13:11
@MiguelCompany MiguelCompany requested review from Javgilavi and removed request for Javgilavi February 6, 2025 13:40
@MiguelCompany MiguelCompany requested review from Javgilavi and removed request for Javgilavi February 6, 2025 13:51
Copy link
Contributor

@Javgilavi Javgilavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RookieCLY
Copy link
Contributor Author

Hi, @Javgilavi .
It seems that there is something wrong with MacOS CI, but I don't quite understand it. I just changed some code formats. What should I do next?

@MiguelCompany MiguelCompany added the ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. label Feb 7, 2025
@Javgilavi
Copy link
Contributor

Hi @RookieCLY,

Don't worry about it, it's not related to your changes.
It's not a problem.

@MiguelCompany
Copy link
Member

@RookieCLY Failed test on MacOS is known to be flakey.

Thank you for your contribution and your patience!

@MiguelCompany MiguelCompany merged commit 28b11ca into eProsima:master Feb 7, 2025
16 of 17 checks passed
@MiguelCompany
Copy link
Member

@Mergifyio backport 3.1.x 3.0.x 2.14.x 2.10.x

Copy link
Contributor

mergify bot commented Feb 7, 2025

backport 3.1.x 3.0.x 2.14.x 2.10.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW and fix some format problem  #5575

Signed-off-by: RookieCLY <[email protected]>

---------

Signed-off-by: RookieCLY <[email protected]>
(cherry picked from commit 28b11ca)
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW and fix some format problem  #5575

Signed-off-by: RookieCLY <[email protected]>

---------

Signed-off-by: RookieCLY <[email protected]>
(cherry picked from commit 28b11ca)
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW and fix some format problem  #5575

Signed-off-by: RookieCLY <[email protected]>

---------

Signed-off-by: RookieCLY <[email protected]>
(cherry picked from commit 28b11ca)

# Conflicts:
#	include/fastdds/fastdds_dll.hpp
#	src/cpp/fastdds/xtypes/serializers/json/dynamic_data_json.cpp
#	src/cpp/utils/TimedConditionVariable.cpp
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW #5575

Signed-off-by: RookieCLY <[email protected]>

* feature: support compiler MSYS2-MinGW and fix some format problem  #5575

Signed-off-by: RookieCLY <[email protected]>

---------

Signed-off-by: RookieCLY <[email protected]>
(cherry picked from commit 28b11ca)

# Conflicts:
#	include/fastdds/fastdds_dll.hpp
#	src/cpp/fastdds/xtypes/serializers/json/dynamic_data_json.cpp
#	src/cpp/utils/TimedConditionVariable.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[22704] Link problem with MinGW
3 participants