Skip to content

Fix: complete uninstall target to remove presets and assets directories#203

Merged
sudip-mondal-2002 merged 13 commits into
sudip-mondal-2002:mainfrom
Soujanya-Mctrl:fix/makefile-uninstall-cleanup
May 26, 2026
Merged

Fix: complete uninstall target to remove presets and assets directories#203
sudip-mondal-2002 merged 13 commits into
sudip-mondal-2002:mainfrom
Soujanya-Mctrl:fix/makefile-uninstall-cleanup

Conversation

@Soujanya-Mctrl

@Soujanya-Mctrl Soujanya-Mctrl commented May 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR fixes the Makefile uninstall target so it removes the installed presets and assets directories in addition to the main executable. This keeps make uninstall aligned with what make install puts on the system.

Related Issue

Fixes #199

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor / code cleanup
  • 📝 Documentation
  • ✅ Tests
  • 🔧 Build / CI / Configuration

How Was This Tested?

  • Platform(s) tested on: Linux (Ubuntu 24.04 via Docker)
  • Ran make install and verified files were placed in /usr/local/bin/, /usr/local/share/amplitron/ and /usr/local/bin/assets/
  • Ran make uninstall and confirmed all three locations were fully cleaned up
  • Test command run: ./amplitron-tests

Checklist

  • Code compiles and builds successfully on my platform
  • All existing tests pass (./amplitron-tests)
  • New tests added for new functionality (if applicable)
  • Documentation updated (README, code comments) if applicable
  • No blocking calls on the audio thread (no std::mutex::lock() on the hot path)
  • Tested on: Linux / macOS

Summary by CodeRabbit

  • Tests

    • CI now runs platform-specific smoke tests (Linux, macOS, Windows) that install the product to a temporary location, verify the executable and its version output, then uninstall and confirm installed files are removed.
  • Build

    • Install/uninstall/run operations now respect a configurable install prefix (default: /usr/local) and use the project's canonical binary name; help text updated to document this behavior.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds a configurable PREFIX to the Makefile, updates install/uninstall/run/help to use $(PREFIX) and the capitalized Amplitron binary name, and adds CI smoke tests on Linux, macOS, and Windows that install to a temp prefix, verify the binary and version, then uninstall and assert removals.

Changes

Configurable Installation Paths and CI Validation

Layer / File(s) Summary
Makefile PREFIX variable and target updates
Makefile
Introduces PREFIX ?= /usr/local; updates install to pass --prefix $(PREFIX) to cmake/make; reworks uninstall and run to use $(PREFIX) and the capitalized Amplitron binary name; extends help to document PREFIX and its default.
CI smoke tests for install/uninstall lifecycle
.github/workflows/ci.yml
Adds install/verify/uninstall smoke-test steps on Linux, macOS, and Windows that install into a temporary prefix, assert bin/Amplitron[.exe] exists and reports Amplitron v1.0, then uninstall and verify share/amplitron and bin/assets (and executable) are removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through PREFIX fields with glee,
Installed and checked what eyes could see;
CI sniffed the binary, read its name,
Then uninstalled clean—no crumbs remain.
Tiny hops, tidy paths, a springtime spree.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Fix: complete uninstall target to remove presets and assets directories' directly describes the main change—enhancing the uninstall target to clean up directories left behind.
Linked Issues check ✅ Passed The PR addresses all requirements from issue #199: the Makefile uninstall target now removes presets and assets directories, CI smoke tests verify install/uninstall symmetry across Linux/macOS/Windows, and PREFIX variable enables configurable install paths.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue: Makefile updates for uninstall/install/run targets with PREFIX support, and CI smoke tests validating the install/uninstall behavior across platforms.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Soujanya-Mctrl

Copy link
Copy Markdown
Contributor Author

hey @sudip-mondal-2002 the PR is ready to review

@sudip-mondal-2002

Copy link
Copy Markdown
Owner

Please add a new CI that installs checks if installed via version flag
then uninstalls
and checks uninstalled correctly

@github-actions

github-actions Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Report 📊

Line Coverage: 43.5%

⚠️ Coverage is below threshold: 43.5% < 60%

Full Coverage Summary
Summary coverage rate:
  lines......: 43.5% (3336 of 7663 lines)
  functions..: 69.5% (473 of 681 functions)
  branches...: no data found

@github-actions

github-actions Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

PR Preview Removed

The GitHub Pages preview for this PR has been removed because the PR was closed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 60-67: The uninstall help text in the Makefile is out of date:
update the `@echo` line that currently reads "make uninstall - Remove installed
binary" to accurately reflect that the uninstall target removes more than just
the binary (it also removes presets and assets as implemented elsewhere in the
Makefile). Edit the help block in the Makefile (the echo lines) to say something
like "make uninstall - Remove installed binary, presets, and assets" so the
description matches the actual behavior of the uninstall target.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 30e7f915-2429-4326-a561-49d990ac9220

📥 Commits

Reviewing files that changed from the base of the PR and between 8b197e1 and 5a8a106.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • Makefile

Comment thread Makefile
Comment on lines +60 to 67
@echo " make install - Install to $(PREFIX)/bin"
@echo " make uninstall - Remove installed binary"
@echo " make run - Build and run"
@echo ""
@echo "Variables:"
@echo " BUILD_TYPE=Debug|Release (default: Release)"
@echo " PREFIX=/path/to/install (default: /usr/local)"
@echo " CMAKE_FLAGS=... (extra CMake flags)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update uninstall help text to reflect full cleanup.

Line 61 still says uninstall removes only the binary, but Lines 41-43 also remove presets/assets directories. Please align the help description with actual behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 60 - 67, The uninstall help text in the Makefile is
out of date: update the `@echo` line that currently reads "make uninstall - Remove
installed binary" to accurately reflect that the uninstall target removes more
than just the binary (it also removes presets and assets as implemented
elsewhere in the Makefile). Edit the help block in the Makefile (the echo lines)
to say something like "make uninstall - Remove installed binary, presets, and
assets" so the description matches the actual behavior of the uninstall target.

@Soujanya-Mctrl Soujanya-Mctrl force-pushed the fix/makefile-uninstall-cleanup branch from 5a8a106 to 6a1d783 Compare May 24, 2026 07:37
@Soujanya-Mctrl

Copy link
Copy Markdown
Contributor Author

@sudip-mondal-2002 I’ve added the CI smoke test to install with a version flag, verify the installed binary via --version, then uninstall and confirm the install was removed correctly.

@sudip-mondal-2002 sudip-mondal-2002 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but the smoke tests should be there for macos and windows as well, please do that change @Soujanya-Mctrl

@sudip-mondal-2002 sudip-mondal-2002 added the gssoc:approved GSSoC 2026 contribution label May 24, 2026
@Soujanya-Mctrl

Copy link
Copy Markdown
Contributor Author

@sudip-mondal-2002 I added matching macOS and Windows smoke tests to CI (ci.yml) and fixed the Windows job to use cmake --install.

@sudip-mondal-2002 sudip-mondal-2002 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +68 to +102

- name: Install Smoke Test
env:
INSTALL_PREFIX: ${{ runner.temp }}/amplitron-install
run: |
make PREFIX="$INSTALL_PREFIX" install
test -x "$INSTALL_PREFIX/bin/Amplitron"
"$INSTALL_PREFIX/bin/Amplitron" --version | grep -q "Amplitron v1.0"

- name: Uninstall Smoke Test
env:
INSTALL_PREFIX: ${{ runner.temp }}/amplitron-install
run: |
make PREFIX="$INSTALL_PREFIX" uninstall
test ! -e "$INSTALL_PREFIX/bin/Amplitron"
test ! -e "$INSTALL_PREFIX/share/amplitron"
test ! -e "$INSTALL_PREFIX/bin/assets"

- name: Install Smoke Test
env:
INSTALL_PREFIX: ${{ runner.temp }}/amplitron-install
run: |
make PREFIX="$INSTALL_PREFIX" install
test -x "$INSTALL_PREFIX/bin/Amplitron"
"$INSTALL_PREFIX/bin/Amplitron" --version | grep -q "Amplitron v1.0"

- name: Uninstall Smoke Test
env:
INSTALL_PREFIX: ${{ runner.temp }}/amplitron-install
run: |
make PREFIX="$INSTALL_PREFIX" uninstall
test ! -e "$INSTALL_PREFIX/bin/Amplitron"
test ! -e "$INSTALL_PREFIX/share/amplitron"
test ! -e "$INSTALL_PREFIX/bin/assets"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you have the tests twice in linux and never in MAC

@sudip-mondal-2002 sudip-mondal-2002 added type:bug Something isn't working good first issue Good for newcomers build level:beginner Easy task · 10 GSSoC points labels May 24, 2026
@Soujanya-Mctrl

Copy link
Copy Markdown
Contributor Author

@sudip-mondal-2002 fixed in the latest push: Linux no longer has the duplicate smoke tests, and macOS now has the install/uninstall pair.

@sudip-mondal-2002 sudip-mondal-2002 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 516-526: The CI step "Uninstall Smoke Test" currently deletes
Amplitron.exe manually; update two things: (1) change the Makefile uninstall
target (the uninstall: rule) to also remove the Windows binary (e.g., remove
$(PREFIX)/bin/Amplitron.exe or use a platform-aware removal using an $(EXEEXT)
variable) so make PREFIX="$(PREFIX)" uninstall actually removes the .exe on
Windows, and (2) modify the CI workflow "Uninstall Smoke Test" to call make
PREFIX="$INSTALL_PREFIX" uninstall instead of manually deleting files so the
uninstall path is exercised by CI; if you can't make uninstall remove the .exe,
add a brief comment in the Makefile documenting the Windows limitation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e02b432-f209-4ea0-95f8-b9677af7d8e4

📥 Commits

Reviewing files that changed from the base of the PR and between 5a8a106 and 113dab2.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml
Comment on lines +516 to +526
- name: Uninstall Smoke Test
shell: msys2 {0}
env:
INSTALL_PREFIX: ${{ runner.temp }}\amplitron-install
run: |
rm -f "$INSTALL_PREFIX/bin/Amplitron.exe"
rm -rf "$INSTALL_PREFIX/share/amplitron"
rm -rf "$INSTALL_PREFIX/bin/assets"
test ! -e "$INSTALL_PREFIX/bin/Amplitron.exe"
test ! -e "$INSTALL_PREFIX/share/amplitron"
test ! -e "$INSTALL_PREFIX/bin/assets"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if Makefile uninstall target handles Windows .exe extension

# Test: Search for .exe handling in uninstall target
rg -n -A5 -B2 'uninstall:' Makefile

# Test: Check if there's platform-specific logic for Windows
rg -n 'MINGW|Windows|\.exe' Makefile

Repository: sudip-mondal-2002/Amplitron

Length of output: 285


Windows uninstall smoke test should exercise make uninstall (and Makefile must remove Amplitron.exe)

  • The Windows uninstall smoke test (.github/workflows/ci.yml lines 516-526) manually deletes "$INSTALL_PREFIX/bin/Amplitron.exe" (and related dirs) instead of running make PREFIX="$INSTALL_PREFIX" uninstall.
  • The Makefile uninstall: target currently removes $(PREFIX)/bin/Amplitron (no .exe), so make uninstall on Windows would leave the installed Amplitron.exe behind.

Update the Makefile uninstall logic to remove $(PREFIX)/bin/Amplitron.exe on Windows (platform-specific if needed), then switch the Windows CI step to run make PREFIX="$INSTALL_PREFIX" uninstall for consistency; otherwise document the Windows limitation.

Recommended CI adjustment after fixing Makefile
       - name: Uninstall Smoke Test
         shell: msys2 {0}
         env:
           INSTALL_PREFIX: ${{ runner.temp }}\amplitron-install
         run: |
-          rm -f "$INSTALL_PREFIX/bin/Amplitron.exe"
-          rm -rf "$INSTALL_PREFIX/share/amplitron"
-          rm -rf "$INSTALL_PREFIX/bin/assets"
+          make PREFIX="$INSTALL_PREFIX" uninstall
           test ! -e "$INSTALL_PREFIX/bin/Amplitron.exe"
           test ! -e "$INSTALL_PREFIX/share/amplitron"
           test ! -e "$INSTALL_PREFIX/bin/assets"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 516 - 526, The CI step "Uninstall
Smoke Test" currently deletes Amplitron.exe manually; update two things: (1)
change the Makefile uninstall target (the uninstall: rule) to also remove the
Windows binary (e.g., remove $(PREFIX)/bin/Amplitron.exe or use a platform-aware
removal using an $(EXEEXT) variable) so make PREFIX="$(PREFIX)" uninstall
actually removes the .exe on Windows, and (2) modify the CI workflow "Uninstall
Smoke Test" to call make PREFIX="$INSTALL_PREFIX" uninstall instead of manually
deleting files so the uninstall path is exercised by CI; if you can't make
uninstall remove the .exe, add a brief comment in the Makefile documenting the
Windows limitation.

@sudip-mondal-2002 sudip-mondal-2002 merged commit f109d98 into sudip-mondal-2002:main May 26, 2026
9 checks passed
github-actions Bot added a commit that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build good first issue Good for newcomers gssoc:approved GSSoC 2026 contribution level:beginner Easy task · 10 GSSoC points mentor:sudip-mondal-2002 type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Makefile "uninstall" target is incomplete (leaves behind presets and assets)

2 participants