Skip to content

Commit ff7b15c

Browse files
committed
Support a few non patch related errors
Signed-off-by: Uilian Ries <uilianr@jfrog.com>
1 parent 6f1d4cb commit ff7b15c

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
set -euo pipefail
44

5-
SAMPLE_RECIPES_NUM=10
5+
SAMPLE_RECIPES_NUM=30
6+
RECIPES_BUILD_NUM=10
7+
RECIPES_BUILT_COUNT=0
68

79
# Find all conanfile.py files that use apply_conandata_patches
810
RECIPES=$(find . -type f -name "conanfile.py" -exec grep -l "apply_conandata_patches(self)" {} + | sort | uniq)
@@ -18,6 +20,12 @@ echo "$SAMPLE_RECIPES"
1820

1921
# Run conan create for each sampled recipe
2022
for it in $SAMPLE_RECIPES; do
23+
24+
if [ $RECIPES_BUILT_COUNT -ge $RECIPES_BUILD_NUM ]; then
25+
echo "Reached the limit of $RECIPES_BUILD_NUM recipes built, stopping. All done."
26+
break
27+
fi
28+
2129
recipe_dir=$(dirname "${it}")
2230
pushd "$recipe_dir"
2331
echo "Testing recipe in directory: ${recipe_dir}"
@@ -30,7 +38,28 @@ for it in $SAMPLE_RECIPES; do
3038
version=$(echo ${version} | tr -d '"')
3139
# Replace apply_conandata_patches to exit just after applying patches
3240
sed -i -e 's/apply_conandata_patches(self)/apply_conandata_patches(self); import sys; sys.exit(0)/g' conanfile.py
41+
42+
# Allow conan create to fail without stopping the script, we will handle errors manually
43+
set +e
44+
3345
# Create the package with the specified version
34-
conan create . --version=${version} --build=missing
46+
output=$(conan create . --version=${version} --build=missing 2>&1)
47+
# Accept some errors as non-fatal
48+
if [ $? -ne 0 ]; then
49+
echo "WARNING: conan create failed for $recipe_dir"
50+
if echo "$output" | grep -q "ERROR: There are invalid packages"; then
51+
echo "WARNING: Invalid packages found, skipping the build."
52+
elfi echo "$output" | grep -q "ERROR: Version conflict"; then
53+
echo "WARNING: Version conflict, skipping the build."
54+
else
55+
echo "ERROR: Fatal error during conan create command execution:"
56+
echo "$output"
57+
popd
58+
exit 1
59+
fi
60+
else
61+
echo "INFO: conan create succeeded for $recipe_dir."
62+
RECIPES_BUILT_COUNT=$((RECIPES_BUILT_COUNT + 1))
63+
fi
3564
popd
3665
done

.github/workflows/conan-center-index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444

4545
- name: Validate Python-NG patch application
4646
working-directory: conan-center-index/recipes
47-
run: bash "${GITHUB_WORKSPACE}/python-ng/tests/scripts/validate-cci-patch-ng.sh"
47+
run: bash "${GITHUB_WORKSPACE}/python-ng/.github/scripts/validate-cci-patch-ng.sh"

0 commit comments

Comments
 (0)