From 91dc8457ae8e9b188c8fe613be5b3aa2e86be276 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 22 Aug 2023 11:16:58 -0700 Subject: [PATCH] Revert Qt MOC hacks (#29528) * Revert "CI: prevent moc from running in cache population step (#29401)" This reverts commit d1aedccfbe3cb880ad54adea578f91c04857d81b. * Revert "SCons: respect cache read only (#29437)" This reverts commit 59abb469ea4a8443ea07a0638acbc6ece0c9ddd2. * don't change moc path --- .github/workflows/selfdrive_tests.yaml | 8 +++++--- .gitignore | 1 - SConstruct | 13 ------------- release/clean-cache.sh | 16 ---------------- tools/cabana/SConscript | 2 -- 5 files changed, 5 insertions(+), 35 deletions(-) delete mode 100755 release/clean-cache.sh diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 143f831995..991ce74ca9 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -82,8 +82,9 @@ jobs: run: ${{ env.RUN }} "scons -j$(nproc) --extras && release/check-dirty.sh" - name: Cleanup scons cache and rebuild timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 2 || 30) }} # allow more time when we missed the scons cache - if: github.ref == 'refs/heads/master' - run: ${{ env.RUN }} "release/clean-cache.sh" + run: | + ${{ env.RUN }} "rm -rf /tmp/scons_cache/* && \ + scons -j$(nproc) --cache-populate" - name: Save scons cache uses: actions/cache/save@v3 if: github.ref == 'refs/heads/master' @@ -158,8 +159,9 @@ jobs: - name: Pre Cache - Cleanup scons cache if: github.ref == 'refs/heads/master' run: | + rm -rf /tmp/scons_cache/* eval "$(pyenv init --path)" - poetry run release/clean-cache.sh + poetry run scons -j$(nproc) --cache-populate - name: Save scons cache id: scons-save-cache uses: actions/cache/save@v3 diff --git a/.gitignore b/.gitignore index 004c0a6441..a7c8c1c6f0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ venv/ .tags .ipynb_checkpoints .idea -.moc_files .overlay_init .overlay_consistent .sconsign.dblite diff --git a/SConstruct b/SConstruct index e384e31d94..0f720fcba7 100644 --- a/SConstruct +++ b/SConstruct @@ -1,5 +1,4 @@ import os -import shutil import subprocess import sys import sysconfig @@ -336,18 +335,6 @@ qt_env['CXXFLAGS'] += qt_flags qt_env['LIBPATH'] += ['#selfdrive/ui'] qt_env['LIBS'] = qt_libs -# Have to respect cache-readonly -if GetOption('cache_readonly'): - local_moc_files_dir = Dir("#.moc_files").abspath - cache_moc_files_dir = cache_dir + "/moc_files" - if os.path.exists(local_moc_files_dir): - shutil.rmtree(local_moc_files_dir) - if os.path.exists(cache_moc_files_dir): - shutil.copytree(cache_moc_files_dir, local_moc_files_dir) - qt_env['QT3_MOCHPREFIX'] = local_moc_files_dir + "/moc_" -else: - qt_env['QT3_MOCHPREFIX'] = cache_dir + '/moc_files/moc_' - if GetOption("clazy"): checks = [ "level0", diff --git a/release/clean-cache.sh b/release/clean-cache.sh deleted file mode 100755 index ec63ee95b1..0000000000 --- a/release/clean-cache.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -set -e - -# delete outdated moc files -scons --dry-run --taskmastertrace /tmp/tasktrace.log >/dev/null -MOC_EXISTING_PROD="$(find /tmp/scons_cache/moc_files -type f | sort)" -MOC_CURRENT_PROD="$(egrep -o "'[^']*moc_files[^']*'" /tmp/tasktrace.log | sed "s/'//g" | sort | uniq)" -MOC_JUNK="$(comm -23 <(echo "$MOC_EXISTING_PROD") <(echo "$MOC_CURRENT_PROD"))" -echo "$MOC_JUNK" | xargs -I{} rm {} -rm /tmp/tasktrace.log - -# delete cache except for moc files -rm -rf $(find /tmp/scons_cache -maxdepth 1 ! -name moc_files ! -name scons_cache) - -# repopulate cache -scons --dry-run --cache-populate >/dev/null diff --git a/tools/cabana/SConscript b/tools/cabana/SConscript index cdc809f2b4..c6b47630ef 100644 --- a/tools/cabana/SConscript +++ b/tools/cabana/SConscript @@ -27,8 +27,6 @@ assets_src = "assets/assets.qrc" cabana_env.Command(assets, assets_src, f"rcc $SOURCES -o $TARGET") cabana_env.Depends(assets, Glob('/assets/*', exclude=[assets, assets_src, "assets/assets.o"])) -prev_moc_path = cabana_env['QT3_MOCHPREFIX'] -cabana_env['QT3_MOCHPREFIX'] = os.path.dirname(prev_moc_path) + '/cabana/moc_' cabana_lib = cabana_env.Library("cabana_lib", ['mainwin.cc', 'streams/pandastream.cc', 'streams/devicestream.cc', 'streams/livestream.cc', 'streams/abstractstream.cc', 'streams/replaystream.cc', 'binaryview.cc', 'historylog.cc', 'videowidget.cc', 'signalview.cc', 'dbc/dbc.cc', 'dbc/dbcfile.cc', 'dbc/dbcmanager.cc', 'chart/chartswidget.cc', 'chart/chart.cc', 'chart/signalselector.cc', 'chart/tiplabel.cc', 'chart/sparkline.cc',