-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rethink supporting Windows XP #12842
Comments
I thought there were mutex and condition variable APIs that are not supported on windows XP too? |
@huonw After remove CreateSymbolicLinkW and GetFinalPathNameByHandleW, I've made rustc run in XP (it works ok). More investigation need to be done perhaps. |
Oh, really? Does it pass tests? (cc #11950 ) |
I don't know. On Windows platform (even Win7), |
|
I'll have a try. Thank you! @huonw In general, a .exe can't be start up, if it includes unsupported APIs in Import Table. Before i remove CreateSymbolicLinkW and GetFinalPathNameByHandleW from source, rustc can't be start up in XP; after removing, the new rustc runs normally. So I think, rustc doesn't require other unsupported API. Will prove it. Update: my new rustc.exe can be loaded successfully by depends.exe in XP. Yes, It has no other dependency. |
@huonw
(This is not my fault, IMO)
This is my branch: https://github.com/liigo/rust/tree/xp |
Might be an issue with UTF8 or floating point arithmetic on XP? |
@bharrisau Are you sure? I've compiled the std and its tests from source in Windows XP using my new rustc.exe. Compiled OK, most tests passed, and some tests failed (1276 passed; 41 failed; 134 ignored): (Looks like all failures are from libgreen and libnative. But I don't know why currently.)
|
I just looked at that test you failed for uses of Option.unwrap. Was trying |
Thank you!
|
@huonw: Rust doesn't expose native condition variables yet. When it does, that's another API that's missing on XP. I don't think Rust should support an operating system not receiving security updates because encouraging any continued use of it is irresponsible. I don't think we should add a further burden to working on the concurrency and I/O implementation. It's already very hard to improve because libuv defines a lowest common denominator it needs to support, and XP would be another. |
@thestinger I disagree with you. C, C++, Java, C#, Python, Ruby, Scala, and many more, all support Windows XP. |
Without knowing much about it, it doesn't look too onerous to take some functions out of the extern block and replace them with a Probably worth writing up an RFC if you want XP to be supported properly. It will end up with lots of |
@thestinger +1 |
Supporting Windows XP means Rust will need a homegrown implementation of condition variable, among other problems. It won't be possible for it to be included in the generic Windows target without performance hits because branches + bloated code aren't always acceptable. I think it's unethical to care about usage share to the point where users are encouraged to remain on an insecure platform without security updates. If Apple or Microsoft isn't providing support, then we shouldn't be providing support. It gives us a nice gradual deprecation policy where we can actually migrate to new win32 APIs, etc. but I think the more important issue is the security one. To be honest, I can't really think of a use case for an XP target beyond malware development. It's not like XP users are going to buy your products or consider open-source software. |
Lucky for the malware developers, I imagine |
I agree with @thestinger, Windows XP is about to reach the end of it's already significantly extended support lifetime, and has been without mainstream support for almost 5 years now. Bending over backwards for it is just not worth it. At the age of 13, XP is stupidly old. If there are small, unobtrusive changes you can make so rustc still works on XP, then fine, but official support doesn't make sense. We don't even list BSD as an officially supported build environment, and that's an actively-developed OS! |
I +1 the drop of XP. It is like using IE6 polyfills when doing web developement, not only you do have to include more hacks to support it but it is also making users believe they have a viable platform. Which is not the case. |
Although the experiment of making it run on XP may be fun (?) I don't think we should add official support for it (again?). @brson @alexcrichton any thoughts about this ? |
Although I personally agree that official XP support should be dropped, it may be worth asking some video game developers for their opinions. I'm not a hard core gamer, but I believe there is still a significant number of gamers that use XP due to some performance issues in Windows 7 and 8. Of course by the time Rust is actually used in a commercial game this may have changed. Rust shouldn't do anything that may alienate the video game development crowd. |
Personally, I am happy to take patches that improve compatibility with xp as long as it doesn't have a big impact on the design. Having a design that is compatible with diverse environments is good for more than just xp. The issues preventing Rust from working on xp appear minor and solvable. I don't want to 'officially' support xp though. |
@brson +1 |
@brson: Removing symlink/readlink functionality or leaving out native condition variables (as we currently do) would hurt the quality of the project elsewhere. If XP is going to be supported, it needs a separate target to use in |
Libuv has itself condition variables implementation to Support XP.
|
I don't think it's acceptable to have a hard dependency on libuv for binaries not using libgreen. It doesn't make sense to add a whole bunch of overhead to support a dead operating system... I doubt that the libuv implementation of condition variables is efficient. |
I understand the word "indefinitely" to mean that there are no plans to drop support for it, instead of "forever". Note that XP is still a very large market, and is said to have more users than desktop Linux. |
The question is - how much time. (I was going to look at Vista/XP support later this year, but since @alexcrichton works approximately 100x faster than me, it won't probably be necessary.) |
First of all: Thank you so much for fixing this! This is awesome! 👍 Is there a way to detect at compile time or at application init time whether a panic'ing API would be used? If I have an app that should run on Windows XP, I don't want to have to test every code path to make sure some unsupported API doesn't panic... Thanks in advance for your consideration! :) |
Not currently, no. |
Is this planned or possible? I think that would be crucial to be able to write code without being "really careful about which APIs to use". If I wanted to be careful, I wouldn't choose Rust ;) |
Not currently. You may want to open an issue on the RFCs repo and/or write up an RFC with details on how to do such a thing. :) |
@KostaCitrix I'm not sure I understand this joke:
Do you mean Rust is too young? |
I meant "If I wanted to be careful about which API to call in order to not panic, I wouldn't choose Rust". I want my rust to "it compiles, let's ship it" ;) |
This sounds really cool!, I'm waiting for the nightly to try out this patch. When I run my Rust program on WinXP at the moment currently I get 'the procedure entry point TryAcquireSRWLockExclusive could not be located in the dynamic link library kernel32.dll' With this patch, I'm wondering, will my program likely just panic out, or may it run. |
This will take some time to propagate into the nightlies currently. The 32-bit Windows compiler is currently still using MinGW and is unlikely to work on Windows XP (although I have not tested this). The triple I tested was tl;dr; to try out XP support you need to do this:
|
Thanks a lot! I'll give that a shot, I didn't realise it requires a separate target |
I'm a tad confused I've ended up with a rustc in the stage2 dir you mention however during compilation I got
I've tried doing
If I omit the target parameter and use
I get
|
@anfractuosity you probably won't get very far if the build doesn't complete, so I'd start out diagnosing why |
Oh wow it looks like I just totally forgot to commit the file! I'll add it in a PR I'm prepping now, but you can add define i8* @rust_try(void (i8*)* %f, i8* %env) {
call void %f(i8* %env)
ret i8* null
} |
Cheers! That works for me. In msys2 I did, just so I don't forget ;)
|
Just wondering if anyone can point me in the right direction, I can compile a simple rust program fine, but I'm getting the following error with a more complex one:
|
The MinGW target seems to work for Windows XP. Or at least
Looks like the test infrastructure already relies on condition variables for something. |
@MrAlert Was that using the latest nightly build then? Edit: I see it is, and my GTK application, works with it! Thanks a lot for your work on this Alex. |
add parentheses to [`let_and_return`]'s suggestion closes: rust-lang#12801 --- changelog: suggest adding parentheses when linting [`let_and_return`] and [`needless_return`]
I've made some investigation recently, and found that, there are only two APIs which are not supported by Windows XP, throughout the repo tree. There are:
And native::io::file::{symlink,readlink} are never used throughout the repo tree, except std::io::fs::{symlink,readlink} (which are really never used).
Do we really need including symlink/readlink functionality inside std? How other languages do?
Currently Windows XP is still wildly used in the world, especially in Asia. Its installed volume is much more than Mac OS + Linux + Unix. We give up supporting XP just because of two api absent? Maybe it's wrong.
cc #11950
update: readlink is used by rustc::metadata::filesearch.
update: This is my branch: https://github.com/liigo/rust/tree/xp
I just commented out the usage of CreateSymbolicLinkW and GetFinalPathNameByHandleW. This make the new rustc.exe run successfully in Windows XP, ant it works mostly OK (see my latest comment below).
The text was updated successfully, but these errors were encountered: