[rfc][icedtea-web] moving rust launchers to cargo

Alex Kashchenko akashche at redhat.com
Fri Mar 2 01:07:12 UTC 2018


Hi,

Reviewing (ignoring autoconf changes):

1. please rename "hardcoded_paths" - values there are not limited to 
paths (maybe to just "hardcoded")

2. add the following build.rs file to the rust-launcher dir ( see: 
https://doc.rust-lang.org/cargo/reference/build-scripts.html ) to have 
better control over extracting values from env variables:

fn main() {
     // validation logic here for all vars
     println!("cargo:rustc-env=JRE={}", "foo1");
     println!("cargo:rustc-env=JAVA={}", "foo2");
     ...
}

3. in hardcoded.rs make all variable fetching non-optional (use only 
env! macro) and fill the default values in build.rs

4. drop tests from hardcoded.rs - this logic goes to build.rs

5. drop module declaration from hardcoded.rs


On 02/26/2018 12:53 PM, Jiri Vanek wrote:
> Environment variables propagation check moved from test-time to compile 
> time.
> 
> Thanx goes to Alkex!
>     J.
> On 02/15/2018 01:51 PM, Jiri Vanek wrote:
>> As agreed on privte discussion, this pathc is moving the 
>> responsibility to build of native launchers to cargo (from ourt 
>> makefiel and plain rustc).
>>
>> 2018-02-15  Jiri Vanek <jvanek at redhat.com>
>>      * configure.ac: added check for cargo
>>      * .hgignore: added target and Cargo.lock
>>      * .Makefile.am: dropped all launcher.in/libhardoced_paths_*.rs 
>> targets and rustc targets.
>>      (launcher.build/$(javaws) launcher.build/$(itweb_settings) 
>> launcher.build/$(policyeditor))
>>      adapted to use cargo. Variables handled in switch. (clean) now 
>> cleans all launcher.in*
>>      * rust-launcher/Cargo.toml: primitive declaration of package
>>      * rust-launcher/src/hardcoded_paths.rs: copied from 
>> rust-launcher/hardoced_paths.rs.in
>>      adapted to get substitution via cargo rather then by sed.  Added 
>> test and wrapping getters
>>      * rust-launcher/src/main.rs: copied from 
>> rust-launcher/launchers.rs. Adapted imports to new infrastructure,s 
>> till just reprinting hardcoded stuff
>>
>> Thanx!
>>    J.
>>
> 
> 


-- 
-Alex


More information about the distro-pkg-dev mailing list