Skip to content

Comments

Fix clean-build rule to handle .egg directories#22

Merged
mitchelllisle merged 2 commits intocopilot/fix-docker-compose-installfrom
copilot/fix-clean-build-rule
Dec 26, 2025
Merged

Fix clean-build rule to handle .egg directories#22
mitchelllisle merged 2 commits intocopilot/fix-docker-compose-installfrom
copilot/fix-clean-build-rule

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

The clean-build Makefile target fails when encountering .egg directories because rm -f only handles files.

Changes

  • Updated find . -name '*.egg' -exec rm -f {} + to use rm -rf for directory support
  • Aligns with existing pattern used for *.egg-info cleanup
 clean-build: ## remove build artifacts
 	@echo cleaning build artifacts ...
 	rm -fr build/
 	rm -fr dist/
 	rm -fr .eggs/
 	find . -name '*.egg-info' -exec rm -fr {} +
-	find . -name '*.egg' -exec rm -f {} +
+	find . -name '*.egg' -exec rm -rf {} +
Original prompt

The unit test in pull request #21 is failing due to an error in the clean-build rule within the Makefile. The current command find . -name '*.egg' -exec rm -f {} + fails for directories, resulting in the error:

rm: cannot remove './venv/lib/python3.11/site-packages/pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg': Is a directory
make[1]: *** [Makefile:17: clean-build] Error 1
make: *** [Makefile:7: clean] Error 2

Solution:

Update the Makefile to ensure that the clean-build rule can handle both files and directories by replacing the rm -f command with rm -rf. The updated clean-build rule should look like this:

clean-build:
    find . -name '*.egg-info' -exec rm -fr {} +
    find . -name '*.egg' -exec rm -rf {} +

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: mitchelllisle <18128531+mitchelllisle@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix clean-build rule in Makefile to handle directories Fix clean-build rule to handle .egg directories Dec 26, 2025
Copilot AI requested a review from mitchelllisle December 26, 2025 22:45
@mitchelllisle mitchelllisle marked this pull request as ready for review December 26, 2025 22:50
@mitchelllisle mitchelllisle merged commit d06c7d5 into copilot/fix-docker-compose-install Dec 26, 2025
2 checks passed
@mitchelllisle mitchelllisle deleted the copilot/fix-clean-build-rule branch December 26, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants