aboutsummaryrefslogtreecommitdiff
path: root/tcwg-binutils-testing.yaml
blob: 6b7f366aee81da2f635acf140983dd4d02bef5dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
- job:
    name: tcwg-binutils-testing
    project-type: matrix
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
    parameters:
        - string:
            name: binutils_rev
            default: 'refs/remotes/origin/master'
            description: 'binutils revision to build'
    disabled: false
    node: tcwg-x86_64-ex40
    retry-count: 3
    concurrent: true
    display-name: 'TCWG ZZZ Binutils - testing'
    scm:
        - git:
            url: https://git-us.linaro.org/toolchain/binutils-gdb.git
            refspec: +refs/heads/*:refs/remotes/origin/*
            branches:
                - ${binutils_rev}
            skip-tag: true
            shallow-clone: false
            reference-repo: /home/tcwg-buildslave/snapshots-ref/binutils-gdb.git
            wipe-workspace: false
    axes:
        - axis:
            type: slave
            name: label
            values:
                - tcwg-x86_64-cam
        - axis:
            type: user-defined
            name: bfd
            values:
                - --enable-64-bit-bfd=no
                - --enable-64-bit-bfd=yes
        - axis:
            type: user-defined
            name: schroot_arch
            values:
                - i386
                - amd64
        - axis:
            type: user-defined
            name: target
            values:
                - aarch64-linux-gnu
                - aarch64-none-elf
                - aarch64_be-none-elf
                - arm-linux-gnueabi
                - arm-linux-gnueabihf
                - arm-netbsdelf
                - arm-none-eabi
                - arm-none-nacl
                - arm-none-symbianelf
                - arm-vxworks
                - arm-wince-pe
                - armeb-linux-gnueabihf
    wrappers:
        - timeout:
            timeout: 600
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}-${ENV,var="binutils_rev"}'
    builders:
        - shell: |
            #!/bin/bash

            set -e
            set -x

            schroot_image="tcwg-build-${schroot_arch}-trusty"

            session_id=$(schroot -b -c chroot:$schroot_image --preserve-environment)
            BUILD_SHELL="schroot -r -c session:$session_id --preserve-environment -- bash"
            $BUILD_SHELL -c "echo \"Build session is up; ulimit config:\"; ulimit -a"

            sleep 10;

            for i in /var/lib/schroot/mount/*; do echo --------------$i; /usr/lib/x86_64-linux-gnu/schroot/schroot-listmounts -m $i; done

            ${BUILD_SHELL} -c 'ls -ld /dev/pts; ls -l /dev/pts; grep pts /proc/mounts'

            ${BUILD_SHELL} -c 'set +x; while sleep 1; do grep -H . /proc/sys/kernel/pty/*; if [ ! -e /dev/pts/ptmx ]; then echo /dev/pts/ptmx went missing; ls -ld /dev/pts; ls -l /dev/pts; grep pts /proc/mounts; fi; done' &
            PTY_MON=$!

            # Sometimes /dev/pts can't get unmounted on the first try.
            # Workaround by retrying.
            trap "ls -ld /dev/pts; ls -l /dev/pts; grep pts /proc/mounts; kill $PTY_MON; schroot -f -e -c session:$session_id || { fuser -vm /var/lib/schroot/mount/$session_id/dev/pts; sleep 60 ; schroot -f -e -c session:$session_id; }" 0 1 2 3 5 9 13 15

            case $target in
                arm-wince-pe)
                    lto=
                    ;;
                *)
                    lto=--enable-lto
                    ;;
            esac

            rm -rf build-$target || true
            mkdir -p build-$target
            cd build-$target
            result=0
            jobs=$(getconf _NPROCESSORS_ONLN)
            echo BUILD STARTED $(date)

            # test that expect is working and output some debug info if not
            ${BUILD_SHELL} -c 'if ! echo "spawn true" | /usr/bin/expect -f - >/dev/null; then echo "expect cannot spawn processes. Aborting make check."; echo "some debug info follows..."; echo "running: ls -l /dev/ptmx"; ls -l /dev/ptmx; echo "running: ls -l /dev/pts"; ls -l /dev/pts; echo "running: grep devpts /proc/mounts"; grep devpts /proc/mounts; exit 1; fi'

            # If configure or build fails, the execution will stop
            # because of 'set -e'. But for 'make check' we want to
            # execute all the tests, and report if there were some
            # errors.
            ${BUILD_SHELL} -c "../configure $lto --enable-plugins --prefix=`pwd`/install --target $target ${bfd}"
            ${BUILD_SHELL} -c "make all-gas all-ld all-binutils -j$jobs"
            ${BUILD_SHELL} -c "make check-gas check-ld check-binutils -j$jobs -k" || result=1
            sums=`find . -name "*.sum"`
            [ x"$sums" != x ] && egrep '^FAIL:|^XPASS:' $sums || true
            [ x"$sums" != x ] && tail $sums

            for i in /var/lib/schroot/mount/*; do echo --------------$i; /usr/lib/x86_64-linux-gnu/schroot/schroot-listmounts -m $i; done
            echo BUILD FINISHED $(date)

            exit $result
    publishers:
        - email:
            recipients: 'christophe.lyon@linaro.org'