Don't uniq warnings and write initial build to file (#407)

* Don't uniq warnings and write initial build to file

* Don't build twice, turn ccache off by default
This commit is contained in:
Ethan Roseman 2021-08-30 01:48:23 +09:00 committed by GitHub
parent afab424519
commit 3ed6f5b382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 10 deletions

6
Jenkinsfile vendored
View File

@ -10,12 +10,12 @@ pipeline {
sh 'cp /usr/local/etc/roms/papermario.jp.z64 ver/jp/baserom.z64' sh 'cp /usr/local/etc/roms/papermario.jp.z64 ver/jp/baserom.z64'
sh 'curl -L "https://github.com/pmret/gcc-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc' sh 'curl -L "https://github.com/pmret/gcc-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
sh 'curl -L "https://github.com/pmret/binutils-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc' sh 'curl -L "https://github.com/pmret/binutils-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
sh './configure --no-ccache' sh './configure'
} }
} }
stage('Build') { stage('Build') {
steps { steps {
sh 'ninja' sh 'ninja 2>&1 | tee build_log.txt'
} }
} }
stage("Comment") { stage("Comment") {
@ -29,7 +29,7 @@ pipeline {
if (env.CHANGE_ID) { if (env.CHANGE_ID) {
def us_progress = sh(returnStdout: true, script: "python3 progress.py us --pr-comment").trim() def us_progress = sh(returnStdout: true, script: "python3 progress.py us --pr-comment").trim()
def jp_progress = sh(returnStdout: true, script: "python3 progress.py jp --pr-comment").trim() def jp_progress = sh(returnStdout: true, script: "python3 progress.py jp --pr-comment").trim()
def warnings = sh(returnStdout: true, script: "./tools/warnings_count/check_new_warnings.sh --pr-message").trim() def warnings = sh(returnStdout: true, script: "./tools/warnings_count/check_new_warnings.sh --jenkins").trim()
def comment_id = -1 def comment_id = -1
for (comment in pullRequest.comments) { for (comment in pullRequest.comments) {

View File

@ -638,7 +638,7 @@ if __name__ == "__main__":
parser.add_argument("-d", "--debug", action="store_true", help="Generate debugging information") parser.add_argument("-d", "--debug", action="store_true", help="Generate debugging information")
parser.add_argument("-n", "--non-matching", action="store_true", help="Compile nonmatching code. Combine with --debug for more detailed debug info") parser.add_argument("-n", "--non-matching", action="store_true", help="Compile nonmatching code. Combine with --debug for more detailed debug info")
parser.add_argument("-w", "--no-warn", action="store_true", help="Inhibit compiler warnings") parser.add_argument("-w", "--no-warn", action="store_true", help="Inhibit compiler warnings")
parser.add_argument("--no-ccache", action="store_true", help="Don't use ccache") parser.add_argument("--ccache", action="store_true", help="Use ccache")
args = parser.parse_args() args = parser.parse_args()
exec_shell(["make", "-C", str(ROOT / args.splat)]) exec_shell(["make", "-C", str(ROOT / args.splat)])
@ -706,7 +706,7 @@ if __name__ == "__main__":
ninja = ninja_syntax.Writer(open(str(ROOT / "build.ninja"), "w"), width=9999) ninja = ninja_syntax.Writer(open(str(ROOT / "build.ninja"), "w"), width=9999)
write_ninja_rules(ninja, args.cpp or "cpp", cppflags, cflags, not args.no_ccache) write_ninja_rules(ninja, args.cpp or "cpp", cppflags, cflags, args.ccache)
write_ninja_for_tools(ninja) write_ninja_for_tools(ninja)
skip_files = set() skip_files = set()

View File

@ -1,11 +1,29 @@
#!/bin/bash #!/bin/bash
set -e set -e
set -o pipefail
# This script can be used when you want to test locally the amount of warnings produced by your changes before doing a PR. # This script can be used when you want to test locally the amount of warnings produced by your changes before doing a PR.
pyflags=""
rebuild=false
if [[ $1 == "--jenkins" ]]
then
pyflags="--pr-message"
rebuild=false
else
rebuild=true
fi
if $rebuild
then
echo "Rebuilding to collect warnings..."
rm -rf ver/*/build/src
ninja | grep warning | sort > tools/warnings_count/warnings_new.txt
else
cat build_log.txt | grep warning | sort > tools/warnings_count/warnings_new.txt
fi
curl -L https://papermar.io/reports/warnings.txt > tools/warnings_count/warnings.txt curl -L https://papermar.io/reports/warnings.txt > tools/warnings_count/warnings.txt
rm -rf ver/*/build/src python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings.txt tools/warnings_count/warnings_new.txt $pyflags
ninja | grep warning | sort | uniq > tools/warnings_count/warnings_new.txt
python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings.txt tools/warnings_count/warnings_new.txt $@

View File

@ -4,4 +4,4 @@ set -e
# This script should only be used when we need to modify the accepted amount of warnings. # This script should only be used when we need to modify the accepted amount of warnings.
rm -rf ver/*/build/src rm -rf ver/*/build/src
ninja | grep warning | sort | uniq > tools/warnings_count/warnings.txt ninja | grep warning | sort > tools/warnings_count/warnings.txt