Skip to content

Commit a71b888

Browse files
conan v2 wip
1 parent dc54d50 commit a71b888

File tree

2 files changed

+48
-103
lines changed

2 files changed

+48
-103
lines changed

.github/workflows/rebuildDependencies.yml

+47-87
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,28 @@ jobs:
1414
matrix:
1515
include:
1616
- platform: mac-intel
17-
os: macos-13
17+
os: macos-14
1818
before_install: macos.sh
1919
conan_profile: macos-intel
20-
conan_prebuilts: dependencies-mac-intel
21-
conan_options: --options with_apple_system_libs=True
22-
- platform: mac-arm
23-
os: macos-13
24-
before_install: macos.sh
25-
conan_profile: macos-arm
26-
conan_prebuilts: dependencies-mac-arm
27-
conan_options: --options with_apple_system_libs=True
28-
- platform: ios
29-
os: macos-13
30-
before_install: macos.sh
31-
conan_profile: ios-arm64
32-
conan_prebuilts: dependencies-ios
33-
conan_options: --options with_apple_system_libs=True
34-
- platform: mingw-x86-64
35-
os: ubuntu-24.04
36-
before_install: mingw.sh
37-
conan_profile: mingw64-linux.jinja
38-
conan_prebuilts: dependencies-mingw-x86-64
39-
- platform: mingw-x86
40-
os: ubuntu-24.04
41-
before_install: mingw.sh
42-
conan_profile: mingw32-linux.jinja
43-
conan_prebuilts: dependencies-mingw-x86
20+
# - platform: mac-arm
21+
# os: macos-14
22+
# before_install: macos.sh
23+
# conan_profile: macos-arm
24+
# - platform: ios
25+
# os: macos-14
26+
# before_install: macos.sh
27+
# conan_profile: ios-arm64
4428
- platform: android-armeabi-v7a
4529
os: ubuntu-24.04
4630
conan_profile: android-32-ndk
47-
conan_prebuilts: dependencies-android-armeabi-v7a
48-
- platform: android-arm64-v8a
49-
os: ubuntu-24.04
50-
conan_profile: android-64-ndk
51-
conan_prebuilts: dependencies-android-arm64-v8a
31+
# - platform: android-arm64-v8a
32+
# os: ubuntu-24.04
33+
# conan_profile: android-64-ndk
34+
- platform: windows-x64
35+
os: windows-2022
36+
# before_install: msvc.sh
37+
conan_profile: msvc-x64
38+
conan_options: -c tools.cmake.cmaketoolchain:generator=
5239
runs-on: ${{ matrix.os }}
5340
defaults:
5441
run:
@@ -57,92 +44,65 @@ jobs:
5744
steps:
5845
- name: Checkout repository
5946
uses: actions/checkout@v4
47+
# TODO
6048
with:
61-
repository: 'vcmi/vcmi'
62-
ref: 'update_prebuilts'
49+
repository: 'kambala-decapitator/vcmi'
50+
ref: 'conan-v2'
6351

6452
- uses: actions/setup-java@v4
6553
if: ${{ startsWith(matrix.platform, 'android') }}
6654
with:
6755
distribution: 'temurin'
68-
java-version: '11'
56+
java-version: '17'
6957

7058
- name: Prepare CI
7159
if: "${{ matrix.before_install != '' }}"
7260
run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
7361

74-
- name: Install Conan Dependencies
75-
if: "${{ matrix.conan_prebuilts != '' }}"
76-
run: source '${{github.workspace}}/CI/install_conan_dependencies.sh' '${{matrix.conan_prebuilts}}'
77-
78-
- name: Remove old binary packages (non-android)
79-
if: ${{ !startsWith(matrix.platform, 'android') }}
80-
run: rm -rf ~/.conan/data/*/*/_/_/package
81-
82-
# TODO: fix libiconv - fails to build on android (both macos and linux host)
83-
- name: Remove old binary packages (android)
84-
if: ${{ startsWith(matrix.platform, 'android') }}
85-
run: |
86-
mv ~/.conan/data/libiconv ~/
87-
rm -rf ~/.conan/data/*/*/_/_/package
88-
mv ~/libiconv ~/.conan/data
89-
90-
# Completely remove packages that were confirmed to be rebuildable using upstream recipe/sources
91-
# TODO: generate entire package from scratch instead of such cleanup
92-
- name: Remove old recipes
93-
run: |
94-
rm -rf ~/.conan/data/boost
95-
rm -rf ~/.conan/data/ffmpeg
96-
rm -rf ~/.conan/data/xz_utils
97-
rm -rf ~/.conan/data/sdl_mixer
98-
rm -rf ~/.conan/data/sdl_image
99-
rm -rf ~/.conan/data/sdl_ttf
100-
rm -rf ~/.conan/data/sdl
101-
102-
- name: Remove old recipes (non-apple)
103-
if: ${{ matrix.platform != 'ios' && matrix.platform != 'mac-intel' && matrix.platform != 'mac-arm' }}
104-
run: |
105-
rm -rf ~/.conan/data/sqlite3
106-
10762
- name: Install Conan
108-
run: pipx install 'conan<2.0'
63+
run: pipx install conan
64+
65+
# TODO:
66+
# 0. install system libs recipes for Apple/Android
67+
# 1. download our patches
68+
# 2. build patched packages with conan create
69+
# 3. build LuaJIT from PR changes with conan create
10970

11071
- name: Generate conan profile
11172
run: |
112-
conan profile new default --detect
73+
conan profile detect
11374
conan install . \
114-
--install-folder=conan-generated \
115-
--no-imports \
75+
--output-folder=conan-generated \
11676
--build=missing \
11777
--profile:build=default \
11878
--profile:host=CI/conan/${{ matrix.conan_profile }} \
11979
${{ matrix.conan_options }}
120-
env:
121-
GENERATE_ONLY_BUILT_CONFIG: 1
12280
12381
- name: Remove builds and source code
124-
run: "conan remove --builds --src --force '*'"
125-
82+
run: conan cache clean
83+
12684
- name: Remove build requirements
12785
run: |
128-
rm -rf ~/.conan/data/android-ndk
129-
rm -rf ~/.conan/data/autoconf
130-
rm -rf ~/.conan/data/automake
131-
rm -rf ~/.conan/data/b2
132-
rm -rf ~/.conan/data/cmake
133-
rm -rf ~/.conan/data/gnu-config
134-
rm -rf ~/.conan/data/libtool
135-
rm -rf ~/.conan/data/m4
136-
rm -rf ~/.conan/data/nasm
137-
rm -rf ~/.conan/data/pkgconf
138-
rm -rf ~/.conan/data/yasm
86+
graphFile=graph.json
87+
conan graph info . \
88+
--format=json \
89+
--build=never \
90+
--out-file "$graphFile" \
91+
--no-remote \
92+
--filter=context
93+
94+
buildPackagesSelector='.graph.nodes[] | select(.context == "build") | .ref'
95+
buildPackages=$(jq -r "$buildPackagesSelector" "$graphFile" | sort | uniq)
96+
for p in $buildPackages ; do
97+
conan remove --confirm "$p:*"
98+
done
13999
140100
- name: Create dependencies archive
141-
run: "tar --create --xz --file dependencies-${{matrix.platform}}.txz -C ~/.conan data"
101+
run: conan cache save --file dependencies-${{matrix.platform}}.tgz '*:*'
142102

143103
- name: Upload artifacts
144104
uses: actions/upload-artifact@v4
145105
with:
146106
name: dependencies-${{ matrix.platform }}
147107
compression-level: 0
148-
path: 'dependencies-${{matrix.platform}}.txz'
108+
path: 'dependencies-${{matrix.platform}}.tgz'

README.md

+1-16
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,8 @@ Current flow to update dependencies:
1515
- https://docs.conan.io/2/reference/conan_server.html (not recommended by Conan)
1616
- https://jfrog.com/
1717

18-
- Switch to conan 2. Incomplete (and potentially outdated) PR can be found here: https://github.com/vcmi/vcmi/pull/1603 Will also require changing how we create final package - instead of archiving `~/.conan/data` we'll need to use `conan cache` command
19-
20-
- Use Conan for msvc builds. Currently blocked by several issues, namely:
21-
- Conan 1 does not works with latest Visual Studio 2022. We need to either use msvc 2019 or upgrade to conan 2.
22-
- ffmpeg fails to find its dependencies when building with conan 1 + msvc 2019. Might be fixed in conan 2.
23-
- Qt fails to build due to broken string escaping in a path (conan 1 + msvc 2019)
24-
25-
- Rebuild SDL_mixer and try to enable support for opus and flac. Needs investigation as to why libopus / libflac fail to build
26-
27-
- Consider removing pcx support from SDL_image
28-
2918
- Rebuild ffmpeg with libdav1d and av1 support enabled. Needs investigation as to why dav1d fails to build on mingw and on android.
3019

31-
- Find out why libiconv fails to rebuild on Android
32-
33-
- Rebuild entire package from scratch using latest recipes from conan, to test current version of recipes
34-
3520
- Run CI with full package rebuild on schedule (weekly? monthly?) to detect any regressions or breaking changes in CI or in used recipes
3621

3722
- Automatically generate Github release with updated packages as part of CI. Should probably be done only for changes in main branch and/or for manually triggered workflows
@@ -49,4 +34,4 @@ With this approach we will be able to use following flow for new dependencies:
4934

5035
After merging PR in vcmi/vcmi repository vcmi will use new dependencies.
5136

52-
If vcmi/vcmi PR is discarded for one reason or another, changes in this repository will have to be discarded as well
37+
If vcmi/vcmi PR is discarded for one reason or another, changes in this repository will have to be discarded as well

0 commit comments

Comments
 (0)