Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Remote Launch Environment Variables
Remote Launch Environment Variables [message #6212] Sun, 01 April 2007 22:12 Go to next message
Sander Klous is currently offline Sander KlousFriend
Messages: 9
Registered: July 2009
Junior Member
Hi,
I am using RSE version 1, latest update from the eclipse update site, on
Windows XP. I am remote launching an application on a Linux box with RSE and
I was wondering if there is already a way to set environment variables for a
remote launch. There is a promising tab called "Environment Variables" with
a button "Add(B)...". But it doesn't seem to work properly (or maybe I am
doing something wrong).

Some observations:
- I can add a variable in the "Environment Variables", close the tab, come
back and it is still there.
- If I echo the contents of my variable in a shell started from RSE it
returns blank.
- If I exit eclipse and I open the "Environment Variables" tab again, the
variable I added is gone.
- I went through the eclipse config files to see if I could find the
variable defined somewhere, but it wasn't there.

Some questions:
- Is the above behavior expected?
- In what configuration file should the variable turn up? In the
node.properties of my remote machine?
- Should I upgrade to RSE v2? Does that have the feature in a working state?
- What does (B) mean behind the Add?

Please tell me if you need any additional information.
Thanks in advance for your help,
Sander
Re: Remote Launch Environment Variables [message #6248 is a reply to message #6212] Mon, 02 April 2007 16:49 Go to previous messageGo to next message
Sander Klous is currently offline Sander KlousFriend
Messages: 9
Registered: July 2009
Junior Member
Hi,
I took the obvious work around:
- Modified .bashrc to set my Environment Variables.
- Added the same Environment Variables to the eclipse environment.
- Now I can call these environment variables on startup in eclipse.
- Furthermore, the variables are known to the remote environment.

This is obviously a suboptimal solution, that wouldn't solve all cases.

An example where this wouldn't work is:
Two applications running on the same remote host that need different
environments.

In the process of working this out I was wondering if it is possible to
source an arbitrary setup script before launching the application. That
would solve part of the problem.

The third problem I ran into, in relation to the above is:
- I want to start my application with the following argument: -i ${MYVAR}
- Eclipse tries to expand ${MYVAR}, so I have to provide it.
- I couldn't find an escape sequence that allows ${MYVAR} to be expanded by
the remote shell instead.

Any help on these subjects is appreciated.
Thanks again,
Sander

"Sander Klous" <sander@nikhef.nl> wrote in message
news:eupap7$o8i$1@build.eclipse.org...
> Hi,
> I am using RSE version 1, latest update from the eclipse update site, on
> Windows XP. I am remote launching an application on a Linux box with RSE
> and I was wondering if there is already a way to set environment variables
> for a remote launch. There is a promising tab called "Environment
> Variables" with a button "Add(B)...". But it doesn't seem to work properly
> (or maybe I am doing something wrong).
>
> Some observations:
> - I can add a variable in the "Environment Variables", close the tab, come
> back and it is still there.
> - If I echo the contents of my variable in a shell started from RSE it
> returns blank.
> - If I exit eclipse and I open the "Environment Variables" tab again, the
> variable I added is gone.
> - I went through the eclipse config files to see if I could find the
> variable defined somewhere, but it wasn't there.
>
> Some questions:
> - Is the above behavior expected?
> - In what configuration file should the variable turn up? In the
> node.properties of my remote machine?
> - Should I upgrade to RSE v2? Does that have the feature in a working
> state?
> - What does (B) mean behind the Add?
>
> Please tell me if you need any additional information.
> Thanks in advance for your help,
> Sander
>
Re: Remote Launch Environment Variables [message #6277 is a reply to message #6248] Wed, 04 April 2007 21:13 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hello Sander,

* What communications protocol are you using? Environment
variables are correctly set on the remote side for dstore,
I verified this with TM 2.0M6 but it should have been
working with RSE 1.x already.
For ssh, it is not working (known bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=162018)

* Persistent storage of environment variables fails indeed,
I created a new bug for this - thanks for the report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=181064

* Upgrading to TM 2.0M6 will not help.

* The (B) in "Add (B)" is an automatically generated mnemonic,
indicating that you can use keyboard shortcut B to access
it. Auto-generated mnemonics may be confusing at first sight
but have some advantages. We have an enhancement request to
get rid of some of them:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=178768

* When you talk about launching, what and how would you
launch? Seems that I'm missing something here. For
information on how to write programs for launching that
make use of the RSE framework, see the EclipseCon tutorial
which includes sample code:
http://www.eclipsecon.org/2007/index.php?page=sub/&id=36 51

Thanks,
--
Martin Oberhuber
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Re: Remote Launch Environment Variables [message #6291 is a reply to message #6277] Thu, 05 April 2007 08:46 Go to previous messageGo to next message
Sander Klous is currently offline Sander KlousFriend
Messages: 9
Registered: July 2009
Junior Member
Hi Martin,

"Martin Oberhuber" <martin.oberhuber@windriver.com> wrote in message
news:4614150F.9050008@windriver.com...
> Hello Sander,
>
> * What communications protocol are you using? Environment
> variables are correctly set on the remote side for dstore,
> I verified this with TM 2.0M6 but it should have been
> working with RSE 1.x already.
> For ssh, it is not working (known bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=162018)

I'm using SSH indeed.

> * When you talk about launching, what and how would you
> launch? Seems that I'm missing something here. For
> information on how to write programs for launching that
> make use of the RSE framework, see the EclipseCon tutorial
> which includes sample code:
> http://www.eclipsecon.org/2007/index.php?page=sub/&id=36 51

I don't think your missing something, your answers
are right on the spot. Thanks for the pointer, it is a
very instructive read.

In principle the existing RSE SSH functionality in
combination with the CDT remote application launch
works for me. What's left is a number of small bugs and
I think two feature requests. In summary they are:

- The SSH environment variable bug.
- The environment variable persistency bug.

- A feature request to be able to specify a number
of commands ran automatically at shell startup.

e.g. in the subsystems tab, a field where I can enter:
-----------------------
| source ./myscript.sh;
| cd /tmp;
-----------------------
When CDT remote application launch uses the connection,
it should get the environment specified in myscript.sh.

I think in many cases this functionality is much more
practical then the specification of environment variables.

- A feature request related to CDT remote application
launch. Although I think I should file this on a different
list, it is a direct result of the features offered by RSE.
On launch, CDT immediately expands all variables in the
argument list. But for remote launch, you would like some
of the variables to be expanded by the remote shell. I think
CDT already has a feature for environment variables on
the local system: ${env_var:MYVAR}. But this solution
doesn't work for environment variables on a remote system.

Reference:
http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg09206.html

Thanks for your help,
Sander
Re: Remote Launch Environment Variables [message #6305 is a reply to message #6291] Thu, 05 April 2007 23:49 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
> - A feature request to be able to specify a number
> of commands ran automatically at shell startup.

Would these run in every shell you launch from RSE,
or would you want different ones when launching a
program through remotecdt? - I think both are valid
requests. Could you file bugzilla enhancement requests for these?

In fact, I think that a script associated with a shell
and executed at shell startup makes environment variable persistence
unnecessary (since vars can be set in the script and it is
more versatile)

> of the variables to be expanded by the remote shell. I think
> CDT already has a feature for environment variables on
> the local system: ${env_var:MYVAR}. But this solution
> doesn't work for environment variables on a remote system.

Looks like you are talking about debug variables here.
I think there is an extension point (org.eclipse.core.variables)
where extenders can define new kinds of these variables. RSE
could implement this with an extension for remote environment
variables, e.g. ${remote_env_var:MYVAR}. Implementation might
not be very easy though, since the question is when these would
be expanded exactly (before launch, after script execution, ?)

Where do you want to use these vars? As arguments for your
program or anywhere else?

Cheers
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Re: Remote Launch Environment Variables [message #6311 is a reply to message #6305] Fri, 06 April 2007 12:57 Go to previous message
Sander Klous is currently offline Sander KlousFriend
Messages: 9
Registered: July 2009
Junior Member
>> - A feature request to be able to specify a number
>> of commands ran automatically at shell startup.
>
> Would these run in every shell you launch from RSE,
> or would you want different ones when launching a
> program through remotecdt?

If I understand this question correctly, I think from an
end user point of view the question translates into: do
you want to specify these commands in the CDT remote
application launch tabs, or do you want to specify them
in the RSE SSH tabs?

- In my case, the cleanest solution would be to specify them
in the CDT application launch tabs. I can imagine other cases
where you want them in the RSE SSH tabs.
- Either one of these solutions would solve my problem. I can
simply create a different connection specification in RSE for each
different program I will launch. Then in the CDT application
launch tab I will pick a different connection for each remote
application definition.

> - I think both are valid requests. Could you file bugzilla
> enhancement requests for these?

Okay, I did. The CDT enhancement I filed to the CDT group, the
RSE enhancement to the target management group.

>> of the variables to be expanded by the remote shell. I think
>> CDT already has a feature for environment variables on
>> the local system: ${env_var:MYVAR}. But this solution
>> doesn't work for environment variables on a remote system.
>
> Looks like you are talking about debug variables here.
> I think there is an extension point (org.eclipse.core.variables)
> where extenders can define new kinds of these variables. RSE
> could implement this with an extension for remote environment
> variables, e.g. ${remote_env_var:MYVAR}. Implementation might
> not be very easy though, since the question is when these would
> be expanded exactly (before launch, after script execution, ?)
>
> Where do you want to use these vars? As arguments for your
> program or anywhere else?

Yes, as an argument to my program. I think that would cover the
very large majority of the cases where this will be used. In fact,
I can not think of any other realistic Use Cases at the moment.

I think in my case it would be a solution to introduce an escape
character that would avoid the expansion of ${MYVAR} by
eclipse and simply send the entire argument string to the remote
host to be executed "as is". This might be a lot easier to implement
and avoids the ambiguity on when to expand these variables.

Thanks,
Sander
Re: Remote Launch Environment Variables [message #566604 is a reply to message #6212] Mon, 02 April 2007 16:49 Go to previous message
Sander Klous is currently offline Sander KlousFriend
Messages: 9
Registered: July 2009
Junior Member
Hi,
I took the obvious work around:
- Modified .bashrc to set my Environment Variables.
- Added the same Environment Variables to the eclipse environment.
- Now I can call these environment variables on startup in eclipse.
- Furthermore, the variables are known to the remote environment.

This is obviously a suboptimal solution, that wouldn't solve all cases.

An example where this wouldn't work is:
Two applications running on the same remote host that need different
environments.

In the process of working this out I was wondering if it is possible to
source an arbitrary setup script before launching the application. That
would solve part of the problem.

The third problem I ran into, in relation to the above is:
- I want to start my application with the following argument: -i ${MYVAR}
- Eclipse tries to expand ${MYVAR}, so I have to provide it.
- I couldn't find an escape sequence that allows ${MYVAR} to be expanded by
the remote shell instead.

Any help on these subjects is appreciated.
Thanks again,
Sander

"Sander Klous" <sander@nikhef.nl> wrote in message
news:eupap7$o8i$1@build.eclipse.org...
> Hi,
> I am using RSE version 1, latest update from the eclipse update site, on
> Windows XP. I am remote launching an application on a Linux box with RSE
> and I was wondering if there is already a way to set environment variables
> for a remote launch. There is a promising tab called "Environment
> Variables" with a button "Add(B)...". But it doesn't seem to work properly
> (or maybe I am doing something wrong).
>
> Some observations:
> - I can add a variable in the "Environment Variables", close the tab, come
> back and it is still there.
> - If I echo the contents of my variable in a shell started from RSE it
> returns blank.
> - If I exit eclipse and I open the "Environment Variables" tab again, the
> variable I added is gone.
> - I went through the eclipse config files to see if I could find the
> variable defined somewhere, but it wasn't there.
>
> Some questions:
> - Is the above behavior expected?
> - In what configuration file should the variable turn up? In the
> node.properties of my remote machine?
> - Should I upgrade to RSE v2? Does that have the feature in a working
> state?
> - What does (B) mean behind the Add?
>
> Please tell me if you need any additional information.
> Thanks in advance for your help,
> Sander
>
Re: Remote Launch Environment Variables [message #566661 is a reply to message #6248] Wed, 04 April 2007 21:13 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hello Sander,

* What communications protocol are you using? Environment
variables are correctly set on the remote side for dstore,
I verified this with TM 2.0M6 but it should have been
working with RSE 1.x already.
For ssh, it is not working (known bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=162018)

* Persistent storage of environment variables fails indeed,
I created a new bug for this - thanks for the report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=181064

* Upgrading to TM 2.0M6 will not help.

* The (B) in "Add (B)" is an automatically generated mnemonic,
indicating that you can use keyboard shortcut B to access
it. Auto-generated mnemonics may be confusing at first sight
but have some advantages. We have an enhancement request to
get rid of some of them:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=178768

* When you talk about launching, what and how would you
launch? Seems that I'm missing something here. For
information on how to write programs for launching that
make use of the RSE framework, see the EclipseCon tutorial
which includes sample code:
http://www.eclipsecon.org/2007/index.php?page=sub/&id=36 51

Thanks,
--
Martin Oberhuber
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Re: Remote Launch Environment Variables [message #566680 is a reply to message #6277] Thu, 05 April 2007 08:46 Go to previous message
Sander Klous is currently offline Sander KlousFriend
Messages: 9
Registered: July 2009
Junior Member
Hi Martin,

"Martin Oberhuber" <martin.oberhuber@windriver.com> wrote in message
news:4614150F.9050008@windriver.com...
> Hello Sander,
>
> * What communications protocol are you using? Environment
> variables are correctly set on the remote side for dstore,
> I verified this with TM 2.0M6 but it should have been
> working with RSE 1.x already.
> For ssh, it is not working (known bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=162018)

I'm using SSH indeed.

> * When you talk about launching, what and how would you
> launch? Seems that I'm missing something here. For
> information on how to write programs for launching that
> make use of the RSE framework, see the EclipseCon tutorial
> which includes sample code:
> http://www.eclipsecon.org/2007/index.php?page=sub/&id=36 51

I don't think your missing something, your answers
are right on the spot. Thanks for the pointer, it is a
very instructive read.

In principle the existing RSE SSH functionality in
combination with the CDT remote application launch
works for me. What's left is a number of small bugs and
I think two feature requests. In summary they are:

- The SSH environment variable bug.
- The environment variable persistency bug.

- A feature request to be able to specify a number
of commands ran automatically at shell startup.

e.g. in the subsystems tab, a field where I can enter:
-----------------------
| source ./myscript.sh;
| cd /tmp;
-----------------------
When CDT remote application launch uses the connection,
it should get the environment specified in myscript.sh.

I think in many cases this functionality is much more
practical then the specification of environment variables.

- A feature request related to CDT remote application
launch. Although I think I should file this on a different
list, it is a direct result of the features offered by RSE.
On launch, CDT immediately expands all variables in the
argument list. But for remote launch, you would like some
of the variables to be expanded by the remote shell. I think
CDT already has a feature for environment variables on
the local system: ${env_var:MYVAR}. But this solution
doesn't work for environment variables on a remote system.

Reference:
http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg09206.html

Thanks for your help,
Sander
Re: Remote Launch Environment Variables [message #566698 is a reply to message #6291] Thu, 05 April 2007 23:49 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
> - A feature request to be able to specify a number
> of commands ran automatically at shell startup.

Would these run in every shell you launch from RSE,
or would you want different ones when launching a
program through remotecdt? - I think both are valid
requests. Could you file bugzilla enhancement requests for these?

In fact, I think that a script associated with a shell
and executed at shell startup makes environment variable persistence
unnecessary (since vars can be set in the script and it is
more versatile)

> of the variables to be expanded by the remote shell. I think
> CDT already has a feature for environment variables on
> the local system: ${env_var:MYVAR}. But this solution
> doesn't work for environment variables on a remote system.

Looks like you are talking about debug variables here.
I think there is an extension point (org.eclipse.core.variables)
where extenders can define new kinds of these variables. RSE
could implement this with an extension for remote environment
variables, e.g. ${remote_env_var:MYVAR}. Implementation might
not be very easy though, since the question is when these would
be expanded exactly (before launch, after script execution, ?)

Where do you want to use these vars? As arguments for your
program or anywhere else?

Cheers
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Re: Remote Launch Environment Variables [message #566713 is a reply to message #6305] Fri, 06 April 2007 12:57 Go to previous message
Sander Klous is currently offline Sander KlousFriend
Messages: 9
Registered: July 2009
Junior Member
>> - A feature request to be able to specify a number
>> of commands ran automatically at shell startup.
>
> Would these run in every shell you launch from RSE,
> or would you want different ones when launching a
> program through remotecdt?

If I understand this question correctly, I think from an
end user point of view the question translates into: do
you want to specify these commands in the CDT remote
application launch tabs, or do you want to specify them
in the RSE SSH tabs?

- In my case, the cleanest solution would be to specify them
in the CDT application launch tabs. I can imagine other cases
where you want them in the RSE SSH tabs.
- Either one of these solutions would solve my problem. I can
simply create a different connection specification in RSE for each
different program I will launch. Then in the CDT application
launch tab I will pick a different connection for each remote
application definition.

> - I think both are valid requests. Could you file bugzilla
> enhancement requests for these?

Okay, I did. The CDT enhancement I filed to the CDT group, the
RSE enhancement to the target management group.

>> of the variables to be expanded by the remote shell. I think
>> CDT already has a feature for environment variables on
>> the local system: ${env_var:MYVAR}. But this solution
>> doesn't work for environment variables on a remote system.
>
> Looks like you are talking about debug variables here.
> I think there is an extension point (org.eclipse.core.variables)
> where extenders can define new kinds of these variables. RSE
> could implement this with an extension for remote environment
> variables, e.g. ${remote_env_var:MYVAR}. Implementation might
> not be very easy though, since the question is when these would
> be expanded exactly (before launch, after script execution, ?)
>
> Where do you want to use these vars? As arguments for your
> program or anywhere else?

Yes, as an argument to my program. I think that would cover the
very large majority of the cases where this will be used. In fact,
I can not think of any other realistic Use Cases at the moment.

I think in my case it would be a solution to introduce an escape
character that would avoid the expansion of ${MYVAR} by
eclipse and simply send the entire argument string to the remote
host to be executed "as is". This might be a lot easier to implement
and avoids the ambiguity on when to expand these variables.

Thanks,
Sander
Previous Topic:TM 2.0m6 testing next tuesday
Next Topic:Target Management Webinar Apr. 12
Goto Forum:
  


Current Time: Thu Mar 28 17:39:25 GMT 2024

Powered by FUDForum. Page generated in 0.06278 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top