aboutsummaryrefslogtreecommitdiff
path: root/jdk9-build-release.yaml
blob: 82ee51e5c67bd633343d818378a07d3c959de8c1 (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
- job:
    name: jdk9-build-release
    project-type: matrix
    defaults: global
    description: |
        * Configures and builds jdk9 for release. Run after the source has passed tests.
        * Tags build with Linaro-YYMM as per normal release procedure.
        * The source tarball is copied from the jdk9-update-src-tree job.<br>
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            openjdk-members:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 10
            artifact-num-to-keep: 5
    parameters:
        - string:
            name: JDK_URL
            default: 'http://openjdk.linaro.org/releases/jdk8u-server-release-1708.tar.xz'
    disabled: true
    node: aarch64-06
    display-name: 'OpenJDK 9u - Configure and build OpenJDK 9u Release'
    axes:
        - axis:
            type: user-defined
            name: JVM_VARIANT
            values:
                - server
        - axis:
            type: user-defined
            name: BUILD_TYPE
            values:
                - release
        - axis:
            type: slave
            name: label
            values:
                - aarch64-06
    execution-strategy:
        sequential: true
    wrappers:
        - workspace-cleanup:
            dirmatch: false
        - timestamps
        - matrix-tie-parent:
            node: aarch64-06
    builders:
        - copyartifact:
            project: jdk9-update-src-tree
            filter: 'out/jdk9u.tar.gz'
            target: incoming
            flatten: true
        - copyartifact:
            project: archive-primordial-jdk8
            filter: 'out/primordial-jdk8.tar.gz'
            target: incoming
            flatten: true
        - shell: |
            #!/bin/bash

            set -exu

            #export CCACHE_DIR=~/.ccache-${JVM_VARIANT}-${BUILD_TYPE}
            #ccache -M 1G
            #ccache -s
            export JVM_VARIANT=server

            # Generate files names dependent on year/month.
            RELEASE=$(date +%y%m)
            JDKDIR=jdk9-${JVM_VARIANT}-${BUILD_TYPE}-${RELEASE}
            JDK_SRCDIR=jdk9u-src-${RELEASE}

            ccache_build_opts=--disable-ccache

            rm -rf jdk* primordial-jdk* build*

            # Download, setup JDK8 for building.
            wget --progress=dot -e dotbytes=2M ${JDK_URL}
            tar -Jxf jdk*.tar.xz

            cd jdk*/jre/lib/security/
            rm -f cacerts
            ln -s /etc/ssl/certs/java/cacerts

            cd ${WORKSPACE}/jdk*
            export JAVA_HOME=${PWD}

            export PATH=${JAVA_HOME}/bin:${PATH}

            cd ${WORKSPACE}

            # Setup archive directory
            mkdir out

            # Extract sources from upstream job
            tar xaf incoming/jdk9u.tar.gz

            mv jdk9u $JDK_SRCDIR
            # Tar up the source before sullying it with a build.
            tar --exclude=.hg\* -acf out/jdk9u-src-${RELEASE}.tar.xz $JDK_SRCDIR

            mv $JDK_SRCDIR $JDKDIR
            shopt -s nullglob

            # Configure and build
            mkdir -p build-stage1 build-stage2

            two_stage_build=0

            which java
            java -version

            if [ $two_stage_build = 1 ]; then
              pushd build-stage1
              sh ../$JDKDIR/configure --with-jvm-variants=${JVM_VARIANT} --with-debug-level=${BUILD_TYPE} --with-boot-jdk=${WORKSPACE}/primordial-jdk9 ${ccache_build_opts}
              make images
              popd

              pushd build-stage2
              sh ../$JDKDIR/configure --with-jvm-variants=${JVM_VARIANT} \
                                        --with-debug-level=${BUILD_TYPE} \
                                        --with-boot-jdk=${WORKSPACE}/build-stage1/images/jdk \
                                        ${ccache_build_opts} \
                                        --with-version-opt="Linaro-$RELEASE" \
                                        --with-version-pre="release"
              make images
              popd
            else
              pushd build-stage2
              sh ../$JDKDIR/configure --with-jvm-variants=${JVM_VARIANT} \
                                        --with-debug-level=${BUILD_TYPE} \
                                        ${ccache_build_opts} \
                                        --with-version-opt="Linaro-$RELEASE" \
                                        --with-version-pre="release"
              make images
              popd
            fi

            # Archive the result
            artifact_name=jdk9u-${JVM_VARIANT}-${BUILD_TYPE}-${RELEASE}

            # This is different from ordinary builds.
            tar -C build-stage2/images --exclude=\*.diz --transform="s!^jdk!$artifact_name!" -acf out/${artifact_name}.tar.xz jdk
    publishers:
        - archive:
            artifacts: 'out/*.tar.xz'
        - email:
            recipients: 'stuart.monteith@linaro.org fathi.boudra@linaro.org'