-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Always generate line numbers debug information #3831
Always generate line numbers debug information #3831
Conversation
b1d0a11
to
bb22447
Compare
I think this is a good default, however I would make |
bb22447
to
df3fbb3
Compare
Why? LLVM means to have the best debugability even with aggresive optimizations. This adds line numbers to backtraces, which may lead to better reports. |
Travis fails to compile specs on x86_64 linux ... while it works perfectly for me, and the error should happen on other platforms, too 😭 is the docker image outdated? |
@ysbaddaden Yes, they are outdated. @jhass used to keep them up to date. Tomorrow I'll try to create docker images based on those ones and then use them in travis. |
@ysbaddaden Actually, it seems the build is automatic. I don't know why it failed. I'll try downloading the image and checking if the |
Hmmm...
😕 |
e189db6
to
df3fbb3
Compare
I'd try to make this work without relying on Crystal 0.20.3. Maybe there was a problem with the deb package for x84-64, I don't know. But after I release 0.20.4 that should be fixed. If this can be implemented without |
I tried to add a None member manually, but it then failed horribly on all platforms on Travis. No idea what happened again. Let's skip a release. |
@ysbaddaden I'm not sure adding a |
I restarted the travis job. Let's see! |
@asterite green at last! |
@asterite merge? |
LGTM, merged. Thanks again @ysbaddaden! |
@ysbaddaden i think it would be good if --release were to imply --no-debug because the binary will be smaller. --release targets a binary that could be distributed to a client or customer, so i don't think including debug information is that useful, and reduced binary size is a plus if you are offering downloads and so on. |
If you really want to shave a few KB off your binaries, at the expense of harder to decipher crash reports, you can pass |
@ysbaddaden This PR made the compiler not be able to reuse previous compilations, ever. The main problem is that when code is inside a macro, to be able to debug it we generate a file named Now, the culprit is not this PR but the way debug info is generated for macros, which was like that before this PR. Now it's more noticeable because debug info is always on (this is something that I personally like). I'm not exactly sure how to solve this. Some ideas:
I think 3 is the easiest/fastest things to do to "fix" this (maybe even do it always, because stepping into macro code might not be very useful either), but I don't know what the general solution is. Macros are hard... One quick way to notice if the compiler reuses a previous compilation is to do |
@ysbaddaden I'll soon send a PR to "fix" this, don't worry about a solution :-) |
Great, because I really didn't have one... except maybe using a digest of the macro contents, instead of a random identifier. |
Adds a
Crystal::Debug
flags enum to select the kinds of debug information to generate, and alters the build flags:--debug
: generate all debug info;--no-debug
: don't generate any debug info.For example, when compiling the crystal compiler, I see a 12% file increase for line numbers vs 45% for the full debug info (compile units, variables, ...)
--debug
: 34MB--no-debug
: 23MB