Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Scanner discovery fails to see my environment changes

Hi,

I've figured out a solution in case anyone else comes across this problem.

The createOverrideVariable() is not persisted which is the reason why setting it does not cause org.eclipse.cdt.utils.envvar.PrefsStorableEnvironment.notifyLanguageSettingsChangeListeners(IEnvironmentChangeEvent) to fire (I'm not sure whether this is by design or an omission?). I need this to be fired to rerun the scanner discovery after my toolchain is added to the PATH environment variable.

A workaround is to set a dummy workspace environment variable which causes notifyLanguageSettingsChangeListeners() to fire and then the scanner discovery reruns, this time without any problems finding my now PATHed toolchain. I delete the env var immediately so it can be created again on the next launch.

UserDefinedEnvironmentSupplier udes = EnvironmentVariableManager.fUserSupplier;
StorableEnvironment se = udes.getWorkspaceEnvironmentCopy();
se.createVariable("dummy", "");
udes.setWorkspaceEnvironment(se);
se.deleteVariable("dummy");
udes.setWorkspaceEnvironment(se);


cheers john



On 25 June 2014 14:42, John Moule <john.m@xxxxxxxxxxxxxxx> wrote:
I ship an Eclipse product, with my own toolchain and a third party toolchain plugin. Every time Eclipse starts I add my toolchain's location to the PATH environment variable using org.eclipse.cdt.internal.core.envvar.UserDefinedEnvironmentSupplier.createOverrideVariable(), run from a class started early with <extension point="org.eclipse.ui.startup">.

But org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector.execute() runs before my toolchain's path has been added to the environment so I always get "Program "arm-none-eabi-gcc" not found in PATH ... Scanner Discovery Problem" warnings in the Problems view whenever eclipse starts with a workspace containing C projects.

I've tried mucking with start levels but its didn't really work and it doesn't feel right. Any ideas how I might workaround this please?

cheers john


Back to the top