annotate sources/more/buildall.sh @ 852:6ecee01bffa6

Update paths and comments in cronjob.sh, rename "none" to "stable", minor cleanup to logging.
author Rob Landley <rob@landley.net>
date Thu, 15 Oct 2009 21:25:30 -0500
parents e0879d661b55
children 06f80138cb90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
610
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
2
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
3 # Build every target architecture, creating out-$ARCH.txt log files.
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
4 # If $FORK is set, build them in parallel.
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
5
669
1cf41855bb85 More error checking.
Rob Landley <rob@landley.net>
parents: 630
diff changeset
6 . sources/functions.sh || exit 1
610
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
7
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
8 [ -z "$STATIC_CROSS_COMPILER_HOST" ] && export STATIC_CROSS_COMPILER_HOST=i686
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
9 export BUILD_STATIC_NATIVE_COMPILER=1
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
10 export FAIL_QUIET=1
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
11
721
f0ede6d6c952 Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents: 718
diff changeset
12 [ -z "${ARCHES}" ] &&
722
b5c0cf2e7f61 Fix thinkos.
Rob Landley <rob@landley.net>
parents: 721
diff changeset
13 ARCHES="$(cd sources/targets/; ls | grep -v '^hw-')"
721
f0ede6d6c952 Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents: 718
diff changeset
14
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
15 [ -z "$HWARCHES" ] &&
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
16 HWARCHES="$(cd sources/targets; ls | grep '^hw-')"
717
5a3ebc77340c Teach buildall.sh to canadian cross static cross compilers with --enable-shared and uClibc++ when you set "$CROSS_COMPILERS_EH".
Rob Landley <rob@landley.net>
parents: 669
diff changeset
17
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
18 [ ! -z "$FORK" ] && QUIET=1
778
e373d2b6d0b8 Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents: 776
diff changeset
19
e373d2b6d0b8 Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents: 776
diff changeset
20 trap "killtree $$" EXIT
e373d2b6d0b8 Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents: 776
diff changeset
21
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
22 # Build the host architecture. This has to be built first so the other
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
23 # architectures can canadian cross static compilers to run on the host using
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
24 # this toolchain to link against a host version of uClibc.
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
25
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
26 # This also performs the download.sh and host-tools.sh steps, which don't
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
27 # parallelize well if many build.sh instances try to call them at once.
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
28
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
29 # If this fails, don't bother trying to build the other targets.
610
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
30
755
38534e7a4844 Largely cosmetic change.
Rob Landley <rob@landley.net>
parents: 744
diff changeset
31 blank_tempdir build
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
32 mkdir -p build/logs &&
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
33 ln -s out-"$STATIC_CROSS_COMPILER_HOST".txt build/logs/out-host.txt &&
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
34 (./build.sh 2>&1 "$STATIC_CROSS_COMPILER_HOST" || dienow) \
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
35 | tee build/logs/build-"$STATIC_CROSS_COMPILER_HOST".txt | maybe_quiet
630
0e8a887f9d8b buildall.sh should create the README file in the output directory.
Rob Landley <rob@landley.net>
parents: 610
diff changeset
36
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
37 # Build all the remaining cross compilers, possibly in parallel
717
5a3ebc77340c Teach buildall.sh to canadian cross static cross compilers with --enable-shared and uClibc++ when you set "$CROSS_COMPILERS_EH".
Rob Landley <rob@landley.net>
parents: 669
diff changeset
38
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
39 for i in ${ARCHES} ${HWARCHES}
610
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
40 do
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
41 [ "$i" != "$STATIC_CROSS_COMPILER_HOST" ] &&
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
42 maybe_fork "./build.sh $i 2>&1 | tee build/logs/build-${i}.txt | maybe_quiet"
610
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
43 done
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
44
773
2b9e8af90917 Remove wait4background, the shell has a builtin "wait" and we don't care about non-zero wait counts anymore.
Rob Landley <rob@landley.net>
parents: 769
diff changeset
45 wait
610
a47844b73616 New simple buildall.sh that's a wrapper around build.sh. (Chop out half of build-all-targets, need to make a separate script to build static toolchains.)
Rob Landley <rob@landley.net>
parents:
diff changeset
46
744
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 736
diff changeset
47 # Run smoketest.sh for each non-hw target.
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 736
diff changeset
48
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 736
diff changeset
49 for i in ${ARCHES}
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 736
diff changeset
50 do
841
4952504f5c57 Add a "sources/more" directory, move buildall and smoketest-all into it. (Stuff that build.sh doesn't wrap.)
Rob Landley <rob@landley.net>
parents: 787
diff changeset
51 maybe_fork "sources/more/smoketest.sh $i 2>&1 | tee build/logs/smoketest-$i.txt | maybe_quiet"
744
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 736
diff changeset
52 done
759adf5a0fe9 Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents: 736
diff changeset
53
773
2b9e8af90917 Remove wait4background, the shell has a builtin "wait" and we don't care about non-zero wait counts anymore.
Rob Landley <rob@landley.net>
parents: 769
diff changeset
54 wait
787
23bff7aa79eb Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
55
850
e0879d661b55 Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents: 847
diff changeset
56 # This one has to do its own forking to avoid redundantly creating hdc.sqf
e0879d661b55 Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents: 847
diff changeset
57
e0879d661b55 Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents: 847
diff changeset
58 sources/more/native-static-build.sh $i
e0879d661b55 Add native-static-build.sh to buildall.sh, and upgrade logging.
Rob Landley <rob@landley.net>
parents: 847
diff changeset
59
852
6ecee01bffa6 Update paths and comments in cronjob.sh, rename "none" to "stable", minor cleanup to logging.
Rob Landley <rob@landley.net>
parents: 850
diff changeset
60 # Create a file containing simple pass/fail results for all architectures.
6ecee01bffa6 Update paths and comments in cronjob.sh, rename "none" to "stable", minor cleanup to logging.
Rob Landley <rob@landley.net>
parents: 850
diff changeset
61
6ecee01bffa6 Update paths and comments in cronjob.sh, rename "none" to "stable", minor cleanup to logging.
Rob Landley <rob@landley.net>
parents: 850
diff changeset
62 sources/more/smoketest-all.sh --logs | tee build/logs/status.txt
6ecee01bffa6 Update paths and comments in cronjob.sh, rename "none" to "stable", minor cleanup to logging.
Rob Landley <rob@landley.net>
parents: 850
diff changeset
63
6ecee01bffa6 Update paths and comments in cronjob.sh, rename "none" to "stable", minor cleanup to logging.
Rob Landley <rob@landley.net>
parents: 850
diff changeset
64