-
Notifications
You must be signed in to change notification settings - Fork 87
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
Launcher catchup 4 - Native Debug in Rust #509
Launcher catchup 4 - Native Debug in Rust #509
Conversation
launchers/rust-launcher/src/main.rs
Outdated
} | ||
|
||
native_debug_toggle = String::from("-Xdebug"); | ||
native_debug_config = [String::from("-Xrunjdwp:transport=dt_socket,server=y,suspend="), suspend, String::from(",address="), port].concat(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest using format!()
macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please!
launchers/rust-launcher/src/main.rs
Outdated
match get_native_debug_parameter(env::vars().collect::<Vec<_>>(), String::from("ITW_NATIVEDEBUG_SUSPEND")){ | ||
Some(value) => { | ||
suspend = value; | ||
} | ||
_none => { | ||
suspend = String::from("n"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion if let
would be easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw it is more idiomatic to use type None
when matching value returned from Option instead of default.
launchers/rust-launcher/src/main.rs
Outdated
match get_native_debug_parameter(env::vars().collect::<Vec<_>>(), String::from("ITW_NATIVEDEBUG_PORT")){ | ||
Some(value) => { | ||
port = value; | ||
} | ||
_none => { | ||
port = String::from("9009"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
launchers/rust-launcher/src/main.rs
Outdated
@@ -83,6 +83,24 @@ fn is_splash_forbidden_testable(vars: Vec<(String, String)>, aargs: Vec<String>) | |||
false | |||
} | |||
|
|||
fn is_native_debug_enabled(args: &Vec<String>) -> bool { | |||
for s in args { | |||
if clean_param(s.to_string()) == ("-nativeDebug") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please extract nativeDebug to constant. It is already used twice
b9dd126
to
499f09e
Compare
Aurum, tested also on windows? Otherwise loks good to me |
I am unfortunately unable to build the rust launchers on Windows - it reports a LLVM error when executing https://github.com/AdoptOpenJDK/IcedTea-Web/blob/master/launchers/utils.sh#L41. Trying to find a fix. |
Really? last time we have spoken it was already on wix setup:( |
Retraced my steps and it is a fault with me being in a Windows VM and the project being on a shared drive, as is mentioned here. |
@judovana Copied directory to a local path, fixed an existing typo and it builds OK now. |
This was my first Rust experience, so hopefully the code's at least mediocre :D