diff options
Diffstat (limited to 'support')
-rwxr-xr-x | support/dependencies/check-host-cmake.sh | 8 | ||||
-rw-r--r-- | support/dependencies/check-host-lzip.mk | 5 | ||||
-rwxr-xr-x | support/dependencies/check-host-lzip.sh | 14 | ||||
-rw-r--r-- | support/dependencies/check-host-xzcat.mk | 1 | ||||
-rw-r--r-- | support/misc/Vagrantfile | 21 | ||||
-rwxr-xr-x | support/scripts/test-pkg | 77 |
6 files changed, 81 insertions, 45 deletions
diff --git a/support/dependencies/check-host-cmake.sh b/support/dependencies/check-host-cmake.sh index 9b63b0648d..84c26c25cd 100755 --- a/support/dependencies/check-host-cmake.sh +++ b/support/dependencies/check-host-cmake.sh @@ -6,6 +6,9 @@ version_min="${2}" major_min="${version_min%.*}" minor_min="${version_min#*.}" +# cmake-3.7 incorrectly handles rpath, linking to host libraries +blacklist_version="3.7" + cmake=`which ${candidate}` if [ ! -x "${cmake}" ]; then # echo nothing: no suitable cmake found @@ -27,6 +30,11 @@ version="$(${cmake} --version \ major="${version%.*}" minor="${version#*.}" +if [ "${version}" = "${blacklist_version}" ]; then + # echo nothing: no suitable cmake found + exit 1 +fi + if [ ${major} -gt ${major_min} ]; then echo "${cmake}" else diff --git a/support/dependencies/check-host-lzip.mk b/support/dependencies/check-host-lzip.mk new file mode 100644 index 0000000000..6acfdc6dfa --- /dev/null +++ b/support/dependencies/check-host-lzip.mk @@ -0,0 +1,5 @@ +ifeq (,$(call suitable-host-package,lzip,$(LZCAT))) +DEPENDENCIES_HOST_PREREQ += host-lzip +EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .lz +LZCAT = $(HOST_DIR)/usr/bin/lzip -d -c +endif diff --git a/support/dependencies/check-host-lzip.sh b/support/dependencies/check-host-lzip.sh new file mode 100755 index 0000000000..4f8a2ba3de --- /dev/null +++ b/support/dependencies/check-host-lzip.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +candidate="$1" + +lzip=`which $candidate 2>/dev/null` +if [ ! -x "$lzip" ]; then + lzip=`which lzip 2>/dev/null` + if [ ! -x "$lzip" ]; then + # echo nothing: no suitable lzip found + exit 1 + fi +fi + +echo $lzip diff --git a/support/dependencies/check-host-xzcat.mk b/support/dependencies/check-host-xzcat.mk index 5e08b6e886..c6d9eebe4d 100644 --- a/support/dependencies/check-host-xzcat.mk +++ b/support/dependencies/check-host-xzcat.mk @@ -3,5 +3,6 @@ ifeq (,$(call suitable-host-package,xzcat,$(XZCAT))) DEPENDENCIES_HOST_PREREQ += host-xz +EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .xz .lzma XZCAT = $(HOST_DIR)/usr/bin/xzcat endif diff --git a/support/misc/Vagrantfile b/support/misc/Vagrantfile index dc4c15d51e..33ca6b802a 100644 --- a/support/misc/Vagrantfile +++ b/support/misc/Vagrantfile @@ -5,7 +5,7 @@ ################################################################################ # Buildroot version to use -RELEASE='2016.11.2' +RELEASE='2017.02' ### Change here for more memory/cores ### VM_MEMORY=2048 @@ -41,19 +41,20 @@ Vagrant.configure('2') do |config| end end - config.vm.provision 'shell', inline: - "sudo dpkg --add-architecture i386 - sudo apt-get -q update - sudo apt-get purge -q -y snapd lxcfs lxd ubuntu-core-launcher snap-confine - sudo apt-get -q -y upgrade - sudo apt-get -q -y install build-essential libncurses5-dev \ + config.vm.provision 'shell', privileged: true, inline: + "sed -i 's|deb http://us.archive.ubuntu.com/ubuntu/|deb mirror://mirrors.ubuntu.com/mirrors.txt|g' /etc/apt/sources.list + dpkg --add-architecture i386 + apt-get -q update + apt-get purge -q -y snapd lxcfs lxd ubuntu-core-launcher snap-confine + apt-get -q -y install build-essential libncurses5-dev \ git bzr cvs mercurial subversion libc6:i386 unzip bc - sudo apt-get -q -y autoremove - sudo apt-get -q -y clean - sudo update-locale LC_ALL=C" + apt-get -q -y autoremove + apt-get -q -y clean + update-locale LC_ALL=C" config.vm.provision 'shell', privileged: false, inline: "echo 'Downloading and extracting buildroot #{RELEASE}' wget -q -c http://buildroot.org/downloads/buildroot-#{RELEASE}.tar.gz tar axf buildroot-#{RELEASE}.tar.gz" + end diff --git a/support/scripts/test-pkg b/support/scripts/test-pkg index b867da8bb8..a040ce1af1 100755 --- a/support/scripts/test-pkg +++ b/support/scripts/test-pkg @@ -6,11 +6,12 @@ TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-conf main() { local o O opts local cfg dir pkg random toolchain + local ret nb nb_skip nb_fail local -a toolchains o='hc:d:p:r:' O='help,config-snippet:build-dir:package:,random:' - opts="$( getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}" )" + opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")" eval set -- "${opts}" random=0 @@ -39,6 +40,9 @@ main() { if [ -z "${cfg}" ]; then printf "error: no config snippet specified\n" >&2; exit 1 fi + if [ ! -e "${cfg}" ]; then + printf "error: %s: no such file\n" "${cfg}" >&2; exit 1 + fi if [ -z "${dir}" ]; then dir="${HOME}/br-test-pkg" fi @@ -46,23 +50,34 @@ main() { # Extract the URLs of the toolchains; drop internal toolchains # E.g.: http://server/path/to/name.config,arch,libc # --> http://server/path/to/name.config - toolchains=( $( curl -s "${TOOLCHAINS_URL}" \ - |sed -r -e 's/,.*//; /internal/d;' \ - |if [ ${random} -gt 0 ]; then \ - sort -R |head -n ${random} - else - cat - fi |sort - ) + toolchains=($(curl -s "${TOOLCHAINS_URL}" \ + |sed -r -e 's/,.*//; /internal/d;' \ + |if [ ${random} -gt 0 ]; then \ + sort -R |head -n ${random} + else + cat + fi |sort + ) ) if [ ${#toolchains[@]} -eq 0 ]; then printf "error: no toolchain found (networking issue?)\n" >&2; exit 1 fi + nb=0 + nb_skip=0 + nb_fail=0 for toolchain in "${toolchains[@]}"; do - build_one "${dir}" "${toolchain}" "${cfg}" "${pkg}" + build_one "${dir}" "${toolchain}" "${cfg}" "${pkg}" && ret=0 || ret=${?} + case ${ret} in + (0) ;; + (1) : $((nb_skip++));; + (2) : $((nb_fail++));; + esac + : $((nb++)) done + + printf "%d builds, %d skipped, %d failed\n" ${nb} ${nb_skip} ${nb_fail} } build_one() { @@ -70,20 +85,19 @@ build_one() { local url="${2}" local cfg="${3}" local pkg="${4}" - local toolchain line skip + local toolchain # Using basename(1) on a URL works nicely - toolchain="$( basename "${url}" .config )" + toolchain="$(basename "${url}" .config)" printf "%40s: " "${toolchain}" dir="${dir}/${toolchain}" mkdir -p "${dir}" - printf "download config" if ! curl -s "${url}" >"${dir}/.config"; then - printf ": FAILED\n" - return + printf "FAILED\n" + return 2 fi cat >>"${dir}/.config" <<-_EOF_ @@ -94,45 +108,38 @@ build_one() { _EOF_ cat "${cfg}" >>"${dir}/.config" - printf ", olddefconfig" if ! make O="${dir}" olddefconfig >/dev/null 2>&1; then - printf ": FAILED\n" - return + printf "FAILED\n" + return 2 fi # We want all the options from the snippet to be present as-is (set # or not set) in the actual .config; if one of them is not, it means # some dependency from the toolchain or arch is not available, in # which case this config is untestable and we skip it. - skip=false - while read line; do - if ! grep "^${line}\$" "${dir}/.config" >/dev/null 2>&1; then - printf "%s\n" "${line}" - skip=true - fi - done <"${cfg}" >"${dir}/missing.config" - if ${skip}; then - printf ", SKIPPED\n" - return + # We don't care about the locale to sort in, as long as both sort are + # done in the same locale. + comm -23 <(sort "${cfg}") <(sort "${dir}/.config") >"${dir}/missing.config" + if [ -s "${dir}/missing.config" ]; then + printf "SKIPPED\n" + return 1 fi # Remove file, it's empty anyway. rm -f "${dir}/missing.config" if [ -n "${pkg}" ]; then - printf ", dirclean" if ! make O="${dir}" "${pkg}-dirclean" >> "${dir}/logfile" 2>&1; then - printf ": FAILED\n" - return + printf "FAILED\n" + return 2 fi fi - printf ", build" # shellcheck disable=SC2086 if ! make O="${dir}" ${pkg} >> "${dir}/logfile" 2>&1; then - printf ": FAILED\n" - return + printf "FAILED\n" + return 2 fi - printf ": OK\n" + printf "OK\n" } help() { |