Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle demangling OSX names with underscore prefix #924

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

alk
Copy link
Contributor

@alk alk commented Jan 23, 2025

See discussion at #477 (comment)

// OSX has all the symbols prefixed with extra '_' so lets try
// once more without it
if strings.HasPrefix(fn.SystemName, "_") {
if demangled := demangle.Filter(fn.SystemName[1:], o...); demangled != fn.SystemName {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we just pass strings.StripPrefix(fn.SystemName, "_"), ... in the demangle.Filter call above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Above? So just cut all the time no matter OS and everything? Then it won't work, since _ is usually used for mangled names for regular OS-es. And cutting it will simply break everything.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, got it.

Can we add a test that will exercise this code path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. Added test case.

@alk alk force-pushed the osx-un-underscore branch from 7dd4dbb to 85c67d0 Compare January 24, 2025 01:36
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.96%. Comparing base (0ed6a68) to head (85c67d0).
Report is 62 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #924      +/-   ##
==========================================
+ Coverage   66.86%   66.96%   +0.09%     
==========================================
  Files          44       44              
  Lines        9824     9864      +40     
==========================================
+ Hits         6569     6605      +36     
- Misses       2794     2820      +26     
+ Partials      461      439      -22     

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

@alk
Copy link
Contributor Author

alk commented Jan 24, 2025

The failure looks like a flake. The failed test looks unrelated to my change. But do let me know if I am mistaken. And if there is anything I can do to help.

@aalexand
Copy link
Collaborator

The failure looks like a flake. The failed test looks unrelated to my change. But do let me know if I am mistaken. And if there is anything I can do to help.

Right, it's a known recent flaky error, I filed #925 to track it. I restarted the failed test.

@alk
Copy link
Contributor Author

alk commented Jan 25, 2025

Thanks. Test passed now. So what happens next ?

@aalexand aalexand merged commit 7fdb3d7 into google:main Jan 25, 2025
49 checks passed
@aalexand
Copy link
Collaborator

merged

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