fix --binary-path for tracer source repo checkouts#6560
Draft
fix --binary-path for tracer source repo checkouts#6560
Conversation
When --binary-path points directly at a tracer source repo (e.g. ~/code/dd-trace-rb), the flat copy `cp -r $BINARY_PATH/* ./` spreads the repo contents across binaries/ instead of creating the named subdirectory that install_ddtrace.sh expects (e.g. binaries/dd-trace-rb/). This causes a silent fallback to installing from the public registry (rubygems, npm, PyPI, Go proxy, crates.io, GitHub) instead of the local source, with no warning. The fix detects when the basename of BINARY_PATH matches the expected repo directory name for the current library, and copies into the correct subdirectory using rsync (with symlink dereferencing and .git exclusion). When the basename does not match, the existing flat copy behavior is preserved for artifact-based workflows and staging directories. Affected libraries: Ruby, Node.js, Go, Python, Rust, C++, C++ Kong. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add warning when --binary-path basename doesn't match expected repo dir for source-based tracers (e.g. ~/code/dtr instead of ~/code/dd-trace-rb). Surfaces the silent fallback issue. - Add rsync availability check before using it. - Revert cp -rL back to cp -r in the flat-copy path to avoid an undocumented behavior change for artifact-based workflows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
Contributor
|
|
p-datadog
pushed a commit
to p-datadog/system-tests
that referenced
this pull request
Mar 20, 2026
Reverts: - 1f95bf3 selected test detection fixed - 69e93c4 terminate self more efficiently - 100a53d exit faster when nothing is collected - 848db3c use rsync instead of cp - 42f9453 use dtr These are replaced by: - DataDog#6558 (fail fast when no tests are selected) - DataDog#6560 (fix --binary-path for source repos) - DataDog#6561 (skip full wipe for --binary-path) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
p-datadog
pushed a commit
to p-datadog/system-tests
that referenced
this pull request
Mar 20, 2026
* commit 'FETCH_HEAD': fix lint: collapse multi-line if to single line fail fast when no tests are selected after collection * datadog/fix/binary-path-source-repos: address review feedback: warning, rsync check, preserve cp -r fix --binary-path for tracer source repo checkouts
|
✨ Fix all issues with BitsAI or with Cursor
|
p-datadog
pushed a commit
to p-datadog/system-tests-runner
that referenced
this pull request
Mar 20, 2026
…ource Removes the manual rsync of ~/apps/dtr into binaries/dd-trace-rb and delegates to build.sh --binary-path, which handles source repo syncing via rsync with --delete and --copy-links (DataDog/system-tests#6560, #6561). --ruby-dev is kept as a shorthand for --binary-path ~/dd-trace-rb. --binary-path is now exposed directly for other languages and non-standard paths. NOTE: build.sh detects source repos by directory basename, so the path passed to --binary-path must be named 'dd-trace-rb' for Ruby (similarly for other languages). A differently-named checkout will trigger a warning and fall back to flat copy, silently installing from rubygems.org instead. Rename or symlink your checkout accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Right now,
--binary-pathworks great for artifact-based tracers (Java jars, .NET tarballs, PHP packages) where the contents are flat files. But for libraries that support installing from a source repo checkout, it silently does the wrong thing — and that feels like it could be a real pain point for local development.Here's what happens today if you try the natural invocation:
./build.sh ruby --binary-path ~/code/dd-trace-rbbuild.shrunscp -r ~/code/dd-trace-rb/* binaries/, spreading repo contents flat acrossbinaries/. The Ruby install script checks for/binaries/dd-trace-rb(a named subdirectory), doesn't find it, and silently falls back to installing from rubygems.org instead of your local code. No warning, no error — just not testing what you think you're testing.This affects 7 libraries that expect a named subdirectory inside
binaries/:What this PR does
get_expected_repo_dir()function that maps each library to its expected source repo directory name (e.g.,ruby→dd-trace-rb)--binary-pathis used and the basename of the path matches the expected repo dir, copies intobinaries/<repo-dir>/usingrsyncwith symlink dereferencing (--copy-links) and.gitexclusion — with a check thatrsyncis availablecp -rbehavior unchanged — so artifact-based workflows and staging directories keep working exactly as beforeWhy rsync for the source repo path?
Two reasons: symlink dereferencing and
.gitexclusion. Local repos often contain symlinks (git worktrees, bundler binstubs, monorepo package links) that would be broken inside the Docker container. And.gitdirectories are large and unnecessary for the build.This is the same approach that
utils/scripts/watch.shalready uses for syncing local repos intobinaries/.How it works in practice
The documented workflow of cloning directly into
binaries/also continues to work — this just makes--binary-pathdo the right thing too.Test plan
--binary-path ~/code/dd-trace-rbcorrectly createsbinaries/dd-trace-rb/and installs from local source (Ruby)--binary-path ~/builds/java-artifactsstill does flat copy for artifact-based tracers (Java)--binary-path /tmp/stagingwhere staging containsdd-trace-rb/.gitdirectory is excluded from the copyGenerated with Claude Code