Problem with builder settings using workspace_loc on Linux [message #795755] |
Fri, 10 February 2012 22:27 |
Josh Davidson Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Our build scripts need to have a couple crucial environment variables configured, which we set in C/C++ Build->Environment.
As one example, we set PYTHONPATH to ${workspace_loc:/SimCommon/src/Python}
This works wonderfully on Windows, but on linux the colon is detected as the path separator and the variable adds two separate entries to PYTHONPATH:
* ${workspace_loc
* /SimCommon/srcPython}
I tried escaping, but to no avail. I can't simply use ${WorkspaceDirPath} since it assumes that all projects are physically located in the workspace directory which is often not the case.
[Updated on: Fri, 10 February 2012 22:28] Report message to a moderator
|
|
|
|
|
|
Re: Problem with builder settings using workspace_loc on Linux [message #797594 is a reply to message #797572] |
Mon, 13 February 2012 17:19 |
Josh Davidson Messages: 14 Registered: July 2009 |
Junior Member |
|
|
I'm not sure how resource_loc since I'm trying to set variables in one project to paths in others.
> workspace_loc may have a hard time calculating the actual location
This is exactly what workspace_loc is for. Going back to my early post,
${workspace_loc:/SimCommon}
${workspace_loc:/SimulationInterface}
would resolve to:
/disk01/data/davidsj2/repos/SimCommon
/disk01/data/davidsj2/repos/ast/SimulationInterface
respectively. It works find on Windows, but the reason it doesn't work on Linux (AFAICT) is the colon (:) in the variable is the path separator, and the code that resolves all of these variables appears to "split" the entire list before it performs variable lookup. So what ends up happening, is something like: ${workspace_loc:/SimCommon} is first split in half, then Eclipse performs variable replacement (no longer needed since neither "${workspace_loc" nor "/SimCommon" are valid variables).
EDIT:
${workspace_loc:<resource path>} - The absolute path on the system's hard drive to the specified resource. The <resource path> is the full path of the resource relative to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFile.txt if the project's contents directory for MyProject is outside the workspace directory.
[Updated on: Mon, 13 February 2012 17:33] Report message to a moderator
|
|
|
|
|
|
Re: Problem with builder settings using workspace_loc on Linux [message #801093 is a reply to message #798988] |
Fri, 17 February 2012 22:48 |
Josh Davidson Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Axel Mueller wrote on Wed, 15 February 2012 05:03I am using ${workspace_loc:/tools}
"tools" is a project in my workspace. The variable is set in Project Properties-> C/C++ Build->Environment
So, I created a project called "tools" and allowed it to be stored directly in my workspace directory. Then, under C/C++ Build->Environment, I added two variables:
zomg = ${workspace_loc:/tools}
blah = ${workspace_loc}/tools
As part of my build, I printed what the environment variabes are set to. Here are the results:
$zomg=${workspace_loc:/tools}
$blah=/disk01/data/davidsj2/workspace/tools
As you can see, "zomg" wasn't set correctly. I'm wondering if you either are setting the variable as part of your standard environment or if whatever you're invoking doesn't require the variable.
In my previous post, I said it appeared as if Eclipse was splitting the variables using ${workspace_loc:/<proj>} syntax before performing varible lookup. That was incorrect. Since the variable I was setting is multi-valued, the script in my build that uses the variable splits it based on the system path separator. Well, since Eclipse isn't doing any variable substitution when using this syntax, my script got the variable as-is and proceeded to split.
[Updated on: Fri, 17 February 2012 22:52] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04882 seconds