[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cdt-dev] Environment variables and prepend operations
- From: "Mario Pierro" <Mario.Pierro@xxxxxxx>
- Date: Tue, 29 Sep 2009 21:57:03 +0200
- Delivered-to: firstname.lastname@example.org
- Thread-index: AcpBOTX5Y4z8vuDVRfudBUTnOclLeQABM3Qg
- Thread-topic: [cdt-dev] Environment variables and prepend operations
A workaround for this has been to remove our toolchain's
projectEnvironmentSupplier and only leave its
This circumvents the problem by avoiding the case where the same
environment variable is prepended with itself. Still, the
EnvVarOperationProcessor will override the original variable operation
if that should happen.
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Mario Pierro
Sent: den 29 september 2009 21:16
To: CDT General developers list.
Subject: [cdt-dev] Environment variables and prepend operations
Our MBS toolchain contributes IBuildVariable implementations in order to
change the PATH environment variable used while building. The
implementation specifies an ENVVAR_PREPEND operation so that the
contributed path is added at the beginning of the existing system path.
I have noticed that in some circumstances the path provided by our
variable erroneously replaces the system path. This seems to be
connected with the plugins loading order.
The org.eclipse.cdt.utils.envvar.EnvVarOperationProcessor class actually
performs the prepend operation and calculates the new variable. The
result of a prepend operation is an environment variable which is by
default associated to IEnvironmentVariable.ENVVAR_REPLACE, since no
operation is explicitly specified.
>From EnvVarOperationProcessor: line 58
String delimiter = added.getDelimiter();
return new EnvironmentVariable(name,
(The comment on the PREPEND operation is originally there)
What happens is that our PATH build variable can get prepended with
itself, thereby generating a new PATH variable with the same value but
having a REPLACE operation instead of PREPEND. When the prepend result
gets merged with the system path, it erases existing entries.
Is that intended behavior or a bug? Should the prepend operation never
be called on the same variable? I have noticed that the line with the
PREPEND operation in EnvVarOperationProcessor had been commented out as
a bugfix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=175581.
Thank you for your help!
cdt-dev mailing list