Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 12 additions & 24 deletions .github/workflows/rebuildDependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,41 +225,29 @@ jobs:
- name: Remove build requirements' binaries
run: |
graphFile='graph.json'
hostPackagesFile='packages-host.json'
buildPackagesFile='packages-build.json'
buildFilteredPackagesFile='packages-build-filtered.txt'
packageListFile='pkglist.json'

# the special conf is a workaround for https://github.com/conan-io/conan/issues/19366
conan graph info . \
$CONAN_PROFILES \
${{ matrix.conan_options }} \
--format=json \
--build=never \
--build="*" \
--no-remote \
> "$graphFile"

conan list \
--graph "$graphFile" \
--graph-context=build-only \
--format=json \
> $buildPackagesFile

conan list \
--graph "$graphFile" \
--graph-context=host \
--format=json \
> $hostPackagesFile

# Some are both build and host requirements and must not be removed
# => exclude them from the list
python3 -c '
import json, sys
build_dict = json.load(open(sys.argv[1]))["Local Cache"] # => {"pkg1": {...}, "pkg2": {...}, ...}
host_list = json.load(open(sys.argv[2]))["Local Cache"] # => ["pkg1", "pkg2", ...]
filtered_dict = {k: v for k, v in build_dict.items() if k not in host_list}
json.dump({"Local Cache": filtered_dict}, open(sys.argv[3], "w"))
' "$buildPackagesFile" "$hostPackagesFile" "$buildFilteredPackagesFile"

conan remove --list "$buildFilteredPackagesFile" --confirm
> "$packageListFile"
conan remove --list "$packageListFile" --confirm
- name: Upload JSON graphs
uses: actions/upload-artifact@v4
with:
name: JSON graphs ${{ matrix.platform }}
path: |
graph.json
pkglist.json

- name: Create list of built packages
run: |
Expand Down