Skip to content

migrate to Conan v2 #8

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

Merged
merged 14 commits into from
Aug 6, 2025
Merged

migrate to Conan v2 #8

merged 14 commits into from
Aug 6, 2025

Conversation

kambala-decapitator
Copy link
Collaborator

@kambala-decapitator kambala-decapitator commented Mar 16, 2025

  • packages that require custom patches must be built separately with conan build and from the CCI repo
  • since Qt 5 requires custom patches, I've also included patches from KDE project. They were generated from a72077a88903fe532f6a749677eb4da4ea99f79f, but a few had to be dropped because Conan can't use them, namely:
    • 0018-Fix-memory-leak
    • 0024-Use-icon-themes-in-QPrintPreviewDialog-if-they-exist
    • 0061-Annotate-QMutex-with-TSAN-annotations
  • building LuaJIT for 32-bit platform requires build machine to be able to execute 32-bit code (macOS after 10.14 can't do that for example), see Cross-compiling 32 bit LuaJIT on a 64 bit host LuaJIT/LuaJIT#664

@kambala-decapitator kambala-decapitator force-pushed the conan-v2 branch 2 times, most recently from 254c505 to a71b888 Compare March 16, 2025 15:00
@kambala-decapitator
Copy link
Collaborator Author

failure of cross-building Qt 5 from macOS ARM -> Intel is unexpected. Will check what's wrong, but maybe we'll have to use Intel runner with Xcode 15 to produce Intel deps.

@kambala-decapitator
Copy link
Collaborator Author

finally all deps build correctly.

@IvanSavenko I consider moving all the Conan related things to this repo right in this PR (like described in the Future Improvements), otherwise it's quite inconvenient to work with them.

@IvanSavenko
Copy link
Member

If you find this approach more convenient - sure.

Would require copy-pasting conan / CI files from main repo to here, but probably still more convenient.

@kambala-decapitator
Copy link
Collaborator Author

The files will be moved, not copy-pasted. And this repo will be added to vcmi as submodule.

@kambala-decapitator
Copy link
Collaborator Author

automatically created release will look like this (apart from minor cosmetic changes): https://github.com/vcmi/vcmi-dependencies/releases/tag/untagged-5d54e88a0e3d8c424be3

currently ffmpeg started failing for some unobvious reason on Windows (which I can't reproduce even in a separate GhA run in other repo). The intention is that after all builds are green, the draft pre-release becomes non-draft.

Will also adjust to actually create release only when running manually from master branch.

@IvanSavenko Do you have other thoughts / input?

@IvanSavenko
Copy link
Member

Will also adjust to actually create release only when running manually from master branch.

Or on PR merge? But works fine for me either way.

currently ffmpeg started failing for some unobvious reason on Windows

That "zlib not found" message? I think we can simply disable zlib support from ffmpeg. From what I see it is only needed to support some rare decoders, which we have disabled anyway. No idea whether this would fix the build though.

Do you have other thoughts / input?

  • If Windows-based conan2 fails, perhaps restore vcpkg and keep using it for now, until that problem is resolved? I am OK with removing mingw, since making it work with conan2 will likely need some effort and nobody uses those artifacts at the moment. But still not sure if we need to actually remove vcpkg support that works fine so far and is used by our Windows devs.

  • No 32-bit Windows support?

  • Why do we need all those Qt patches?

  • Looks like dependencies are now packaged as .tgz and not .txz? Fine for me either way though.

@kambala-decapitator
Copy link
Collaborator Author

That "zlib not found" message? I think we can simply disable zlib support from ffmpeg. From what I see it is only needed to support some rare decoders, which we have disabled anyway. No idea whether this would fix the build though.

yes. In my own test repo I can't reproduce for example and can't figure out what's the difference. Especially since it used to work a month ago.

But today I was testing on a virtual windows machine and managed to reproduce random failures with various libraries. The error in all cases was from linker "can't open exe for writing" during internal FFmpeg tests.

I'll try once more in GhA and will upload the conan directory for inspection to see if it's the same reason or not. After that will try disabling zlib.

But still not sure if we need to actually remove vcpkg support that works fine so far and is used by our Windows devs.

what I don't like with vcpkg is amount of project patching to make it work while Conan requires close to zero. (also possible that vcpkg is integrated not quite correctly)

No 32-bit Windows support?

simply didn't add respective matrix dimension, will do

Why do we need all those Qt patches?

KDE patches are recommended for usage (but not required). I decided to include them since Qt requires a few of our custom patches anyway.

Looks like dependencies are now packaged as .tgz and not .txz? Fine for me either way though.

now the archive is created by Conan command and will be restored using its counterpart, and it can do only tgz.

@kambala-decapitator
Copy link
Collaborator Author

ffmpeg+zlib solved, now Qt started failing on 32-bit

@kambala-decapitator
Copy link
Collaborator Author

now Qt started failing on 32-bit

nailed it and opened PR with fix: conan-io/conan-center-index#27449

@Laserlicht
Copy link
Contributor

Laserlicht commented Jul 20, 2025

Can we already add android-x86 and win-arm64 support in first release?

At least android-x86 builds just fine:
https://github.com/Laserlicht/vcmi-dependencies/actions/runs/16399926624

conan-v2...Laserlicht:vcmi-dependencies:conan-v2

generated from a72077a88903fe532f6a749677eb4da4ea99f79f

except:
0018-Fix-memory-leak
0024-Use-icon-themes-in-QPrintPreviewDialog-if-they-exist
0061-Annotate-QMutex-with-TSAN-annotations
@kambala-decapitator kambala-decapitator force-pushed the conan-v2 branch 3 times, most recently from 128b7a6 to ecd4751 Compare August 1, 2025 10:14
@kambala-decapitator kambala-decapitator marked this pull request as ready for review August 1, 2025 10:15
@kambala-decapitator
Copy link
Collaborator Author

I think it's ready

@kambala-decapitator kambala-decapitator changed the title conan v2 wip migrate to Conan v2 Aug 1, 2025
@kambala-decapitator
Copy link
Collaborator Author

kambala-decapitator commented Aug 1, 2025

this workaround needs to be added to win arm64: libsdl-org/SDL#13340

@IvanSavenko
Copy link
Member

Perhaps that SDL patch should be added to rest of patches in this PR?

In any case - look OK for me too. What would be the next steps?

  • add sdl patch to this PR(?)
  • merge this PR
  • create release with new packages
  • update your conan2 PR in vcmi/vcmi
  • test new builds & merge conan2 PR in vcmi/vcmi

?

@kambala-decapitator
Copy link
Collaborator Author

kambala-decapitator commented Aug 1, 2025

I'll see how to handle that SDL issue, it's possible that simply enabling system C library would fix the error.

Correct for the next steps except that

create release with new packages

Requires crafting new workflow that would create release out of given Actions run, but that is rather easy to do.

@kambala-decapitator
Copy link
Collaborator Author

Will check how to patch opusfile's vs solution that it can be built for arm64

@kambala-decapitator
Copy link
Collaborator Author

kambala-decapitator commented Aug 4, 2025

opusfile fixed, but just noticed that LuaJIT doesn't build, although this doesn't fail the overall build. Needs patches from LuaJIT/LuaJIT#593

@kambala-decapitator
Copy link
Collaborator Author

let's solve LuaJIT for Windows arm64 later, will open an issue

@IvanSavenko
Copy link
Member

Perhaps we can use Lua (non-JIT) on this platform meanwhile?

Would be great to have Lua available on all platforms, but it is not like we're going to rewrite half of logic on Lua so poor performance of non-JIT Lua won't affect gameplay much.

@kambala-decapitator
Copy link
Collaborator Author

good idea! It builds successfully: https://github.com/kambala-decapitator/workflow-test/actions/runs/16783176151/job/47527013007

will adjust CI and recipe to handle different Lua flavors

@kambala-decapitator kambala-decapitator merged commit 9f9f7d2 into main Aug 6, 2025
9 checks passed
@kambala-decapitator kambala-decapitator deleted the conan-v2 branch August 6, 2025 19:40
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