-
Notifications
You must be signed in to change notification settings - Fork 261
Add cygwin support #704
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
base: master
Are you sure you want to change the base?
Add cygwin support #704
Conversation
@alexcrichton Could you review this PR? |
@workingjubilee Could you review this PR, then...? |
@ChrisDenton Could you review this PR? |
can you guys review this rp? pweaaatyyy pweeeeaaaseee with a chewwy on top 🍒🥺 |
Seems that everyone is going on holidays:( |
I'm not sure if this is the correct way to solve the problem. This will print Windows style paths, right? Is there no way to hook up implementation that other UNIXes use? |
The path style depends on the compiler. If it's cross-compiled, the path is windows style. Otherwise it's unix style. |
So where is cygwin api to get the dependency dlls' names? Here we use winapi to get the names only, not the paths. |
If you call Win32 APIs, they'll return Windows style paths for files.
I don't know Cygwin APIs, maybe @jeremyd2019 could answer that?
Ah, that wouldn't be a big deal then, just a small divergence from the Cygwin way. Can you share a backtrace from binary built for Cygwin that panics? |
I don't understand exactly what you're asking. Cygwin has dladdr which will give you a (Cygwin) path to a DLL given an address within it. I don't know of any Cygwin way to enumerate loaded modules though... It has that information, but I don't see an API to access it. We could ask Cygwin to add one, especially if there's some POSIX way to do that that they're not implementing yet. |
IIUC that's what we need. We can stick to Win32 APIs then. |
I think you're wrong there. szExePath is converted, that's the full path. szModuleName is just the name. Also, that path is then passed to
|
I didn't find dlinfo method in cygwin. I will use cygwin_conv_path since it's straightforward. It's OK to be not UTF-8 because we are using OsString. |
oops, I meant |
I'm not sure if And I even think the code of cygwin above is a little buggy, considering that a UTF-16 path with length |
I fixed the path conversion. Now the path is converted by I also updated |
An
Yeah, I see, the array in the DL_info struct is actually |
Thanks for review from @mati865 & @jeremyd2019 ! However it still needs a maintainer to review... |
There's no
OsString::from_wide
on cygwin because it is treated as unix. I chooseWideCharToMultiByte
.