Backport improvements to build script (#350)

In the stable branch we are still testing the newest release, while sometimes
we get fixes to older release manifests.
This commit is contained in:
Alejandro R Mosteo
2021-09-14 09:59:47 +02:00
committed by GitHub
parent 148248846f
commit ffd49df662
+53 -26
View File
@@ -43,34 +43,45 @@ for file in $CHANGES; do
is_system=false is_system=false
crate=$(basename $file .toml | cut -f1 -d-) crate=$(basename $file .toml | cut -f1 -d-)
echo Testing crate: $crate version=$(basename $file .toml | cut -f2- -d-)
milestone="$crate=$version"
echo Testing crate: $milestone
# Remember that version can be "external", in which case we do not know the
# actual version, and indeed the test will only work if the external is the
# newest version. This probably merits a way of being tested properly, but
# that will require changes in alr.
if [[ $version = external ]]; then
echo Downgrading milestone to plain crate name
milestone=$crate
fi
# Show info for the record # Show info for the record
echo PLATFORM-INDEPENDENT CRATE INFO $crate echo PLATFORM-INDEPENDENT CRATE INFO $milestone
alr show $crate alr show $milestone
alr show --external $crate alr show --external $milestone
alr show --external-detect $crate alr show --external-detect $milestone
echo PLATFORM-DEPENDENT CRATE INFO $crate echo PLATFORM-DEPENDENT CRATE INFO $milestone
alr show --system $crate alr show --system $milestone
alr show --external --system $crate alr show --external --system $milestone
alr show --external-detect --system $crate alr show --external-detect --system $milestone
crateinfo=$(alr show --external-detect --system $crate) crateinfo=$(alr show --external-detect --system $milestone)
echo CRATE DEPENDENCIES $crate echo CRATE DEPENDENCIES $milestone
alr show --solve --detail --external-detect $crate alr show --solve --detail --external-detect $milestone
solution=$(alr show --solve --detail --external-detect $crate) solution=$(alr show --solve --detail --external-detect $milestone)
# Skip on explicit unavailability # Skip on explicit unavailability
if alr show --system $crate | grep -q 'Available when: False'; then if alr show --system $milestone | grep -q 'Available when: False'; then
echo SKIPPING crate build: $crate UNAVAILABLE on system echo SKIPPING crate build: $milestone UNAVAILABLE on system
continue continue
fi fi
# In unsupported platforms, externals are properly reported as missing. We # In unsupported platforms, externals are properly reported as missing. We
# can skip testing of such a crate since it will likely fail. # can skip testing of such a crate since it will likely fail.
if grep -q 'Dependencies (external):' <<< $solution ; then if grep -q 'Dependencies (external):' <<< $solution ; then
echo SKIPPING build for crate $crate with MISSING external dependencies echo SKIPPING build for crate $milestone with MISSING external dependencies
continue continue
fi fi
@@ -84,13 +95,20 @@ for file in $CHANGES; do
echo No need to update system repositories echo No need to update system repositories
fi fi
# Detect whether the crate is binary to skip build
is_binary=false
if grep -iq 'binary archive' <<< $crateinfo; then
echo Crate is BINARY
is_binary=true
fi
# Alternatives for when the crate itself comes from an external. Only system # Alternatives for when the crate itself comes from an external. Only system
# externals should be tested. # externals should be tested.
if grep -q 'Origin: external path' <<< $crateinfo ; then if grep -q 'Origin: external path' <<< $crateinfo ; then
echo SKIPPING detected external crate $crate echo SKIPPING detected external crate $milestone
continue continue
elif grep -q 'Origin: system package' <<< $crateinfo ; then elif grep -q 'Origin: system package' <<< $crateinfo ; then
echo INSTALLING detected system crate $crate echo INSTALLING detected system crate $milestone
is_system=true is_system=true
elif grep -q 'Not found:' <<< $crateinfo && \ elif grep -q 'Not found:' <<< $crateinfo && \
grep -q 'There are external definitions' <<< $crateinfo grep -q 'There are external definitions' <<< $crateinfo
@@ -101,23 +119,32 @@ for file in $CHANGES; do
# Detect missing dependencies for clearer error # Detect missing dependencies for clearer error
if grep -q 'Dependencies cannot be met' <<< $solution ; then if grep -q 'Dependencies cannot be met' <<< $solution ; then
echo FAIL: crate $crate dependencies cannot be met echo FAIL: crate $milestone dependencies cannot be met
exit 1 exit 1
fi fi
# Actual checks # Actual checks
echo DEPLOYING CRATE $crate echo DEPLOYING CRATE $milestone
alr get -d --build -n $crate if $is_binary; then
echo SKIPPING BUILD for BINARY crate, FETCHING only
build_flag=""
else
build_flag="--build"
fi
alr get -d $build_flag -n $milestone
if $is_system; then if $is_system; then
echo DETECTING INSTALLED PACKAGE via crate $crate echo DETECTING INSTALLED PACKAGE via crate $milestone
alr show -d --external-detect $crate alr show -d --external-detect $milestone
elif $is_binary; then
echo FETCHED BINARY crate OK
else else
echo LISTING EXECUTABLES of crate $crate echo LISTING EXECUTABLES of crate $milestone
cd ${crate}_* cd ${crate}_${version}_*
alr run -d --list alr run -d --list
cd .. cd ..
fi fi
echo CRATE $crate TEST ENDED SUCCESSFULLY echo CRATE $milestone TEST ENDED SUCCESSFULLY
done done