Skip to content

libmodbus Add version 3.1.12 and stop publishing revs for older versions#30083

Merged
jcar87 merged 7 commits into
conan-io:masterfrom
ottmar-zittlau:package/libmodbus-add-version-3.1.12
May 5, 2026
Merged

libmodbus Add version 3.1.12 and stop publishing revs for older versions#30083
jcar87 merged 7 commits into
conan-io:masterfrom
ottmar-zittlau:package/libmodbus-add-version-3.1.12

Conversation

@ottmar-zittlau
Copy link
Copy Markdown
Contributor

@ottmar-zittlau ottmar-zittlau commented Apr 27, 2026

Summary

Add libmodbus/3.1.12

Motivation

Added libmodbus v3.1.12 because they fixed some issues on their side (stephane/libmodbus#829 & stephane/libmodbus#830) that complicate the current recipe.

Details

Added the new version and stopped publishing revs for older versions.


  • Read the contributing guidelines
  • Checked that this PR is not a duplicate: list of PRs by recipe
  • If this is a bug fix, please link related issue or provide bug details
  • Tested locally with at least one configuration using a recent version of Conan

Add a 👍 reaction to pull requests you find important to help the team prioritize, thanks!

@uilianries uilianries self-assigned this Apr 30, 2026
@ottmar-zittlau
Copy link
Copy Markdown
Contributor Author

@uilianries I looked into the failing MacOs test and I think the build is already failing (log), because there are some errors of the type:
ld: warning: ignoring file '.libs/modbus.o': found architecture 'arm64', required architecture 'x86_64'
If I understand this correctly the linker just ignores all the interesting parts.

I tried the cross-compilation on my (ubuntu 24.04) machine with gcc14 by running

conan create . --version 3.1.12 -s:h arch=x86_64 -s:b arch=armv8 --build missing
This works and compared the output that is generated to the pipeline job output. I noticed that the ldflags in the pipeline job contain an explicit -arch x86_64:
ldflags: -m64 -isysroot /Applications/conan/xcode/26.0.1/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk -arch x86_64
On my machine it's only
ldflags: -m64
but I don't understand what the apple linker requires.

Do I need to handle the cross-compilation case explicitly in my recipe, e.g. by using apple_arch_flag (cf. https://docs.conan.io/2/reference/tools/gnu/autotoolstoolchain.html#customization)?

uilianries added 3 commits May 4, 2026 08:54
Signed-off-by: Uilian Ries <uilianr@jfrog.com>
Signed-off-by: Uilian Ries <uilianr@jfrog.com>
Signed-off-by: Uilian Ries <uilianr@jfrog.com>
@uilianries
Copy link
Copy Markdown
Member

@ottmar-zittlau Thank you for investigating the case!

The problem was related to cflags not being respected: on OSX we pass -arch x86_64 when generating for Mac Intel cpus, but it's injected via CFGLAS. Fortunately, the upstream has a proper fix merged on its master branch.

I just updated your PR to use that patch, so we will not need to care about it in the future.

I also removed version 1.3.11 from conandata.yml, as no other recipe in the Conan Center Index consumes libmodbus. No version will be removed from Conan Center; all packages will remain there. The only change is that CI will stop producing new revisions for those older versions.

Regards!

Signed-off-by: Uilian Ries <uilianr@jfrog.com>
@uilianries
Copy link
Copy Markdown
Member

The build https://github.com/conan-io/conan-center-index/pull/30083/checks?check_run_id=74180454570 failed due MSVC trying to consume GCC warning flags.

This error was mitigated previously by applying a non-official patch to remove warning flags.

I reported this case to the upstream, so we may have a proper fix in the future: stephane/libmodbus#846

As an alternative, I simplified the previous patch to only use those warning flags in case of using a supported compiler: 0627c3d

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Copy link
Copy Markdown
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

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

@ottmar-zittlau Thank you for your PR! It looks good to me now! 😄

Reviewer Notes

  • Latest version is 3.1.12: https://github.com/stephane/libmodbus/releases
  • No other recipe is consuming libmodbus in Conan Center, so removing old versions from conandata.yml is fine; No package will be removed from Conan Center, all old version will remain available for download as before.

Maintainer Changes

  • Dropped version 3.1.11 from conandata.yml as version 3.1.12 cover the same version, plus, more fixes.
  • Using official patch 0001-repect-cflags.patch from the upstream to deal with cflags. So far, we have had a custom implementation in this recipe.
  • Reported the upstream about MSVC error with warning flags: stephane/libmodbus#846
  • Using a proposed patch, similar to the previous one, to avoid consuming Warning flags for non GCC compatible compilers
  • Proposed a fix for ssize_t redefinition on Windows: stephane/libmodbus#847 - The same is now listed as 0003-fix-typedef-int.patch

@franramirez688 franramirez688 changed the title libmodbus Add version 3.1.12 and remove some older versions libmodbus Add version 3.1.12 and stop publishing revs for older versions May 4, 2026
@ottmar-zittlau
Copy link
Copy Markdown
Contributor Author

@uilianries Thanks a lot for finishing this and explaining your changes!

@jcar87 jcar87 merged commit 31a2f51 into conan-io:master May 5, 2026
9 checks passed
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.

3 participants