aboutsummaryrefslogtreecommitdiff
path: root/tcwg-binutils-docker.yaml
blob: 0adfc151af65b66bd617de3b38b13aac47647e10 (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
- job:
    name: tcwg-binutils-docker
    project-type: matrix
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 30
    parameters:
        - string:
            name: binutils_rev
            default: 'refs/remotes/origin/master'
            description: 'binutils revision to build'
        - string:
            name: target_list
            default: 'aarch64-linux-gnu aarch64_be-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'
            description: 'List of targets to test'
        - string:
            name: container_type
            default: 'docker'
            description: 'Type of container to use: docker, schroot, none'
    disabled: false
    node: tcwg-x86_64-cam
    retry-count: 3
    concurrent: true
    display-name: 'TCWG ZZZ Binutils Docker'
    scm:
        - git:
            url: https://git-us.linaro.org/toolchain/binutils-gdb.git
            refspec: +refs/heads/master:refs/remotes/origin/master
            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: host_arch
            values:
                - i386
                - amd64
        - axis:
            type: dynamic
            name: target
            values:
                - target_list
    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

            rm -rf container-scripts
            git clone http://git.linaro.org/people/christophe.lyon/container-scripts.git

            ./container-scripts/start-container-${container_type}.sh ${host_arch} trusty > container.sh

            # Define session_host and session_port, install trap
            . ./container.sh

            ${CONTAINER} 'echo "Build session is up; ulimit config:"; ulimit -a'

            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)
            echo label=${label}
            echo target=${target}
            echo bfd=${bfd}
            echo host=`hostname`
            uname -a
            lsb_release -a
            ${CONTAINER} 'echo host=`hostname`'
            ${CONTAINER} 'uname -a'
            ${CONTAINER} 'lsb_release -a'
            echo WORKSPACE: ${WORKSPACE}

            # 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.
            ${CONTAINER} "cd ${PWD} && ../configure $lto --enable-plugins --disable-gprof --disable-gdb --disable-sim --disable-libdecnumber --disable-readline --prefix=`pwd`/install --target $target ${bfd}"
            ${CONTAINER} "cd ${PWD} && make all -j$jobs"
            ${CONTAINER} "cd ${PWD} && make check -j$jobs -k" || result=1

            # For the moment, only build gdb (do not run the tests).
            # Do this in a different subdir.
            # GDB is no longer supported on arm-vxworks
            case ${target} in
              arm-vxworks) ;;
              *)
                ${CONTAINER} "cd ${PWD} && mkdir build-gdb && cd build-gdb && ../../configure --with-gnu-ld --enable-plugins --enable-tui --disable-gas --disable-binutils --disable-ld --disable-gold --disable-gprof --target=${target} ${bfd}"
                ${CONTAINER} "cd ${PWD} && cd build-gdb && make all -j$jobs"
                ;;
            esac

            sums=`find . -name "*.sum"`
            set +x
            echo '############################################'
            echo 'See unexpected results below:'
            echo '############################################'
            [ x"$sums" != x ] && egrep '^FAIL:|^XPASS:' $sums || true
            echo '############################################'
            echo 'See ends of sumfiles below:'
            echo '############################################'
            [ x"$sums" != x ] && tail $sums

            echo BUILD FINISHED $(date)

            # Cleanup to save disk space
            cd ..
            du -sh build-$target
            rm -rf build-$target || true

            exit $result
    publishers:
        - email-ext:
            recipients: 'christophe.lyon@linaro.org'
            matrix-trigger: only-parent