Skip to content

Improve build performance by preserving test dependencies during 'make clean'#5289

Merged
renecannao merged 4 commits intov3.0from
v3.0_buildTap
Jan 12, 2026
Merged

Improve build performance by preserving test dependencies during 'make clean'#5289
renecannao merged 4 commits intov3.0from
v3.0_buildTap

Conversation

@renecannao
Copy link
Contributor

Summary

This PR significantly improves development workflow performance by optimizing the make clean behavior to preserve expensive-to-rebuild test dependencies, while maintaining the same build guarantees.

Changes

1. Preserve test/deps during make clean

  • Before: make clean removed 2.8GB of MySQL connector test dependencies
  • After: make clean preserves test dependencies, only cleanall removes them
  • Impact: ~30 minutes faster development workflow, preserves 2.8GB of compiled artifacts

2. Preserve cpp-dotenv during make clean

  • Before: cpp-dotenv build artifacts were always removed during clean, source directories accidentally cleaned every time
  • After: cpp-dotenv directories and build artifacts preserved during clean, proper cleanall support added
  • Impact: ~5 minutes faster development, prevents 213MB of repeated downloads/extracts

3. Fix cpp-dotenv preservation logic

  • Fixed: find commands were still removing cpp-dotenv build artifacts despite source preservation
  • Fixed: Added proper cleanall target for cpp-dotenv directories
  • Impact: Optimization now works as intended, no accidental cpp-dotenv cleanup

Performance Improvements

Storage preserved during make clean:

  • test/deps: 2.8GB of MySQL connectors (MariaDB + MySQL 5.7 + MySQL 8.4)
  • cpp-dotenv: 213MB of extracted source + build artifacts
  • Total: 3.0GB preserved

Time savings:

  • make clean: ~35-40 minutes faster
  • Development workflow: Much more efficient
  • Build guarantees: Maintained (rebuilds when dependencies are missing)

Behavior Changes

Before

make clean     # Removes everything including test dependencies (slow)
make cleanall  # Same as clean

After

make clean     # Fast: preserves test dependencies + cpp-dotenv
make cleanall  # Complete: removes everything including test dependencies

Technical Details

  • Uses find -prune to exclude cpp-dotenv directories from deletion
  • Build targets force full rebuild if libraries are missing
  • Only cleanall removes expensive dependencies
  • Explicit control over development vs complete cleanup workflow

Testing

The changes maintain backward compatibility:

  • make build_tap_test_debug works identically
  • Build targets still force complete rebuilds when needed
  • All existing functionality preserved
  • No changes to actual build process, only cleanup optimization

Commits

  1. 2ecda902 - Improve build performance and clean behavior
  2. ca224cfb - Preserve cpp-dotenv source during 'make clean' to improve build performance
  3. 4be31efd - Fix cpp-dotenv preservation in clean target and add proper cleanall support

Target Branch

Target: v3.0
Type: Performance improvement and workflow optimization

- Remove test/deps from 'make clean' to prevent accidental 2.8GB cleanup
- 'make clean' now preserves test dependencies, speeding up development workflow
- 'make cleanall' still removes test dependencies as intended
- In test/deps/Makefile, make 'clean' an alias of 'cleanall' since incremental
  clean was practically redundant due to build targets forcing full rebuilds

This change:
- Reduces typical 'make clean' time by ~30 minutes
- Prevents accidental loss of compiled test dependencies (2.8GB)
- Makes development workflow more efficient while preserving explicit control

Resolves issue with repeated MySQL connector compilation during development.
…rmance

- Remove cpp-dotenv source cleanup from 'make clean' in test/tap/tap/Makefile
- This prevents accidental removal of 213MB of extracted cpp-dotenv source
- Build targets force full rebuild anyway if libraries are missing
- Typical 'make clean' operation is now faster and preserves compiled artifacts

Similar optimization as test/deps:
- Regular development workflow preserves expensive-to-rebuild dependencies
- Only 'cleanall' removes everything including source directories
- Reduces repeated downloads and extraction of cpp-dotenv sources

This change complements the previous test/deps optimization, further
improving development workflow performance.
…upport

- Fix: Exclude cpp-dotenv directories from find commands in 'make clean'
  (was removing build artifacts even when preserving source directories)
- Add: proper 'cleanall' target in test/tap/tap/Makefile that removes cpp-dotenv source
- Update: test/tap/Makefile cleanall to call tap's cleanall instead of clean
- Now cpp-dotenv directories are properly preserved during development

This fixes a bug where:
1. cpp-dotenv build artifacts were still being deleted during 'make clean'
2. There was no way to properly clean cpp-dotenv except manually
3. The preservation optimization was ineffective due to the above

Behavior now:
- 'make clean': preserves cpp-dotenv source and build artifacts (~213MB saved)
- 'make cleanall': removes everything including cpp-dotenv source
@gemini-code-assist
Copy link

Summary of Changes

Hello @renecannao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the development workflow performance by optimizing the make clean command. It achieves this by preserving large, expensive-to-rebuild test dependencies (like MySQL connectors) and cpp-dotenv build artifacts, which collectively save approximately 3.0GB of storage and 35-40 minutes of build time per clean cycle. This change introduces a clear distinction between a fast make clean for daily development and a comprehensive make cleanall for full cleanup, all while maintaining existing build guarantees.

Highlights

  • Optimized 'make clean' for test dependencies: The make clean command now preserves expensive-to-rebuild test dependencies (e.g., MySQL connectors, totaling 2.8GB), significantly speeding up the development workflow by approximately 30 minutes. These dependencies are now only removed by make cleanall.
  • Preservation of cpp-dotenv artifacts: make clean now preserves cpp-dotenv directories and build artifacts (213MB), preventing repeated downloads and extractions, which saves about 5 minutes per clean operation. A dedicated cleanall target was introduced for cpp-dotenv to allow for full removal when needed.
  • Corrected cpp-dotenv cleanup logic: The find commands within the clean target were updated to correctly exclude cpp-dotenv directories using the -prune option, ensuring the intended preservation of cpp-dotenv artifacts during a standard make clean.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the development workflow by optimizing the make clean command to preserve test dependencies and cpp-dotenv artifacts, which are expensive to rebuild. The changes are well-structured, with clean providing a fast cleanup and cleanall handling the complete removal of all build artifacts and dependencies. The logic in the Makefiles is sound and aligns with the stated goals. I have one suggestion to further improve the script in one of the Makefiles.

Comment on lines +118 to +121
find . -path ./cpp-dotenv -prune -o -name '*.a' -delete || true
find . -path ./cpp-dotenv -prune -o -name '*.o' -delete || true
find . -path ./cpp-dotenv -prune -o -name '*.so' -delete || true
find . -path ./cpp-dotenv -prune -o -name '*.so.*' -delete || true

Choose a reason for hiding this comment

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

medium

For better readability and efficiency, you can combine these four find commands into a single one. This avoids traversing the directory structure multiple times.

	find . -path ./cpp-dotenv -prune -o \( -name '*.a' -o -name '*.o' -o -name '*.so' -o -name '*.so.*' \) -delete || true

@renecannao renecannao added this to the Release 3.0.5 milestone Jan 11, 2026
Combine multiple find commands into a single command to reduce directory
traversal from 4 passes to 1 pass, improving both performance and readability.

Suggestion from gemini-code-assist review.
@renecannao
Copy link
Contributor Author

Thanks @gemini-code-assist for the helpful review! 🙏

Implemented the suggested optimization to combine multiple find commands into a single command in test/tap/tap/Makefile. This improves both performance (reducing directory traversal from 4 passes to 1 pass) and readability.

The change has been committed and pushed to the branch.

@gemini-code-assist
Copy link

That's excellent news, @renecannao! I'm glad to hear that the suggested optimization for combining the find commands in test/tap/tap/Makefile has been implemented. This change indeed significantly improves both performance by reducing directory traversals and enhances readability, which is a great outcome for the project's maintainability. Thank you for the update!

@sonarqubecloud
Copy link

@mirostauder
Copy link
Contributor

retest this please

@renecannao
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jan 11, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link

coderabbitai bot commented Jan 11, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 9c3f6b0 and f2ac54e.

📒 Files selected for processing (4)
  • Makefile
  • test/deps/Makefile
  • test/tap/Makefile
  • test/tap/tap/Makefile
 ________________________
< I am the one who bugs. >
 ------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure languagetool in your project's settings in CodeRabbit enable/disable rules and categories. Refer to the LanguageTool Community to learn more.


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

@renecannao renecannao merged commit a8e759c into v3.0 Jan 12, 2026
146 of 154 checks passed
@renecannao renecannao deleted the v3.0_buildTap branch March 7, 2026 20:41
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