-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Change FileName to be relative to project root #1739
Conversation
@bruno-garcia this embeds the project and solution dir into the assembly that consumes Sentry. so where would i wire this in to help with #327 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! yeah, I think we need to figure out where that goes into the payload next.
@untitaker do you know about this? (see: #327)
What is the question? |
We have
We currently have the rooted path there Do we add the 'project root path' somewhere to the payload? Or do we just truncate the Should we have |
I think I found the answer:
https://develop.sentry.dev/sdk/event-payloads/stacktrace/#frame-attributes I believe today we only have the file in there. Without path. |
You're correct, you want to put the relative path into filename. That's what the python sdk does at least sorry for the slow response, i definetly replied via email but for some reason it didn't show up here |
{ | ||
public static bool TryGetProjectDirectory(Assembly assembly, out string? projectDirectory) | ||
{ | ||
projectDirectory = assembly.GetCustomAttributes<AssemblyMetadataAttribute>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this safe, and/or does this work with AOT? Like IL2CPP and net6.0-ios
for example?
Just curious if it'll at least return null
or it'll throw
<WriteCodeFragment AssemblyAttributes="@(SentryAttributes)" | ||
Language="$(Language)" | ||
OutputFile="$(SentryAttributesFilePath)"> | ||
<Output TaskParameter="OutputFile" ItemName="Compile" Condition="$(Language) != 'F#'" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Condition="$(Language) != 'F#'"
does this mean we want this for VB or a possible IronRuby or something if that's a thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason the item name for F# is CompileBefore
but for VB and c# it is Compile
.
for other languages (like IronRuby) i have not tested. do you want me to include any other languages? Currently they will be a no-op
|
||
public class AttributeReaderTests | ||
{ | ||
[Fact] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, this should run on iOS AOT'ed so we would see how it behaves there. Assuming the tests are running there following #1703
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
Thats odd. It seems to be coming up blank on Mono in CI:
But it works on my local machine, even on Mono. hmmm |
@mattjohnsonpint r u running in release mode locally? |
Testing further, it doesn't matter if debug vs release mode. It passes on all targets when run from Rider's test runner. It fails on NET461 (Mono) when run from I've seen before where I get filenames and line numbers in Rider, but that was when a debugger was attached. This is in the test runner. Whatever they are doing special, they're doing it for tests as well. |
FYI - even if I build and test (passing) in Rider, and then test without building so it's using the exact same code ( |
I figured it out.
The question is, do we want to rely on this in our tests? It won't happen at runtime for a user application. |
my vote is we exclude that test for mono |
You're correct, you want to put the relative path into filename. That's
what the python sdk does at least
…On Wed, Jun 22, 2022, 22:47 Bruno Garcia ***@***.***> wrote:
I think I found the answer:
filename
The path to the source file relative to the project root directory.
https://develop.sentry.dev/sdk/event-payloads/stacktrace/#frame-attributes
I believe today we only have the file in there. Without path.
—
Reply to this email directly, view it on GitHub
<#1739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGMPRKXSXLADNOYDLL5O53VQN3WZANCNFSM5ZPZ74ZA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
hopefully helps with #327