mirror of
https://github.com/zeldaret/mm.git
synced 2024-12-03 18:41:15 +00:00
Make Jenkins check if a PR will add new warnings (#150)
* warning count * update warnings * Update warnings * Use `tee` * Suggestions of zbanks * I hope this will fix it
This commit is contained in:
parent
43ccf66c48
commit
25afa196f6
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
@ -10,9 +10,24 @@ pipeline {
|
||||
sh 'cp /usr/local/etc/roms/mm.us.rev1.z64 baserom.mm.us.rev1.z64'
|
||||
}
|
||||
}
|
||||
stage('Setup') {
|
||||
steps {
|
||||
sh 'bash -c "make -j setup 2> >(tee tools/warnings_count/warnings_setup_new.txt)"'
|
||||
}
|
||||
}
|
||||
stage('Check setup warnings') {
|
||||
steps {
|
||||
sh 'python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_setup_current.txt tools/warnings_count/warnings_setup_new.txt'
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'make -j init'
|
||||
sh 'bash -c "make -j all 2> >(tee tools/warnings_count/warnings_build_new.txt)"'
|
||||
}
|
||||
}
|
||||
stage('Check build warnings') {
|
||||
steps {
|
||||
sh 'python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_build_current.txt tools/warnings_count/warnings_build_new.txt'
|
||||
}
|
||||
}
|
||||
stage('Report Progress') {
|
||||
|
3
Makefile
3
Makefile
@ -208,7 +208,8 @@ assetclean:
|
||||
$(RM) -rf build/assets
|
||||
|
||||
distclean: assetclean clean
|
||||
$(RM) -rf baserom/ asm/ distclean/
|
||||
$(RM) -rf baserom/ asm/ expected/
|
||||
$(MAKE) -C tools clean
|
||||
|
||||
## Extraction step
|
||||
setup:
|
||||
|
@ -7,7 +7,7 @@ all: $(PROGRAMS)
|
||||
|
||||
clean:
|
||||
$(RM) $(PROGRAMS)
|
||||
$(RM) ZAPD/ZAPD.out
|
||||
$(MAKE) -C ZAPD clean
|
||||
# Need to clean the above line later...
|
||||
|
||||
mkldscript_SOURCES := mkldscript.c util.c
|
||||
|
3
tools/warnings_count/.gitignore
vendored
Normal file
3
tools/warnings_count/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Generated warnings counters
|
||||
warnings_setup_new.txt
|
||||
warnings_build_new.txt
|
14
tools/warnings_count/check_new_warnings.sh
Executable file
14
tools/warnings_count/check_new_warnings.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# This script can be used when you want to test locally the amount of warnings produced by your changes before doing a PR.
|
||||
|
||||
DIR="$(dirname "$(readlink -f "$0")")"
|
||||
cd "$DIR/../.."
|
||||
|
||||
make distclean
|
||||
make -j4 setup 2> tools/warnings_count/warnings_setup_new.txt
|
||||
make -j4 all 2> tools/warnings_count/warnings_build_new.txt
|
||||
|
||||
python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_setup_current.txt tools/warnings_count/warnings_setup_new.txt
|
||||
python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_build_current.txt tools/warnings_count/warnings_build_new.txt
|
35
tools/warnings_count/compare_warnings.py
Executable file
35
tools/warnings_count/compare_warnings.py
Executable file
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
|
||||
|
||||
def countFileLines(filename: str) -> int:
|
||||
with open(filename) as f:
|
||||
return len(f.readlines())
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('currentwarnings', help="Name of file which contains the current warnings of the repo.")
|
||||
parser.add_argument('newwarnings', help="Name of file which contains the *new* warnings of the repo.")
|
||||
args = parser.parse_args()
|
||||
|
||||
currentLines = countFileLines(args.currentwarnings)
|
||||
newLines = countFileLines(args.newwarnings)
|
||||
if newLines > currentLines:
|
||||
print()
|
||||
print("There are more warnings now. Go fix them!")
|
||||
print("\tCurrent warnings: " + str(currentLines))
|
||||
print("\tNew warnings: " + str(newLines))
|
||||
print()
|
||||
print("If these warnings are needed to produce a matching build, run `tools/warnings_count/update_current_warnings.sh` and commit the updated files in `tools/warnings_count/`.")
|
||||
print()
|
||||
with open(args.newwarnings) as f:
|
||||
print("Warnings:\n\n" + f.read())
|
||||
print()
|
||||
exit(-1)
|
||||
print("There are no new warnings. Good Job!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
11
tools/warnings_count/update_current_warnings.sh
Executable file
11
tools/warnings_count/update_current_warnings.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# This script should only be used when we need to modify the accepted amount of warnings.
|
||||
|
||||
DIR="$(dirname "$(readlink -f "$0")")"
|
||||
cd "$DIR/../.."
|
||||
|
||||
make distclean
|
||||
make setup 2> tools/warnings_count/warnings_setup_current.txt
|
||||
make all 2> tools/warnings_count/warnings_build_current.txt
|
2
tools/warnings_count/warnings_build_current.txt
Normal file
2
tools/warnings_count/warnings_build_current.txt
Normal file
@ -0,0 +1,2 @@
|
||||
cc: Warning: -mips3 should not be used for ucode 32-bit compiles
|
||||
cc: Warning: -mips3 should not be used for ucode 32-bit compiles
|
38
tools/warnings_count/warnings_setup_current.txt
Normal file
38
tools/warnings_count/warnings_setup_current.txt
Normal file
@ -0,0 +1,38 @@
|
||||
Submodule 'ZAPD' (https://github.com/zeldaret/ZAPD.git) registered for path 'tools/ZAPD'
|
||||
Submodule 'tools/asm-differ' (https://github.com/simonlindholm/asm-differ.git) registered for path 'tools/asm-differ'
|
||||
Submodule 'tools/asm-processor' (https://github.com/simonlindholm/asm-processor.git) registered for path 'tools/asm-processor'
|
||||
Submodule 'tools/decomp-permuter' (https://github.com/simonlindholm/decomp-permuter) registered for path 'tools/decomp-permuter'
|
||||
Cloning into '/home/jenkins/workspace/MM_PR-150/tools/ZAPD'...
|
||||
Cloning into '/home/jenkins/workspace/MM_PR-150/tools/asm-processor'...
|
||||
Cloning into '/home/jenkins/workspace/MM_PR-150/tools/asm-differ'...
|
||||
Cloning into '/home/jenkins/workspace/MM_PR-150/tools/decomp-permuter'...
|
||||
From https://github.com/zeldaret/ZAPD
|
||||
* branch bbbbb046a54f99dcbc6cbcc765177d8b252546f0 -> FETCH_HEAD
|
||||
From https://github.com/zeldaret/ZAPD
|
||||
* branch bbbbb046a54f99dcbc6cbcc765177d8b252546f0 -> FETCH_HEAD
|
||||
From https://github.com/simonlindholm/asm-differ
|
||||
* branch 9d79eb9f539e5fa58fe63c62862661c5d9ce0d27 -> FETCH_HEAD
|
||||
From https://github.com/simonlindholm/asm-processor
|
||||
* branch f511734d56ebb152c2b0c5aab212a0fea2588513 -> FETCH_HEAD
|
||||
From https://github.com/simonlindholm/decomp-permuter
|
||||
* branch cbb41c125464c3cbe799d77fe2d661615f934720 -> FETCH_HEAD
|
||||
vtxdis.c: In function ‘parse_int’:
|
||||
vtxdis.c:41:9: warning: ‘strncpy’ specified bound 20 equals destination size [-Wstringop-truncation]
|
||||
strncpy(outnum, &num[2], 20);
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
ZAPD/ZRoom/Commands/SetStartPositionList.cpp: In function ‘void __static_initialization_and_destruction_0(int, int)’:
|
||||
ZAPD/ZRoom/Commands/SetStartPositionList.cpp:83:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
|
||||
}
|
||||
^
|
||||
ZAPD/ZRoom/Commands/SetActorList.cpp: In function ‘void __static_initialization_and_destruction_0(int, int)’:
|
||||
ZAPD/ZRoom/Commands/SetActorList.cpp:164:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
|
||||
}
|
||||
^
|
||||
ZAPD/ZRoom/Commands/SetObjectList.cpp: In function ‘void __static_initialization_and_destruction_0(int, int)’:
|
||||
ZAPD/ZRoom/Commands/SetObjectList.cpp:76:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
|
||||
}
|
||||
^
|
||||
ZAPD/ZRoom/Commands/SetTransitionActorList.cpp: In function ‘void __static_initialization_and_destruction_0(int, int)’:
|
||||
ZAPD/ZRoom/Commands/SetTransitionActorList.cpp:105:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
|
||||
}
|
||||
^
|
Loading…
Reference in New Issue
Block a user