File tree Expand file tree Collapse file tree 2 files changed +27
-12
lines changed
src/ci/docker/x86_64-gnu-tools Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Original file line number Diff line number Diff line change 1818 os_name = sys .argv [1 ]
1919 toolstate_file = sys .argv [2 ]
2020 current_state = sys .argv [3 ]
21+ verb = sys .argv [4 ] # 'regressed' or 'changed'
2122
2223 with open (toolstate_file , 'r' ) as f :
2324 toolstate = json .load (f )
2930 tool = cur ['tool' ]
3031 state = cur [os_name ]
3132 new_state = toolstate .get (tool , '' )
32- if new_state < state :
33+ if verb == 'regressed' :
34+ updated = new_state < state
35+ elif verb == 'changed' :
36+ updated = new_state != state
37+ else :
38+ print ('Unknown verb {}' .format (updated ))
39+ sys .exit (2 )
40+ if updated :
3341 print (
34- 'Error: The state of "{}" has regressed from "{}" to "{}"'
35- .format (tool , state , new_state )
42+ 'The state of "{}" has {} from "{}" to "{}"'
43+ .format (tool , verb , state , new_state )
3644 )
3745 regressed = True
3846
Original file line number Diff line number Diff line change @@ -91,19 +91,26 @@ status_check() {
9191
9292status_check " submodule_changed"
9393
94- if [ " $RUST_RELEASE_CHANNEL " = nightly -a -n " ${TOOLSTATE_REPO_ACCESS_TOKEN+is_set} " ]; then
95- . " $( dirname $0 ) /repo.sh"
96- MESSAGE_FILE=$( mktemp -t msg.XXXXXX)
97- echo " ($OS CI update)" > " $MESSAGE_FILE "
98- commit_toolstate_change " $MESSAGE_FILE " \
94+ CHECK_NOT=" $( dirname $0 ) /checkregression.py"
95+ change_toolstate () {
96+ # only update the history
97+ if python2.7 " $CHECK_NOT " " $OS " " $TOOLSTATE_FILE " " _data/latest.json" changed; then
98+ echo ' Toolstate is not changed. Not updating.'
99+ else
100+ if [ $SIX_WEEK_CYCLE -eq 5 ]; then
101+ python2.7 " $CHECK_NOT " " $OS " " $TOOLSTATE_FILE " " _data/latest.json" regressed
102+ fi
99103 sed -i " 1 a\\
100104$COMMIT \t$( cat " $TOOLSTATE_FILE " )
101105" " history/$OS .tsv"
102- # if we are at the last week in the 6-week release cycle, reject any kind of regression.
103- if [ $SIX_WEEK_CYCLE -eq 5 ]; then
104- python2.7 " $( dirname $0 ) /checkregression.py" \
105- " $OS " " $TOOLSTATE_FILE " " rust-toolstate/_data/latest.json"
106106 fi
107+ }
108+
109+ if [ " $RUST_RELEASE_CHANNEL " = nightly -a -n " ${TOOLSTATE_REPO_ACCESS_TOKEN+is_set} " ]; then
110+ . " $( dirname $0 ) /repo.sh"
111+ MESSAGE_FILE=$( mktemp -t msg.XXXXXX)
112+ echo " ($OS CI update)" > " $MESSAGE_FILE "
113+ commit_toolstate_change " $MESSAGE_FILE " change_toolstate
107114 rm -f " $MESSAGE_FILE "
108115 exit 0
109116fi
You can’t perform that action at this time.
0 commit comments