File tree 3 files changed +49
-0
lines changed
src/ci/docker/x86_64-gnu-tools
3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
17
17
COPY scripts/sccache.sh /scripts/
18
18
RUN sh /scripts/sccache.sh
19
19
20
+ COPY x86_64-gnu-tools/checkregression.py /tmp/
20
21
COPY x86_64-gnu-tools/checktools.sh /tmp/
21
22
COPY x86_64-gnu-tools/repo.sh /tmp/
22
23
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+
4
+ # Copyright 2018 The Rust Project Developers. See the COPYRIGHT
5
+ # file at the top-level directory of this distribution and at
6
+ # http://rust-lang.org/COPYRIGHT.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
9
+ # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
10
+ # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
11
+ # option. This file may not be copied, modified, or distributed
12
+ # except according to those terms.
13
+
14
+ import sys
15
+ import json
16
+
17
+ if __name__ == '__main__' :
18
+ os_name = sys .argv [1 ]
19
+ toolstate_file = sys .argv [2 ]
20
+ current_state = sys .argv [3 ]
21
+
22
+ with open (toolstate_file , 'r' ) as f :
23
+ toolstate = json .load (f )
24
+ with open (current_state , 'r' ) as f :
25
+ current = json .load (f )
26
+
27
+ regressed = False
28
+ for cur in current :
29
+ tool = cur ['tool' ]
30
+ state = cur [os_name ]
31
+ new_state = toolstate .get (tool , '' )
32
+ if new_state < state :
33
+ print (
34
+ 'Error: The state of "{}" has regressed from "{}" to "{}"'
35
+ .format (tool , state , new_state )
36
+ )
37
+ regressed = True
38
+
39
+ if regressed :
40
+ sys .exit (1 )
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ TOOLSTATE_FILE="$(realpath $2)"
17
17
OS=" $3 "
18
18
COMMIT=" $( git rev-parse HEAD) "
19
19
CHANGED_FILES=" $( git diff --name-status HEAD HEAD^) "
20
+ SIX_WEEK_CYCLE=" $(( ($(date +% s) / 604800 - 3 ) % 6 )) "
21
+ # ^ 1970 Jan 1st is a Thursday, and our release dates are also on Thursdays,
22
+ # thus we could divide by 604800 (7 days in seconds) directly.
20
23
21
24
touch " $TOOLSTATE_FILE "
22
25
@@ -59,6 +62,11 @@ if [ "$RUST_RELEASE_CHANNEL" = nightly -a -n "${TOOLSTATE_REPO_ACCESS_TOKEN+is_s
59
62
sed -i " 1 a\\
60
63
$COMMIT \t$( cat " $TOOLSTATE_FILE " )
61
64
" " history/$OS .tsv"
65
+ # if we are at the last week in the 6-week release cycle, reject any kind of regression.
66
+ if [ $SIX_WEEK_CYCLE -eq 5 ]; then
67
+ python2.7 " $( dirname $0 ) /checkregression.py" \
68
+ " $OS " " $TOOLSTATE_FILE " " rust-toolstate/_data/latest.json"
69
+ fi
62
70
rm -f " $MESSAGE_FILE "
63
71
exit 0
64
72
fi
You can’t perform that action at this time.
0 commit comments