Skip to content

logs: preserve relative path of source files#500

Merged
cataphract merged 1 commit into
masterfrom
glopes/log-relative-paths
Jun 29, 2026
Merged

logs: preserve relative path of source files#500
cataphract merged 1 commit into
masterfrom
glopes/log-relative-paths

Conversation

@cataphract

Copy link
Copy Markdown
Contributor

So we can properly link to them.

@cataphract
cataphract requested a review from a team as a code owner June 28, 2026 18:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ccb1fd7f30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/log.hpp Outdated
continue;
}
base = p + 1;
if (p[1] == 's' && p[2] == 'r' && p[3] == 'c' && p[4] == separator) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve paths that already begin with src/

In builds where __FILE__ is already repo-relative (for example after -fmacro-prefix-map or when the compiler is passed src/foo.cpp), the leading src/ has no preceding separator, so this check never recognizes it and the fallback returns only the basename (foo.cpp). That drops the relative path this helper is meant to preserve and prevents log callbacks from linking back to the source file in those builds; please also handle src/ at the start of path.

Useful? React with 👍 / 👎.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 28, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 84.78% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1f73694 | Docs | Datadog PR Page | Give us feedback!

@codecov-commenter

codecov-commenter commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.78%. Comparing base (7a17b8d) to head (dda805b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #500   +/-   ##
=======================================
  Coverage   84.78%   84.78%           
=======================================
  Files         191      191           
  Lines        9341     9341           
  Branches     4184     4184           
=======================================
  Hits         7920     7920           
  Misses        529      529           
  Partials      892      892           
Flag Coverage Δ
waf_test 84.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

Dynamic Artifact Size Comparison 📦

Artifact Previous Release This PR Difference
darwin-arm64::libddwaf.dylib 2020576 2020032 -0.02%
darwin-universal::libddwaf.dylib 4248800 4231872 -0.39%
darwin-x86_64::libddwaf.dylib 2208040 2207496 -0.02%
linux-aarch64::libddwaf.so 2388576 2385792 -0.11%
linux-armv7::libddwaf.so 2056400 2055504 -0.04%
linux-i386::libddwaf.so 2312900 2306052 -0.29%
linux-x86_64::libddwaf.so 2581376 2578080 -0.12%
windows-arm64::ddwaf.dll 6731264 6718976 -0.18%
windows-win32::ddwaf.dll 3330560 3322368 -0.24%
windows-x64::ddwaf.dll 4061184 4062208 0.02%

Static Artifact Size Comparison 📦

Artifact Previous Release This PR Difference
darwin-arm64::libddwaf.a 92531240 92525640 0.00%
darwin-arm64::libddwaf.a.stripped 4715920 4716264 0.00%
darwin-universal::libddwaf.a 186577856 186570352 0.00%
darwin-universal::libddwaf.a.stripped 10041896 10042896 0.00%
darwin-x86_64::libddwaf.a 94046568 94044664 0.00%
darwin-x86_64::libddwaf.a.stripped 5325928 5326584 0.01%
linux-aarch64::libddwaf.a 75455020 75467214 0.01%
linux-aarch64::libddwaf.a.stripped 12184592 12182450 -0.01%
linux-armv7::libddwaf.a 66674258 66686550 0.01%
linux-armv7::libddwaf.a.stripped 11189582 11189786 0.00%
linux-i386::libddwaf.a 64858564 64868390 0.01%
linux-i386::libddwaf.a.stripped 9676948 9676154 0.00%
linux-x86_64::libddwaf.a 75942542 75951242 0.01%
linux-x86_64::libddwaf.a.stripped 11985466 11985126 0.00%
windows-arm64::ddwaf.lib 16902 16902 0.00%
windows-arm64::ddwaf_static.lib 135254130 134608688 -0.47%
windows-win32::ddwaf.lib 17228 17228 0.00%
windows-win32::ddwaf_static.lib 47779818 47460174 -0.66%
windows-x64::ddwaf.lib 16902 16902 0.00%
windows-x64::ddwaf_static.lib 55616486 55237846 -0.68%

@cataphract
cataphract force-pushed the glopes/log-relative-paths branch 2 times, most recently from 7ea1f1d to dda805b Compare June 29, 2026 09:46
@estringana

Copy link
Copy Markdown
Contributor

I'm ok with the PR but what's the motivation behind?

@cataphract

cataphract commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@estringana

I'm ok with the PR but what's the motivation behind?

it's so that the file where the log call is made can be identified unambiguously. Discard the relative path to src removes needed information to e.g. automatically link to the relevant line.

@cataphract
cataphract force-pushed the glopes/log-relative-paths branch from dda805b to 1f73694 Compare June 29, 2026 13:31
@cataphract
cataphract enabled auto-merge (squash) June 29, 2026 13:47
@cataphract
cataphract merged commit 49ad074 into master Jun 29, 2026
55 of 56 checks passed
@cataphract
cataphract deleted the glopes/log-relative-paths branch June 29, 2026 13: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.

3 participants