Skip to content

Commit 014a6e5

Browse files
committed
Migrate Conan provisioning to uv and pin source tags
- Replace per-recipe requirements.txt with shared pyproject.toml (conan==2.31.2) - Run Conan via uv in Taskfile and install uv in CI jobs - Pin hostlibs to runtime v10.0.10 and Skia to v3.119.4 release tags - Fold no-pgo cmake configure into chained build command
1 parent 88f1069 commit 014a6e5

12 files changed

Lines changed: 57 additions & 32 deletions

File tree

.claude/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"enabledPlugins": {
3+
"csharp-lsp@claude-plugins-official": false
4+
}
5+
}

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
path: artifacts\hostlibs
4242
key: hostlibs-windows-${{ matrix.hostlibs_flavor }}-${{ matrix.rid }}-${{ hashFiles('native/hostlibs/**') }}
4343

44+
- name: Install uv
45+
if: steps.cache_hostlibs.outputs.cache-hit != 'true'
46+
uses: astral-sh/setup-uv@v5
47+
4448
- name: Install Task
4549
if: steps.cache_hostlibs.outputs.cache-hit != 'true'
4650
uses: ./.github/actions/install-task
@@ -111,6 +115,10 @@ jobs:
111115
if: steps.cache_skia.outputs.cache-hit != 'true'
112116
uses: ./.github/actions/install-llvm
113117

118+
- name: Install uv
119+
if: steps.cache_skia.outputs.cache-hit != 'true'
120+
uses: astral-sh/setup-uv@v5
121+
114122
- name: Install Task
115123
if: steps.cache_skia.outputs.cache-hit != 'true'
116124
uses: ./.github/actions/install-task
@@ -153,6 +161,10 @@ jobs:
153161
path: artifacts\angle
154162
key: angle-windows-${{ matrix.rid }}-${{ hashFiles('native/angle/**') }}
155163

164+
- name: Install uv
165+
if: steps.cache_angle.outputs.cache-hit != 'true'
166+
uses: astral-sh/setup-uv@v5
167+
156168
- name: Install Task
157169
if: steps.cache_angle.outputs.cache-hit != 'true'
158170
uses: ./.github/actions/install-task
@@ -286,6 +298,10 @@ jobs:
286298
path: artifacts/hostlibs
287299
key: hostlibs-linux-linux-x64-${{ env.LINUX_SYSROOT_CACHE_KEY }}-${{ hashFiles('native/hostlibs/**') }}
288300

301+
- name: Install uv
302+
if: steps.cache_hostlibs.outputs.cache-hit != 'true'
303+
uses: astral-sh/setup-uv@v5
304+
289305
- name: Install Task
290306
if: steps.cache_hostlibs.outputs.cache-hit != 'true'
291307
uses: ./.github/actions/install-task
@@ -362,6 +378,10 @@ jobs:
362378
path: artifacts/skiasharp
363379
key: skiasharp-linux-linux-x64-${{ env.LINUX_SYSROOT_CACHE_KEY }}-${{ hashFiles('native/skiasharp/**', 'scripts/libHarfBuzzSharp.vcxproj.in') }}
364380

381+
- name: Install uv
382+
if: steps.cache_skia.outputs.cache-hit != 'true'
383+
uses: astral-sh/setup-uv@v5
384+
365385
- name: Install Task
366386
if: steps.cache_skia.outputs.cache-hit != 'true'
367387
uses: ./.github/actions/install-task

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ __pycache__
44
[Tt]est[Rr]esults
55
.idea/
66
.vs/
7+
.venv/
78
/build/
89
/repo/
10+
uv.lock

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ CI 缓存键覆盖对应 recipe 目录;SkiaSharp 还包含原始 HarfBuzzSharp
3232

3333
- .NET 10 SDK
3434
- Python 3.10+
35+
- [uv](https://docs.astral.sh/uv/)
3536
- Task 3.52.0+
36-
- Conan 2.31.2
3737
- Git
3838
- Ninja
3939
- CMake

Taskfile.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ tasks:
3636
vars:
3737
FLAVOR: '{{if eq .PGO "True"}}default{{else}}no-pgo{{end}}'
3838
cmds:
39-
- python -m pip install --disable-pip-version-check -r native/hostlibs/requirements.txt
40-
- conan export native/hostlibs
39+
- uv run conan export native/hostlibs
4140
- >-
42-
conan install --requires="hostlibs/{{.HOSTLIBS_VERSION}}" --build=missing --no-remote --envs-generation=false
41+
uv run conan install --requires="hostlibs/{{.HOSTLIBS_VERSION}}" --build=missing --no-remote --envs-generation=false
4342
-pr:b=native/hostlibs/profiles/windows-{{.ARCH}}
4443
-pr:h=native/hostlibs/profiles/windows-{{.ARCH}}
4544
-o "hostlibs/*:pgo={{.PGO}}"
@@ -52,10 +51,9 @@ tasks:
5251
env:
5352
ROOTFS_DIR: '{{.SYSROOT}}'
5453
cmds:
55-
- python -m pip install --disable-pip-version-check -r native/hostlibs/requirements.txt
56-
- conan export native/hostlibs
54+
- uv run conan export native/hostlibs
5755
- >-
58-
conan install --requires="hostlibs/{{.HOSTLIBS_VERSION}}" --build=missing --no-remote --envs-generation=false
56+
uv run conan install --requires="hostlibs/{{.HOSTLIBS_VERSION}}" --build=missing --no-remote --envs-generation=false
5957
-pr:b=native/hostlibs/profiles/linux-x64
6058
-pr:h=native/hostlibs/profiles/linux-x64
6159
-c tools.system.package_manager:mode=install
@@ -80,10 +78,9 @@ tasks:
8078
internal: true
8179
platforms: [windows]
8280
cmds:
83-
- python -m pip install --disable-pip-version-check -r native/skiasharp/requirements.txt
84-
- conan export native/skiasharp
81+
- uv run conan export native/skiasharp
8582
- >-
86-
conan install --requires="skiasharp/{{.SKIASHARP_VERSION}}" --build=missing --no-remote --envs-generation=false
83+
uv run conan install --requires="skiasharp/{{.SKIASHARP_VERSION}}" --build=missing --no-remote --envs-generation=false
8784
-pr:b=native/skiasharp/profiles/windows-{{.ARCH}}
8885
-pr:h=native/skiasharp/profiles/windows-{{.ARCH}}
8986
--deployer=native/skiasharp/deploy.py
@@ -95,10 +92,9 @@ tasks:
9592
env:
9693
ROOTFS_DIR: '{{.SYSROOT}}'
9794
cmds:
98-
- python -m pip install --disable-pip-version-check -r native/skiasharp/requirements.txt
99-
- conan export native/skiasharp
95+
- uv run conan export native/skiasharp
10096
- >-
101-
CC=clang CXX=clang++ conan install --requires="skiasharp/{{.SKIASHARP_VERSION}}" --build=missing --no-remote --envs-generation=false
97+
CC=clang CXX=clang++ uv run conan install --requires="skiasharp/{{.SKIASHARP_VERSION}}" --build=missing --no-remote --envs-generation=false
10298
-pr:b=native/skiasharp/profiles/linux-x64
10399
-pr:h=native/skiasharp/profiles/linux-x64
104100
-c tools.system.package_manager:mode=install
@@ -112,10 +108,9 @@ tasks:
112108
vars:
113109
ARCH: '{{.ARCH | default "x64"}}'
114110
cmds:
115-
- python -m pip install --disable-pip-version-check -r native/angle/requirements.txt
116-
- conan export native/angle
111+
- uv run conan export native/angle
117112
- >-
118-
conan install --requires="angle/{{.ANGLE_VERSION}}" --build=missing --no-remote --envs-generation=false
113+
uv run conan install --requires="angle/{{.ANGLE_VERSION}}" --build=missing --no-remote --envs-generation=false
119114
-pr:b=native/angle/profiles/windows-{{.ARCH}}
120115
-pr:h=native/angle/profiles/windows-{{.ARCH}}
121116
--deployer=native/angle/deploy.py

native/angle/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

native/hostlibs/conandata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sources:
22
url: "https://github.com/dotnet/runtime"
3-
commit: "8f030f80c0dd2722eb2f618984e9db6784765963"
3+
commit: "v10.0.10"

native/hostlibs/conanfile.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,18 @@ def _build_apphost(self):
130130
root = self._apphost_build_root()
131131
if self.settings.os == "Windows":
132132
args = f"host.native -ninja -c release -arch {self._target_arch}"
133+
cmake_args = ""
134+
if not self.options.pgo:
135+
cmake_args = (
136+
f' && cmake -S "{self._runtime_root / "src" / "native" / "corehost"}"'
137+
f' -B "{root}" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=OFF'
138+
)
133139
self.run(
134-
f'"{self._runtime_root / "build.cmd"}" {args} /p:ConfigureOnly=true',
140+
f'"{self._runtime_root / "build.cmd"}" {args} /p:ConfigureOnly=true'
141+
f'{cmake_args} && ninja -C "{root}" apphost',
135142
cwd=str(self._runtime_root),
136143
env="conanbuild",
137144
)
138-
if not self.options.pgo:
139-
self.run(
140-
f'cmake -S "{self._runtime_root / "src" / "native" / "corehost"}" '
141-
f'-B "{root}" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=OFF',
142-
cwd=str(self._runtime_root),
143-
env="conanbuild",
144-
)
145-
self.run(f'ninja -C "{root}" apphost', env="conanbuild")
146145
else:
147146
cross = " --cross" if self._sysroot() else ""
148147
self.run(
@@ -165,11 +164,11 @@ def _build_singlefilehost(self):
165164
" /p:NoPgoOptimize=true"
166165
)
167166
self.run(
168-
f'"{self._runtime_root / "build.cmd"}" {args}',
167+
f'"{self._runtime_root / "build.cmd"}" {args}'
168+
f' && ninja -C "{root}" singlefilehost',
169169
cwd=str(self._runtime_root),
170170
env="conanbuild",
171171
)
172-
self.run(f'ninja -C "{root}" singlefilehost', env="conanbuild")
173172
else:
174173
cross = " --cross" if self._sysroot() else ""
175174
self.run(

native/hostlibs/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

native/skiasharp/conandata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sources:
22
url: "https://github.com/mono/skia"
3-
commit: "7dbfc07dd33181f84e0958afb7ee805c6c769f0b"
3+
commit: "v3.119.4"

0 commit comments

Comments
 (0)