Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement OS Version Detection for the User Agent #25372
Conversation
highfive
commented
Dec 23, 2019
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @paulrouget (or someone else) soon. |
|
In order to test this changes, surf to I did only test this on Windows 10, but the crate is fairly simple and as such I don't expect any issues, apart from the following two:
See stanislav-tkach/os_info#111 for tracking
Also note the usage of Box::leak, maybe you have a different vision. I also removed the |
|
winapi duplicate versions is annoying. Do we have to use os_info? How does |
|
Someone already created an issue for winapi 0.30 on os_info. We could also submit a PR. |
|
The latest version of os_info is now using winapi 0.3. |
|
This seems fine to me. Please update to the latest version of os_info and we can merge this. |
| @@ -21,6 +21,9 @@ use std::sync::atomic::{AtomicBool, Ordering}; | |||
| use std::sync::{RwLock, RwLockReadGuard}; | |||
| use url::{self, Url}; | |||
|
|
|||
| #[cfg(all(target_os = "windows", not(target_vendor = "uwp")))] | |||
| extern crate os_info; | |||
This comment has been minimized.
This comment has been minimized.
jdm
Jan 21, 2020
Member
This statement should not be necessary in the 2018 edition of Rust, which components/config/Cargo.toml enables.
7c44064
to
957c49f
957c49f
to
a447136
|
Thinking about this a little harder, and how to avoid the leak and compilation error on non-windows, I'm becoming more hesitant about merging this. It only affects desktop windows builds, and only impacts windows versions that are already end-od-life. I am incluned to stick with the existing implementation and avoid the complexity without a compelling motivation otherwise. |
| { | ||
| match os_info::get().version().version() { | ||
| os_info::VersionType::Semantic(maj, min, _patch) => { | ||
| return Box::leak( |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
MeFisto94
Jan 23, 2020
Author
Contributor
While it doesn't change much about the reasoning, I think or better put assumed that this would happen only once on startup in https://github.com/MeFisto94/servo/blob/a4471368965d30c08042b73b5d475558a2e277f0/components/config/opts.rs#L567
MeFisto94 commentedDec 23, 2019
•
edited by jdm
User Agent now correctly reports Windows 7, 8.1, 10, ...
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors