22
33set -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
810RECIPES=$( 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
2022for 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
3665done
0 commit comments