Bug 492284 - ${config_name} appears in Variables list but cannot be used anywhere in run configuration without generating an exception on application launch
Summary: ${config_name} appears in Variables list but cannot be used anywhere in run c...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL: https://www.eclipse.org/forums/index....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-22 16:44 EDT by Benjamin Shadwick CLA
Modified: 2020-09-04 15:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Shadwick CLA 2016-04-22 16:44:30 EDT
I have an existing codebase that builds multiple binaries via subsets of shared code (nothing I can do about that). I've set up an Eclipse project and am creating different build configurations for each binary.

I've got the build part working, where it puts a binary with the build configuration name in a directory with the build configuration name (build location is automatic, and artifact name is ${ConfigName}).


For the run part, I'd like to set "C/C++ Application" to ${config_name}/${config_name}
and working directory to something like ${workspace_loc:${project_name}/${config_name}}.

Unfortunately there are two problems here:
1. If I try to reference ${config_name} anywhere in the 'C/C++ Application' setting, I get a "Program does not exist" advisory at the top of the window.
2. If I try to reference ${config_name} anywhere in the working directory setting, I get an exception during launch: "Project name should be specified as variable argument for ${config_name} variable".

I don't understand what the given reason for #2 is at all. Someone else ran into it too: https://www.eclipse.org/forums/index.php/t/383687/

What's the point of ${config_name} showing up in the Variables... list on the run configuration menus if it can't actually be used?

If there's a legitimate reason for what's going on, then please at least consider this issue as a request to change the error message for #2 to be more user-friendly.
Comment 1 Elena Laskavaia CLA 2016-04-23 14:12:11 EDT
I assume you talking about launch configuration.

The variable expansion for launch configuration only use global eclipse variables (with ${project...} variables referencing in project specified in lc). There is a setting that refers to a build configuration from a launch configuration, I assume you expect this to be replaced to when using ${config_name}? The injection mechanism is rather complicated and 
not universal. I.e. every launch configuration setting may or may not use
variable substitution, some of them use different ones too.

Moreover using ${config_name} in program name will be problematic because
option "Automatic" for build configuration, means it take program name
and based on that trying to figure out build config. What suppose to be injected in this case?
Comment 2 Benjamin Shadwick CLA 2016-04-23 15:15:52 EDT
I don't understand anything you're saying.

What is the purpose of ${config_name}, and why is it listed as an available variable?

If I specify a build configuration, or if Eclipse tries to glean one, then why shouldn't a sensible build configuration name be available?
Comment 3 Elena Laskavaia CLA 2016-04-27 20:46:08 EDT
You did not confirm or deny you are talking about launch configurations.
If you are what do you expect this to be substituted to? Where it will be coming from?
Comment 4 Benjamin Shadwick CLA 2016-04-28 01:59:56 EDT
Yes, launch configurations.

Someone else probably answered my question here, but I haven't had a chance to try it: https://www.eclipse.org/forums/index.php?t=msg&th=1076833&goto=1730290&#msg_1730290