[rfc] added preprocessing to rust launchers

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[rfc] added preprocessing to rust launchers

Jiri Vanek
This patch is adding the possiblity to pas classapth and simialr to the rust luncher.
If there is enybody knowing the better way, and especially how to get rid of this duplicated
(triplicated x triplicated) snipept of
+ MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
+ BIN_LOCATION=$(bindir)/$(javaws).sh ;\
+ PROGRAM_NAME=$(javaws) ;\
+ $(edit_launcher_script) < $< > $@

And turn it into function of call(name, suffix)  < $< > $@, that would be awesome. I tried many
times, various ways, but if I get rid of those three lines, I always duplicated  targets:(

J.



--
Jiri Vanek
Senior QE engineer, OpenJDK QE lead, Mgr.
Red Hat Czech
[hidden email]    M: +420775390109

preprocessedRustLaunchers.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Alex Kashchenko
Hi,

On 12/05/2017 04:11 PM, Jiri Vanek wrote:

> This patch is adding the possiblity to pas classapth and simialr to the
> rust luncher.
> If there is enybody knowing the better way, and especially how to get
> rid of this duplicated (triplicated x triplicated) snipept of
> +    MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
> +    BIN_LOCATION=$(bindir)/$(javaws).sh ;\
> +    PROGRAM_NAME=$(javaws) ;\
> +    $(edit_launcher_script) < $< > $@
>
> And turn it into function of call(name, suffix)  < $< > $@, that would
> be awesome. I tried many times, various ways, but if I get rid of those
> three lines, I always duplicated  targets:(

I can suggest not to pre-process .rs file, but to preprocess config file
instead and read it on startup.


--
-Alex
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Jiri Vanek
Hello!

Thanx for feedback. I had week long personal battle whether to have it preprocessed with some solid
defaults, or to use config file. It ehnded 51:49 for preprocess. No it is 99:1 for config file:)

What location do you suggest?


On 12/06/2017 01:12 PM, Alex Kashchenko wrote:

> Hi,
>
> On 12/05/2017 04:11 PM, Jiri Vanek wrote:
>> This patch is adding the possiblity to pas classapth and simialr to the rust luncher.
>> If there is enybody knowing the better way, and especially how to get rid of this duplicated
>> (triplicated x triplicated) snipept of
>> +    MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
>> +    BIN_LOCATION=$(bindir)/$(javaws).sh ;\
>> +    PROGRAM_NAME=$(javaws) ;\
>> +    $(edit_launcher_script) < $< > $@
>>
>> And turn it into function of call(name, suffix)  < $< > $@, that would be awesome. I tried many
>> times, various ways, but if I get rid of those three lines, I always duplicated  targets:(
>
> I can suggest not to pre-process .rs file, but to preprocess config file instead and read it on
> startup.
>
>


--
Jiri Vanek
Senior QE engineer, OpenJDK QE lead, Mgr.
Red Hat Czech
[hidden email]    M: +420775390109
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Alex Kashchenko
On 12/06/2017 02:50 PM, Jiri Vanek wrote:
> Hello!
>
> Thanx for feedback. I had week long personal battle whether to have it
> preprocessed with some solid defaults, or to use config file. It ehnded
> 51:49 for preprocess. No it is 99:1 for config file:)
>
> What location do you suggest?

The same directory, where launcher binary is, will be the most
convenient. So it can be read with: executable_directory() +
"/conf_file_name".

>
>
> On 12/06/2017 01:12 PM, Alex Kashchenko wrote:
>> Hi,
>>
>> On 12/05/2017 04:11 PM, Jiri Vanek wrote:
>>> This patch is adding the possiblity to pas classapth and simialr to
>>> the rust luncher.
>>> If there is enybody knowing the better way, and especially how to get
>>> rid of this duplicated (triplicated x triplicated) snipept of
>>> +    MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
>>> +    BIN_LOCATION=$(bindir)/$(javaws).sh ;\
>>> +    PROGRAM_NAME=$(javaws) ;\
>>> +    $(edit_launcher_script) < $< > $@
>>>
>>> And turn it into function of call(name, suffix)  < $< > $@, that
>>> would be awesome. I tried many times, various ways, but if I get rid
>>> of those three lines, I always duplicated  targets:(
>>
>> I can suggest not to pre-process .rs file, but to preprocess config
>> file instead and read it on startup.
>>
>>
>
>


--
-Alex
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Jiri Vanek
On 12/06/2017 07:46 PM, Alex Kashchenko wrote:

> On 12/06/2017 02:50 PM, Jiri Vanek wrote:
>> Hello!
>>
>> Thanx for feedback. I had week long personal battle whether to have it preprocessed with some
>> solid defaults, or to use config file. It ehnded 51:49 for preprocess. No it is 99:1 for config
>> file:)
>>
>> What location do you suggest?
>
> The same directory, where launcher binary is, will be the most convenient. So it can be read with:
> executable_directory() + "/conf_file_name".

But that is no way with linux fs conventions for distribution packages.

So the fall back will need to stay in place

1)xdg_confidir/icedtea-web/conf_file_name
2)executable_directory() + :/conf_file_name".
Anything more?

where conf_file_name I would vote for .itw_default_paths

And the file should be read only :)

Thanx for thoughts!
   J.

>
>>
>>
>> On 12/06/2017 01:12 PM, Alex Kashchenko wrote:
>>> Hi,
>>>
>>> On 12/05/2017 04:11 PM, Jiri Vanek wrote:
>>>> This patch is adding the possiblity to pas classapth and simialr to the rust luncher.
>>>> If there is enybody knowing the better way, and especially how to get rid of this duplicated
>>>> (triplicated x triplicated) snipept of
>>>> +    MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
>>>> +    BIN_LOCATION=$(bindir)/$(javaws).sh ;\
>>>> +    PROGRAM_NAME=$(javaws) ;\
>>>> +    $(edit_launcher_script) < $< > $@
>>>>
>>>> And turn it into function of call(name, suffix)  < $< > $@, that would be awesome. I tried many
>>>> times, various ways, but if I get rid of those three lines, I always duplicated  targets:(
>>>
>>> I can suggest not to pre-process .rs file, but to preprocess config file instead and read it on
>>> startup.
>>>
>>>
>>
>>
>
>


--
Jiri Vanek
Senior QE engineer, OpenJDK QE lead, Mgr.
Red Hat Czech
[hidden email]    M: +420775390109
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Jiri Vanek
On 12/08/2017 11:21 AM, Jiri Vanek wrote:

> On 12/06/2017 07:46 PM, Alex Kashchenko wrote:
>> On 12/06/2017 02:50 PM, Jiri Vanek wrote:
>>> Hello!
>>>
>>> Thanx for feedback. I had week long personal battle whether to have it preprocessed with some
>>> solid defaults, or to use config file. It ehnded 51:49 for preprocess. No it is 99:1 for config
>>> file:)
>>>
>>> What location do you suggest?
>>
>> The same directory, where launcher binary is, will be the most convenient. So it can be read with:
>> executable_directory() + "/conf_file_name".
>
> But that is no way with linux fs conventions for distribution packages.
>
> So the fall back will need to stay in place
>
> 1)xdg_confidir/icedtea-web/conf_file_name
> 2)executable_directory() + :/conf_file_name".

hmm. that is user specific:(

So /etc/java/icedtea-web will need to be there to...

> Anything more?
>
> where conf_file_name I would vote for .itw_default_paths
>
> And the file should be read only :)
>
> Thanx for thoughts!
>    J.
>>
>>>
>>>
>>> On 12/06/2017 01:12 PM, Alex Kashchenko wrote:
>>>> Hi,
>>>>
>>>> On 12/05/2017 04:11 PM, Jiri Vanek wrote:
>>>>> This patch is adding the possiblity to pas classapth and simialr to the rust luncher.
>>>>> If there is enybody knowing the better way, and especially how to get rid of this duplicated
>>>>> (triplicated x triplicated) snipept of
>>>>> +    MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
>>>>> +    BIN_LOCATION=$(bindir)/$(javaws).sh ;\
>>>>> +    PROGRAM_NAME=$(javaws) ;\
>>>>> +    $(edit_launcher_script) < $< > $@
>>>>>
>>>>> And turn it into function of call(name, suffix)  < $< > $@, that would be awesome. I tried many
>>>>> times, various ways, but if I get rid of those three lines, I always duplicated  targets:(
>>>>
>>>> I can suggest not to pre-process .rs file, but to preprocess config file instead and read it on
>>>> startup.
>>>>
>>>>
>>>
>>>
>>
>>
>
>


--
Jiri Vanek
Senior QE engineer, OpenJDK QE lead, Mgr.
Red Hat Czech
[hidden email]    M: +420775390109
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Alex Kashchenko
Hi,

On 12/08/2017 01:17 PM, Jiri Vanek wrote:

> On 12/08/2017 11:21 AM, Jiri Vanek wrote:
>> On 12/06/2017 07:46 PM, Alex Kashchenko wrote:
>>> On 12/06/2017 02:50 PM, Jiri Vanek wrote:
>>>> Hello!
>>>>
>>>> Thanx for feedback. I had week long personal battle whether to have
>>>> it preprocessed with some solid defaults, or to use config file. It
>>>> ehnded 51:49 for preprocess. No it is 99:1 for config file:)
>>>>
>>>> What location do you suggest?
>>>
>>> The same directory, where launcher binary is, will be the most
>>> convenient. So it can be read with: executable_directory() +
>>> "/conf_file_name".
>>
>> But that is no way with linux fs conventions for distribution packages.
>>
>> So the fall back will need to stay in place
>>
>> 1)xdg_confidir/icedtea-web/conf_file_name
>> 2)executable_directory() + :/conf_file_name".
>
> hmm. that is user specific:(
>
> So /etc/java/icedtea-web will need to be there to...
>> Anything more?
>>
>> where conf_file_name I would vote for .itw_default_paths
>>
>> And the file should be read only :)

I suggest using fixed FHS-friendly path on linux and relative-fixed (to
executable) path on windows.

Alternatively it may be easier to preprocess "config.rs" (containing
only constants) and compile it into executable.

>>
>> Thanx for thoughts!
>>    J.
>>
>> [...]
>>

--
-Alex
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Jiri Vanek
In reply to this post by Jiri Vanek
Hi Alex!

Please see addapted version.


2017-12-11  Jiri Vanek <[hidden email]>
        * Makefile.am:
        preprocessing hardoced_paths.rs.in for each binary and creating libs
        * rust-launcher/launchers.rs: now uses new, future lib
        * rust-launcher/hardoced_paths.rs.in: source for all hardcoded libs we currently use


J.
On 12/08/2017 02:17 PM, Jiri Vanek wrote:

> On 12/08/2017 11:21 AM, Jiri Vanek wrote:
>> On 12/06/2017 07:46 PM, Alex Kashchenko wrote:
>>> On 12/06/2017 02:50 PM, Jiri Vanek wrote:
>>>> Hello!
>>>>
>>>> Thanx for feedback. I had week long personal battle whether to have it preprocessed with some
>>>> solid defaults, or to use config file. It ehnded 51:49 for preprocess. No it is 99:1 for config
>>>> file:)
>>>>
>>>> What location do you suggest?
>>>
>>> The same directory, where launcher binary is, will be the most convenient. So it can be read
>>> with: executable_directory() + "/conf_file_name".
>>
>> But that is no way with linux fs conventions for distribution packages.
>>
>> So the fall back will need to stay in place
>>
>> 1)xdg_confidir/icedtea-web/conf_file_name
>> 2)executable_directory() + :/conf_file_name".
>
> hmm. that is user specific:(
>
> So /etc/java/icedtea-web will need to be there to...
>> Anything more?
>>
>> where conf_file_name I would vote for .itw_default_paths
>>
>> And the file should be read only :)
>>
>> Thanx for thoughts!
>>    J.
>>>
>>>>
>>>>
>>>> On 12/06/2017 01:12 PM, Alex Kashchenko wrote:
>>>>> Hi,
>>>>>
>>>>> On 12/05/2017 04:11 PM, Jiri Vanek wrote:
>>>>>> This patch is adding the possiblity to pas classapth and simialr to the rust luncher.
>>>>>> If there is enybody knowing the better way, and especially how to get rid of this duplicated
>>>>>> (triplicated x triplicated) snipept of
>>>>>> +    MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
>>>>>> +    BIN_LOCATION=$(bindir)/$(javaws).sh ;\
>>>>>> +    PROGRAM_NAME=$(javaws) ;\
>>>>>> +    $(edit_launcher_script) < $< > $@
>>>>>>
>>>>>> And turn it into function of call(name, suffix)  < $< > $@, that would be awesome. I tried
>>>>>> many times, various ways, but if I get rid of those three lines, I always duplicated  targets:(
>>>>>
>>>>> I can suggest not to pre-process .rs file, but to preprocess config file instead and read it on
>>>>> startup.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

--
Jiri Vanek
Senior QE engineer, OpenJDK QE lead, Mgr.
Red Hat Czech
[hidden email]    M: +420775390109

preprocessedRustLaunchers2.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [rfc] added preprocessing to rust launchers

Alex Kashchenko
Hi,

On 12/11/2017 04:33 PM, Jiri Vanek wrote:

> Hi Alex!
>
> Please see addapted version.
>
>
> 2017-12-11  Jiri Vanek <[hidden email]>
>      * Makefile.am:
>      preprocessing hardoced_paths.rs.in for each binary and creating libs
>      * rust-launcher/launchers.rs: now uses new, future lib
>      * rust-launcher/hardoced_paths.rs.in: source for all hardcoded libs
> we currently use

I think this should work for passing build-time params. It also may be
better to rename libhardoced_paths_* to config_* or something.

>
> [...]
>
--
-Alex