[rfc][icedtea-web] spawning linux jvm in rust lunchers

Alex Kashchenko akashche at redhat.com
Wed Oct 3 23:17:46 UTC 2018


Hi,

On 10/02/2018 07:31 PM, Jiri Vanek wrote:
> Currently doing nothing, just resending input arguments and settng path 
> to java binary.
> Still the whole approach is supposed to be final.
> 
> 2018-10-02  Jiri Vanek <jvanek at redhat.com>
>      * rust-launcher/src/jvm_from_properties_resolver.rs: (TestLogger) 
> testing impl of Os implementing new method by doing nothing
>      * rust-launcher/src/main.rs: (main) calling new 
> os.spawn_java_process with inut arguments without first one (pgm path)

Please use the following instead of get_sliced_first_arg:

let args = env::args().skip(1).collect()


>      * rust-launcher/src/os_access.rs: (Os) declared new method 
> ofspawn_java_process. (Linux) implementing it by spawn

1. Don't see a reason to use copy/move for its arguments, I'd rather use:

jre_dir: &std::path::PathBuf, args: &Vec<String>


2. clone is not needed in args.clone().into_iter()

3. please setup std in/out/err handling explicitly (even if you want to 
inherit all of them)

4. in error message a space is needed between "," and "\"


>      * rust-launcher/src/utils.rs: added and tested new methods to slice 
> out first member of vector and to cut first param  of  input arguments

get_sliced_first_arg is not needed.

-- 
-Alex


More information about the distro-pkg-dev mailing list