-
Notifications
You must be signed in to change notification settings - Fork 44
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
Link error when executing 'cargo install dinghy' #3
Comments
Hi, I could not reproduce here, so it's probably not something that was broken by a third party update. Which version of Xcode and osx are you running ? do you have anything "git related" installed from brew or ports ? I'm specifically concerned about a libgit2 coming from brew. FYI, I'm running the latest version os osx and xcode, and libgit2 is not installed by neither brew nor ports. |
Hi kali, Here is my config: macOS 10.12.2 I have only ports installed, and I did install git from there to see if that would fix the issue. I uninstalled this and still running into it. Here's my git: git version 2.10.1 (Apple Git-78) Here is my active rust toolchain: stable-x86_64-apple-darwin (default) Strange! I'll keep digging to see what it could be. |
all right, first of all, be careful to perform a I thing your experiment removing PrivateFrameworks crashes earlier: you explosing because a framework is missing, while the initial git issue was later, during symbol resolution, after actual frameworks and libraries have been found. The linker will eliminate stuff that is not in use: so on an empty project, by not using anything, the linker discard everything and our missing symbol is not longer an issue. maybe we could compare a few lines from a
Let's check out your and see if we see something significantly different. |
Hi kali, I think it might have nothing to do with dinghy as I'm currently working on isolating it, and with most of dinghy gone it still happens. Looking at your cargo output, mine is also compiling the same versions, though there are some differences in the command line after accounting for path names: https://www.diffchecker.com/l5FjV3kx |
yeah. The line about libgit2-sys is actually significantly weird. On my side it's linking against a libssh2-sys that has been build by the create (i think) while yours use one from brew. I do have libssh2 installed from brew, it's "libssh2: stable 1.8.0 (bottled), HEAD". |
the switch could come from here... https://github.com/alexcrichton/git2-rs/blob/master/libgit2-sys/build.rs#L34 |
I wonder if that's cause of openssl; I had to install it with macports as that crate fails to compile for me otherwise. hmm... No luck with that env var. I'll keep digging and let you know. :) |
So after uninstalling macports and all ports and installing openssl through brew, it's working! I'll close the issue since it doesn't seem like an issue with Dinghy, and try to figure out why it wasn't working with MacPorts. |
Good! have fun discovering Rust, and feel free to reopen if needed. |
So here is the solution: Assuming: Then this will compile dinghy: The problem is that the libgit2 CMake script is picking up iconv from /usr/lib while Cargo is picking it up from /opt/local/lib. Passing that flag in the env var forces CMake to pick it up from the same place as Cargo. A better solution might be for them to both pick it up from /usr/lib, but right now I'm not sure how to do that. At least this seems to work, too. |
hey! wanna try the simulator support i just pushed ? |
It works! I suppose you didn't push it to crates.io yet? ;) |
Is all of the AMDevice* stuff needed only when running on the device? It's used for finding out the right parameters to pass to LLDB? I'm starting to really appreciate what you said in email about hacks... |
Hmm, I noticed that xcrun simctl launch... doesn't return a non-zero error code when the test fails. |
yeah the AMDevice stuff is for finding the devices on USB (or bluetooth, but i have not decided if i want to support that yet). It also the way in to get lldb running on the device, which is apparently the only way to run an app remotely (that's what ios-deploy and everybody else is doing : they reverse engineered this private apple api, I just wrote rust ffi bindings as needed). About simctl launch, I had not noticed and, well, this is not good news. It probably mean I'll have to go through some more lldb hacking. Thanks for trying, I'll keep you posted. |
Ah OK I see. Argh... I'm used to hacks on Android but I was hoping the iOS side would be more free of them. This seems worse. :S So for simctl launch there are two ways you could do it. With the LLVM route it's similar to what you're already doing except you won't need to use any AMDevice stuff:
I did run into an issue with this where a second run in the same LLVM doesn't show stdout. The second way of doing this kind of cheating, but it works, too: just read the output and check for "test result: FAILED" and return the appropriate code. ;) |
Waw, thanks for figuring this out. I'll try to get this running ASAP. I don't want to "cheat" if possible by using knowledge of whatever we are running. I would like to market dinghy as agnostic as possible (the cargo-dinghy part being really what I just need right now :) ). I also wonder which bit in the process is killing the colors. |
Me too! I noticed that too. If it helps please feel free to take anything you need from here: https://gist.github.com/learnopengles/ebf6c04180ca7d81b83e37945b1870cc I adapted it from your code + some other articles anyways. :) Right now I'm trying to figure out how to integrate all of this into Rust's own unit tests so we can have the compiler itself run the tests on the simulator. |
Hey, I gave a shot at implementing the lldb command you were mentioning but run into a problem:
Do you get the same SDK Path error at the first step ? If not where is it finding the SDK ? I might be missing some obscure bit of XCode... |
all right, just need to use xcrun. |
You needed to do xcrun lldb? Hmm interesting... that wasn't necessary for me. Everything else in that output looks the same for me. |
I think will be better to run it through The main downside of |
ok, got the simulator running. Note that the device code was also ignoring the return value, but it is now fixed. Tell me how it works for you if you want. I'll probably push an updated crate later today or tomorrow. |
Hi Mathieu, sorry, I missed the second part of your message. I'll try it out now. |
It works great! Returns 1 when it fails and 0 otherwise. |
@kali how did you make lldb work with simulators? I type
It correctly detects SDK path, but |
@beefon, it’s an issue with llvm as mentioned here: #41 (comment) |
I'm not actually able to compile and install dinghy on my local machine as the linker command fails:
It seems strange since a standalone cargo project referring just to git2 seems to compile OK. I'm not quite sure what it could be or how to fix it at this point.
Possible refs:
rust-lang/cargo#1032
ogham/exa#67
The text was updated successfully, but these errors were encountered: