view more/cronjob.sh @ 1786:0787ceb820bf draft 1.4.2

When x86-64 switched on NPTL in uClibc, distcc broke, and it turns out fully native compiles under qemu never worked due to qemu not quite emulating floating point right and confusing the perl build with zero not comparing equal to zero. As long as it's broken anyway, switch it over to musl and fix it up on that side. It's no longer worth trying to fix anything broken in uClibc, the project is dead. (I'm aware of uClibc-ng, and am treating it exactly the same way I treated the ecommstation reboot of OS/2.)
author Rob Landley <rob@landley.net>
date Fri, 11 Sep 2015 13:25:14 -0500
parents ad5303b6d35a
children
line wrap: on
line source

#!/bin/bash

# Build stable versions of all packages with current scripts.

# This gets run in the aboriginal top directory.

pull_repo()
{
  # Clone working copy

  rm -rf "packages/alt-$1-0.tar.bz2" build/packages/alt-$1
  mkdir -p build/packages/alt-$1
  pushd build/packages/alt-$1 &&
  ln -s ../../../repos/$1/.git .git &&
  git checkout -f master &&
  git pull
  popd
}

# Expire snapshots directory

SNAPSHOTS="$(find snapshots -mindepth 1 -maxdepth 1 -type d)"
COUNT=$(( $(echo "$SNAPSHOTS" | wc -l) - 30 ))
if [ "$COUNT" -gt 0 ]
then
  # Delete appropriate number of oldest entries, then dead symlinks.
  rm -rf $( echo "$SNAPSHOTS" | sort | head -n $COUNT )
  rm -rf $(find -L snapshots -type l)
fi

echo === Begin cron job

# Start a new snapshot

export SNAPSHOT_DATE=$(date +"%Y-%m-%d")
mkdir -p snapshots/$SNAPSHOT_DATE/base &&
rm snapshots/latest &&
ln -sf $SNAPSHOT_DATE snapshots/latest || exit 1

# build base repo

build_snapshot()
{
  if [ -z "$USE_ALT" ]
  then
    SNAPNAME=base
  else
    pull_repo $USE_ALT
    SNAPNAME=$USE_ALT
  fi

  echo === Building snapshot $SNAPNAME

  [ "$USE_ALT" == linux ] &&
    more/for-each-arch.sh 'more/migrate-kernel.sh $TARGET'

  # Update manifest

  ./download.sh

  # If it's unchanged, just hardlink the previous binaries instead of rebuilding

  if cmp -s snapshots/latest/$SNAPNAME/MANIFEST packages/MANIFEST
  then
    cp -rl snapshots/latest/$SNAPNAME/* snapshots/$SNAPSHOT_DATE/$SNAPNAME
    return
  fi

  # Build it

  nice -n 20 more/buildall.sh
  rm build/simple-cross-compiler-*.tar.bz2
  mv build/*.tar.bz2 build/logs build/MANIFEST snapshots/$SNAPSHOT_DATE/$SNAPNAME
}

build_snapshot base

echo === Building QEMU

# build qemu-git

QPATH=""
CPUS=$(echo /sys/devices/system/cpu/cpu[0-9]* | wc -w)
pull_repo qemu
pushd build/packages/alt-qemu
./configure --disable-werror &&
nice -n 20 make -j $CPUS 2>&1 | tee build/logs/alt-qemu.txt &&
QPATH="$(for i in *-softmmu;do echo -n $(pwd)/$i:; done)"
popd

# test all with qemu-git

[ -z "$QPATH" ] ||
  PATH="$QPATH:$PATH" more/for-each-target.sh \
    'more/smoketest.sh $TARGET | tee snapshots/$SNAPSHOT_DATE/base/logs/newqemu-smoketest-$TARGET.txt'

#USE_ALT=linux build_snapshot
#USE_ALT=uClibc build_snapshot
#USE_ALT=busybox build_snapshot