Conversation
Eliminated fragile "parasite pattern" that relied on cpp-library/cpp-application plugins. These plugins had version parsing issues with newer compilers and JNI header detection problems. Created custom SimpleCppCompile/SimpleLinkShared/SimpleLinkExecutable task types that: - Directly invoke compilers without version string parsing - Explicitly specify JNI include paths from JAVA_HOME - Support parallel compilation for faster builds - Maintain all existing build configurations (release/debug/asan/tsan/fuzzer) Migrated modules: - ddprof-lib: Main profiler library - ddprof-lib/gtest: C++ unit tests - ddprof-lib/fuzz: Fuzzer targets - ddprof-lib/benchmarks: Benchmark executable - malloc-shim: Memory interceptor Code reduction: ~530 lines removed (parasite pattern, task disabling workarounds) Code addition: ~600 lines in buildSrc (clean, maintainable task types) Verified: assembleDebug, gtestDebug (127 tests passed), benchmarks build successful 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Based on code review feedback: Error Handling Improvements: - SimpleCppCompile: Capture and display compiler stderr/stdout on compilation failure - SimpleLinkShared/SimpleLinkExecutable: Capture and display linker stderr/stdout on link failure - SimpleCppCompile: Support .c and .cc extensions in addition to .cpp Task Naming Consistency: - Fixed hardcoded task names in ddprof-lib/build.gradle helper functions - Now uses config.name for extractDebugLib*, addDebugLinkLib*, copy*DebugFiles tasks Documentation: - Updated CLAUDE.md to reflect Google Test compilation via Gradle tasks (not CMake) - Added note about parallelJobs property using default ForkJoinPool 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Compiler and linker diagnostics may appear on stdout or stderr. Capturing both ensures complete error information when builds fail. Changes: - SimpleCppCompile: Capture and display both stdout+stderr on compilation failure - SimpleLinkShared: Capture and display both stdout+stderr on link failure - SimpleLinkExecutable: Capture and display both stdout+stderr on link failure - Updated javadoc example to show .c/.cc/.cpp extension support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create SourceSet for per-directory compiler flags - Create CppBuildExtension with LogLevel and ErrorHandlingMode enums - Enhance SimpleCppCompile with source sets, logging, and error handling - Enhance SimpleLinkShared with symbol management and debug extraction - Enhance SimpleLinkExecutable with library conveniences and verification - Update CLAUDE.md with configuration examples All properties are optional with backward-compatible defaults. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Extracts C++ build support functionality into two reusable Gradle plugins for better code organization and reusability across projects: GtestPlugin: - Automatic test discovery and task creation for Google Test - Platform-aware configuration (Linux/macOS) - Integration with SimpleCppCompile/SimpleLinkExecutable tasks - Per-config (debug/release/asan/tsan) and master aggregation tasks DebugSymbolsPlugin: - Automated debug symbol extraction from release builds - Platform-specific workflows (objcopy/strip on Linux, dsymutil/strip on macOS) - Reduces production binary size ~80% (6.1MB → 1.2MB) - Maintains separate debug files for symbolication Changes: - Created GtestExtension/GtestPlugin with comprehensive configuration DSL - Created DebugSymbolsExtension/DebugSymbolsPlugin with helper method pattern - Applied both plugins to ddprof-lib/build.gradle - Removed 183 lines of legacy debug extraction code - Removed ddprof-lib/gtest module (replaced by plugin) - Updated ddprof-test to reference plugin tasks - Added comprehensive documentation (README_GTEST_PLUGIN.md, README_DEBUG_SYMBOLS_PLUGIN.md) - Updated CLAUDE.md with plugin usage examples Benefits: - Cleaner project structure (removed gtest module) - Reusable across malloc-shim and future C++ projects - Declarative configuration with sensible defaults - Consistent build patterns across projects 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Update librarySourcePath to match plugin's build/lib/main/ structure - Add consumable configurations for inter-project dependencies - Enables ddprof-test to depend on specific build configurations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…nted Release builds now use unstripped libraries temporarily. Debug symbol extraction will be re-added as an incremental feature. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Implement extractDebugInfo in NativeLinkTask * Linux: objcopy extracts symbols, adds GNU debuglink * macOS: dsymutil creates .dSYM bundle - Enable extraction and stripping for release builds - Add -g flag to macOS release builds - Exclude debug symbols from production JARs Results: - Stripped library: 404KB (69% smaller than 1.3MB debug) - Debug symbols: 3.7MB dSYM bundle (separate) - Release JAR: 183KB (down from 1.6MB with symbols) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Ensure all copy tasks depend on their corresponding link tasks, not just release. Prevents copyDebugLibs from failing when library directory doesn't exist yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Document the native build plugin architecture, usage, configurations, and debug symbol extraction process. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replace deprecated capitalize() with replaceFirstChar { it.titlecase() }
- Fix Linux version script to use single local section (valid syntax)
- Improve JAVA_HOME error message clarity
- Document macOS symbol export wildcard limitation
- Fix FAIL_FAST mode to properly terminate on first error
- Remove unused import
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Enables automatic detection of clang++ or g++ with explicit override support, fixing sanitizer builds on clang-only systems. - Auto-detect clang++ or g++ (prefers clang++) - Support -Pnative.forceCompiler=<compiler> for explicit control - Fix sanitizer detection on clang-only systems (macOS with Xcode) - Add macOS wildcard warning for symbol exports - Improve error messages when no compiler found 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove Groovy buildSrc (GtestPlugin, DebugSymbolsPlugin, SimpleCpp*) - Add Kotlin GtestPlugin to build-logic with NativeBuildPlugin integration - Migrate malloc-shim, fuzz, benchmarks to Kotlin DSL - Update documentation to reflect final architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use #ifdef M_ARENA_MAX instead of #ifndef __musl__ for portability - Add parentheses around assignments in while conditions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
musl libc doesn't define __musl__ by default, so the build system now detects musl and passes -D__musl__ to the compiler. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
a3f122d to
a33f974
Compare
CLAUDE.md is now generated locally by Claude via bootstrap instructions in AGENTS.md. This prevents accidental overwrites. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||
Comprehensive quick-start documentation for native build plugins covering: - Common workflows (debug, sanitizers, release, scan-build) - How-to guides for configuration and customization - Tips and tricks for performance, debugging, testing, and static analysis - CI/CD integration examples - Platform-specific setup instructions - Troubleshooting common issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add prominent link to QUICKSTART.md at top of README and Documentation section at bottom. Include scanbuild plugin in file listing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
CI Test ResultsRun: #21753376434 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Failed Testsglibc-amd64/debug / 25-graalJob: View logs No detailed failure information available. Check the job logs. Summary: Total: 40 | Passed: 39 | Failed: 1 Updated: 2026-02-06 15:13:27 UTC |
JDK versions as rows, platforms as columns (fewer platforms). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rkennke
left a comment
There was a problem hiding this comment.
So wait a minute...
Without having looked at much of the changes (which seems many):
- Now I need to learn Kotlin, in addition to Groovy, for the build system?
- How does it improve IDE support? I don't think my IDE (CLion) deals very well with Gradle, let alone Gradle with Kotlin stuff? (Although, it might actually like the Kotlin parts, CLion comes from the same company that invented Kotlin, after all).
|
@rkennke There is no Groovy left. And we want to use the plugins because it simplifies the actual build files significantly :( Eg. to completely setup the native build you just need to do No fancy gradle magic stealing configurations from other tasks etc. I am planning to progressively move the logic that is not strictly related to configuring the build up to the plugins so the only thing you would need to do to maintain the build would be pretty small and declarative. And, last but not least, dd-trace-java is also moving to Kotlin and since we cooperate with that project we need to be at least aware of the Kotlin syntax (but the codegen tools can take a brunt - the AGENTS.md is set up in a way that it should help with the build maintenance)
Well, IntelliJ seems to be a lot snappier with this new config. Also, the build feels like starting faster ... |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
There are a few changes in os_linux.cpp - are they related? Otherwise you might want to clean those up. |
Summary
Migrates the native build system from
buildSrcto a Gradle composite build (build-logic/) with modern Kotlin DSL plugins. This provides better IDE support, faster incremental builds, and a cleaner architecture.Key changes:
buildSrc/withbuild-logic/conventions/composite build.gradle→.gradle.kts)NativeBuildPlugin,GtestPlugin,ScanBuildPlugin-D__musl__compiler flagbuild-logic/README.mdandQUICKSTART.mdAGENTS.mdfor AI coding assistantsBuild system improvements:
Test plan
testDebug)gtestDebug)# Local testing ./gradlew buildDebug ./gradlew testDebug ./gradlew gtestDebug🤖 Generated with Claude Code