зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #13063 - Remove static usage at compile-time of GIT_INFO to enable builds outs… (from larsbergstrom:remove_git_info); r=metajack
r? @metajack The issue here is that if we build Servo from a expanded copy of the sources w/o a git repository present in-tree, this will fail. Further, we can't switch to `option_env` with an `unwrap_or` because `concat!` expects string literals. Source-Repo: https://github.com/servo/servo Source-Revision: ff6ffb73706a1a7e488b5d389aa913df0be4e63a
This commit is contained in:
Родитель
b97448190e
Коммит
5d856c2c54
|
@ -355,7 +355,7 @@ unsafe fn build_mozbrowser_event_detail(event: MozBrowserEvent,
|
|||
type_: Some(DOMString::from(error_type.name())),
|
||||
description: Some(DOMString::from(description)),
|
||||
report: Some(DOMString::from(report)),
|
||||
version: Some(DOMString::from_string(servo_version().into())),
|
||||
version: Some(DOMString::from_string(servo_version())),
|
||||
}.to_jsval(cx, rval);
|
||||
},
|
||||
MozBrowserEvent::SecurityChange(https_state) => {
|
||||
|
|
|
@ -36,6 +36,11 @@ pub mod prefs;
|
|||
pub mod resource_files;
|
||||
pub mod thread;
|
||||
|
||||
pub fn servo_version() -> &'static str {
|
||||
concat!("Servo ", env!("CARGO_PKG_VERSION"), env!("GIT_INFO"))
|
||||
pub fn servo_version() -> String {
|
||||
let cargo_version = env!("CARGO_PKG_VERSION");
|
||||
let git_info = option_env!("GIT_INFO");
|
||||
match git_info {
|
||||
Some(info) => format!("Servo {}{}", cargo_version, info),
|
||||
None => format!("Servo {}", cargo_version),
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче