Cleanup: Simplify and clean up test123/test123.pro
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp
- Domain
- build-system
Research direction
Start with test123/test123.pro; the issue outlines the proposed sources.pri, thirdparty.pri, deploy_macos.pri, and asan.pri split and a four-step implementation plan. First establish a clean-build baseline, then make each planned change in a separate commit, leaving Unix/Linux scoping untouched pending an answer. Done means the cleanup builds successfully and the bundle contents remain equivalent after the QMAKE_BUNDLE_DATA conversion.
Written by the indexing model from the issue text.
Description
🤖 Generated with Claude Code
Summary
Following the Windows-reference removal in #1727, test123/test123.pro was reviewed end to end. It is 830 lines, of which roughly 300 are dead (commented-out blocks, obsolete comments, no-op code) and another 200 are hand-maintained boilerplate that qmake can generate. A cleaned-up equivalent is realistically ~250 lines split across a few .pri files.
What was found
1. The copydata* machinery (biggest maintainability problem)
There are 156 occurrences of copydata in the file. Every deployed file needs four hand-edited lines in three separate places:
copydata11f2.commands = $(COPY_DIR) $$PWD/soundfx/7.short_bell.mp3 $$OUT_PWD/...
first.depends += copydata11f2
export(copydata11f2.commands)
QMAKE_EXTRA_TARGETS += copydata11f2
The names are copydata0a, 0b, 0d, 0e, 1, 1dir, 2, 3, 4s, 5, 10, 11a..11f, 11f2, 11f3, 11g, 11h, 12h, 1p, 2p, 4p, 1sk..4sk, 1tam..5tam, 1vamp..11vamp. The gaps (0c, 2b, 3p, 4-9) are where things were deleted; 11f2/11f3 are where something had to be inserted between 11f and 11g. There is no way to tell what copydata4s does without grepping.
Most of these are plain file copies into the .app bundle, which is what QMAKE_BUNDLE_DATA is for. That would replace ~120 lines with ~10, give correct dependency tracking and incremental copying, and remove every $(MKDIR) / test -d guard and every export().
2. Bugs and no-ops
| Line | Issue |
|---|---|
| 39-40 | set(CMAKE_C_STANDARD 99) / set(CMAKE_CXX_FLAGS ...) are CMake commands. qmake has no set(). Pure no-ops -- the C++ standard they claim to set is not being set. |
| 432, 541 | copydata0c.commands is commented out, but export(copydata0c.commands) and first.depends += copydata0c are live, producing an extra-target with an empty recipe. |
| 481 vs 536 | copydata10 .. copydata12h are added to first.depends and QMAKE_EXTRA_TARGETS twice. |
| 268 | QMAKE_EXTRA_TARGETS = plist uses = not +=. Works only because nothing sets it earlier. |
| 566, 569, 583-585 | sleep 2; / sleep 1; / sleep 3; / sleep 5; embedded in copy commands -- race-condition band-aids that add ~16 seconds to every build. The real fix is ordering via .depends. |
| 788 | DISTFILES += signSquareDesk.command -- that file does not exist. |
| 795 | CONFIG += c++11, while line 40 claims -std=c++17 and Qt 6 requires C++17. |
| 35-41 | ARCHDIR is assigned in both arch branches and used only in the message() on line 47. |
3. Dead architecture branches
DEFINES += M1MAC=1 is unconditional inside macx{}, and KFR links -lkfr_dsp_neon64, so the x86_64 Mac path is not buildable. Yet the file still carries:
- the
contains(QMAKE_HOST.arch, x86_64)branch (lines 35-41) - a ~100-line fully commented-out "NON-M1 MACS ONLY" block (lines 668-770): pocketsphinx, quazip, zlib, BASS
soundtouch/source/SoundTouch/cpu_detect_x86.cpp,mmx_optimized.cpp,sse_optimized.cppin SOURCES -- x86 SIMD files being compiled on arm64- commented-out
bass_audio.cpp,renderarea.cpp/.h,AppleMusicLibraryXMLReader.cppinside the SOURCES/HEADERS lists
Git history has all of this; it should be deleted rather than commented.
4. Structure
Five unrelated concerns are interleaved, and three macx{} blocks nest inside another macx{} (lines 316 -> 344, 365). Proposed split:
test123.pro # ~40 lines: QT, TARGET, CONFIG, includes of the below
sources.pri # SOURCES / HEADERS / FORMS / RESOURCES / OBJECTIVE_SOURCES
thirdparty.pri # taglib, JUCE, KFR, soundtouch, miniBPM, qpdfjs, frameworks
deploy_macos.pri # QMAKE_BUNDLE_DATA, Info.plist, codesign, installer scripts
asan.pri # the Issue #1686 block (already well-written, move as-is)
The taglib INCLUDEPATH list is currently duplicated verbatim in the Linux and macOS branches.
5. Hardcoded personal paths
These make the project unbuildable by anyone but the maintainer:
$$(HOME)/JUCEProjects/libJUCEstatic/...(three places)codesign --sign 'Apple Development: Michael Pogue (...)'- JUCE links
Builds/MacOSX/build/Debug -lJUCE_debugeven in Release builds QMAKE_MAC_SDK = macosx27.0pinned in two places
Each should become an overridable variable defaulting to the current value, e.g.:
isEmpty(JUCE_ROOT): JUCE_ROOT = $$(HOME)/JUCEProjects/libJUCEstatic
isEmpty(CODESIGN_ID): CODESIGN_ID = "Apple Development: ..."
6. Obsolete comments
Lines 380-428 are ~50 lines of troubleshooting notes referencing macOS SDK 10.14/10.15/11.1/11.3, Qt 5.15.2 build directories, and QTBUG-43015. None applies to a Qt 6 / SDK 27 build. The still-useful parts (how to bump QMAKE_MAC_SDK, the stale .qmake.stash gotcha) are worth about 5 lines.
Open question
Is the unix:!macx (Linux) path still real? It is ~25 lines of live config (JUCE static, taglib, kfr, /usr/share/juce). If Linux is dead the way Windows now is, every unix {} block can also collapse -- on macOS unix is always true, so unix {} and macx {} are currently synonyms in this file, which is actively misleading. Step 1 below leaves all Linux/unix scoping untouched pending an answer.
Implementation plan
- Delete-only pass -- commented-out blocks, obsolete comments,
set()no-ops,copydata0c, the duplicatefirst.depends,signSquareDesk.command, the x86 branch. Zero behavior change, ~300 lines removed, verifiable with a clean rebuild. - Small correctness fixes --
CONFIG += c++17,QMAKE_EXTRA_TARGETS +=forplist, variables for JUCE / codesign / SDK paths. QMAKE_BUNDLE_DATAconversion -- the real win, but the riskiest; done alone so a before/after diff of bundle contents is meaningful. Dropping thesleeps here recovers the ~16s/build..prisplit -- mechanical move, last.
Each step is a separate commit so a regression can be bisected to one kind of change.
- Dominant language
- C++
- Stars
- 14
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mpogue2/SquareDesk
-
enhancement Ready for final check
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
mpogue2/SquareDesk#1818 · 1 comment ·
-
bug Ready for final check
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mpogue2/SquareDesk#1758 · 1 comment ·
-
bug Linux only
Difficulty 1/5 Under an hour Newbie friendliness 75/100
mpogue2/SquareDesk#204 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
mpogue2/SquareDesk#172 · 4 comments ·
-
Feature: Prep for v1.3.0 releasePossibly taken @mpogue2 claimed this 1 day ago. Openenhancement Ready for final check
mpogue2/SquareDesk#1820 · 1 assignee ·
All issues in mpogue2/SquareDesk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
godotengine/godot#125035 ·
Maintainers usually reply within 1 day
-
agent:WSL bug LOW security
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mgradwohl/tasksmack#3290 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mw00/project-maya#743 ·
Maintainers usually reply within 1 day
-
ENABLE_CUTE_DSL=OFF does not compile: runPadding stub does not match its declarationPossibly taken @akhil9tiet claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
NVIDIA/TensorRT-Edge-LLM#268 · 2 comments ·
Maintainers usually reply within 3 days
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day