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

Improvements #12

Merged
merged 6 commits into from
May 11, 2019
Merged

Improvements #12

merged 6 commits into from
May 11, 2019

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Apr 14, 2019

Edit: I fixed clippy warnings too.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Apr 17, 2019

Travis is green

@bjorn3
Copy link
Contributor Author

bjorn3 commented Apr 26, 2019

Ping @philipc

@philipc
Copy link
Contributor

philipc commented Apr 26, 2019

@luser Can you review this please? I know nothing about macos.

My only comment is that I'm surprised you need to hard-code cargo-specific paths. Does lldb have similar problems finding the debug info?

@bjorn3
Copy link
Contributor Author

bjorn3 commented Apr 26, 2019

need to hard-code cargo-specific paths.

While not technically necessary it is much faster on macOS and the only way on other OSes. Spotlight sometimes only finds a new dSYM file after ~1min.

Does lldb have similar problems finding the debug info?

I dont know.

@philipc
Copy link
Contributor

philipc commented Apr 26, 2019

Can you try lldb? I assume it would take ~1min too? If not, it's worth determining how it finds the debug info.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Apr 26, 2019

Can you try lldb?

Not today.

If not, it's worth determining how it finds the debug info.

It seems to use DebugSymbols.framework: https://opensource.apple.com/source/lldb/lldb-310.2.36/www/symbols.html

@luser
Copy link
Collaborator

luser commented Apr 26, 2019

I was one version behind on stable but with cargo 1.33.0 cargo seems to put a symlink to the .dSYM file next to the binary in target/debug:

-rwxr-xr-x  2 ted  staff  278856 Apr 26 13:30 testprog
-rw-r--r--  1 ted  staff      80 Apr 26 13:30 testprog.d
lrwxr-xr-x  1 ted  staff      35 Apr 26 13:30 testprog.dSYM -> deps/testprog-642d1824751cabc2.dSYM

Given that, do you need the cargo special case? I'd rather not have such specific workarounds unless we really need them.

@luser
Copy link
Collaborator

luser commented Apr 26, 2019

Otherwise these changes look good! Sorry, I didn't mean to leave an entirely negative comment. :)

@bjorn3
Copy link
Contributor Author

bjorn3 commented Apr 26, 2019

I hadn't noticed that symlink. Is it also generated for examples? (Can't check until tomorrow)

@bjorn3
Copy link
Contributor Author

bjorn3 commented Apr 27, 2019

I can't find them for latest stable:

$ rustc -V
rustc 1.34.1 (fc50f328b 2019-04-24)
$ ls -l target/debug
total 3280
drwxr-xr-x   66 bjorn  staff     2112 27 apr 17:50 build
drwxr-xr-x  254 bjorn  staff     8128 27 apr 17:51 deps
drwxr-xr-x   17 bjorn  staff      544 27 apr 17:51 examples
drwxr-xr-x   16 bjorn  staff      512 27 apr 17:51 incremental
-rw-r--r--    1 bjorn  staff      139 20 apr 14:35 libmoria.d
-rw-r--r--    1 bjorn  staff  1671558 20 apr 16:33 libmoria.rlib
drwxr-xr-x    2 bjorn  staff       64 20 apr 14:34 native
$ ls -l target/debug/examples
total 32416
-rwxr-xr-x  2 bjorn  staff  4151148 27 apr 17:51 find-debug
-rw-r--r--  1 bjorn  staff      197 20 apr 16:43 find-debug.d
-rwxr-xr-x  1 bjorn  staff  4124732 20 apr 17:09 find_debug-1180f451572ec105
-rw-r--r--  1 bjorn  staff      234 20 apr 17:09 find_debug-1180f451572ec105.d
drwxr-xr-x  3 bjorn  staff       96 20 apr 16:09 find_debug-1180f451572ec105.dSYM
-rwxr-xr-x  1 bjorn  staff  4134980 20 apr 17:05 find_debug-4bf3593186bc08f7
-rw-r--r--  1 bjorn  staff      234 20 apr 17:05 find_debug-4bf3593186bc08f7.d
drwxr-xr-x  3 bjorn  staff       96 20 apr 16:07 find_debug-4bf3593186bc08f7.dSYM
-rw-r--r--  1 bjorn  staff      240 20 apr 16:39 find_debug-6e6b45241131a0f9.d
-rw-r--r--  1 bjorn  staff      240 20 apr 17:10 find_debug-da85f5b2be61b3bd.d
-rwxr-xr-x  2 bjorn  staff  4151148 27 apr 17:51 find_debug-f804f6c9f452f18d
-rw-r--r--  1 bjorn  staff      234 27 apr 17:51 find_debug-f804f6c9f452f18d.d
drwxr-xr-x  3 bjorn  staff       96 27 apr 17:51 find_debug-f804f6c9f452f18d.dSYM
-rw-r--r--  1 bjorn  staff        0 20 apr 16:39 libfind_debug-6e6b45241131a0f9.rmeta
-rw-r--r--  1 bjorn  staff        0 20 apr 17:10 libfind_debug-da85f5b2be61b3bd.rmeta

Maybe it regressed with latest rustc?

@philipc
Copy link
Contributor

philipc commented Apr 29, 2019

Sounds like we should be using DebugSymbols.framework too. @jrmuizel has some C code that looks simple enough.

@luser
Copy link
Collaborator

luser commented Apr 29, 2019

I looked into it but it's an undocumented private framework, so it didn't seem worthwhile. I'm 99% sure it just calls into these same Spotlight APIs under the hood anyway.

@luser
Copy link
Collaborator

luser commented Apr 29, 2019

Maybe it regressed with latest rustc?

I think this is just a difference in cargo's behavior between crate bins and example bins. I think you should open a cargo issue on this if one doesn't already exist.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Apr 29, 2019

Filled rust-lang/cargo#6889

@bjorn3
Copy link
Contributor Author

bjorn3 commented May 6, 2019

rust-lang/cargo#6889 has been fixed. Should this PR wait for it to hit stable, or merge as is and remove the cargo specific parts when the fix hits stable?

@philipc
Copy link
Contributor

philipc commented May 6, 2019

Does it work if you only look in the same directory as the executable, instead of going up to the parent and then back down to examples and deps?

@philipc
Copy link
Contributor

philipc commented May 11, 2019

This has been sitting open long enough, and it's at least an improvement so let's merge and perfect in followups.

@philipc philipc merged commit 3f5f452 into gimli-rs:master May 11, 2019
@bjorn3 bjorn3 deleted the improvements branch May 11, 2019 09:10
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.

Finding dSYM file on macOS can be very slow
3 participants