Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: buiteldk on April 30, 2007, 05:31:43 pm

Title: Envvar plugin not retreaving vars from config-file
Post by: buiteldk on April 30, 2007, 05:31:43 pm
I am using environment variables with CodeBlocks (envvar - plugin). Adding vars  works great, but after closing C::B and opening it again, only the first Environment variable is restored from the settings file (default.conf) although four vars are stored in de the default.conf file (ENVVAR0 through ENVVAR3).
Is there a solution to this problem?
Extra info:
Using WinXP, nightly build 3899, wx2.8.3
Again: the first environment var is restored, others not (although they stay in the default.conf). I verified it compiling ReactOS with four environment variables.
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: MortenMacFly on May 01, 2007, 11:58:40 am
I am using environment variables with CodeBlocks (envvar - plugin). Adding vars  works great, but after closing C::B and opening it again, only the first Environment variable is restored from the settings file (default.conf) although four vars are stored in de the default.conf file (ENVVAR0 through ENVVAR3).
It works very well for me - I can't reproduce. What tool are you using to verify what envvars are set? What OS / C::B version are you using? Please *always* put such information into reports!

You guys using wx28 already: This *could* be an issue with wx28?! Anybody can reproduce?

With regards, Morten.
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: stahta01 on May 01, 2007, 04:27:01 pm
It worked for me with a highly patched CB, SVN 3909, using wxWidgets/wxMSW/XP with 2.6 compatible mode disabled.

Note, I only added a single Env. Var.
Note, CB crashes for me on a couple of releases ago during program close; it is possible that the crash was occurring before saving env var changes. I never got a useful crash info so did not report it. Does NOT seem to crash with SVN 3909.

Re-compiling C::B with no patches now.

Tim S
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: stahta01 on May 01, 2007, 04:51:19 pm
Just tried C::B SVN 3909 on XP SP2 and had no problems; using wxWidgets 2.8.3 CVS. Both C::B and wxWidgets with no patches.

Tim S
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: MortenMacFly on May 01, 2007, 05:11:24 pm
Note, I only added a single Env. Var.
Note, CB crashes for me on a couple of releases ago during program close; it is possible that the crash was occurring before saving env var changes. [...]
The issue is that the envvars do not get applied on C::B startup - but they seem to be saved (if I got buiteldk right). Anyways - when you tried with your "latest" version - did you have a single envvar there, too? If so, could you try having a few more ones?
With regards, Morten.
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: stahta01 on May 01, 2007, 05:27:05 pm
I tried 5 env var on the test without patches(wxMSW2.8.3); I then added an sixth using Nightly build 3504 and it worked also.

Tim S
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: MortenMacFly on May 01, 2007, 05:32:14 pm
I tried 5 env var on the test without patches(wxMSW2.8.3); I then added an sixth using Nightly build 3504 and it worked also.
Thanks Tim! :)

So I guess it's up to buiteldk again to give a few more details / steps to reproduce / a  sample project or anything similar. And again my question: What OS, what wx version, what C::B version?

With regards, Morten.
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: buiteldk on May 01, 2007, 09:33:37 pm
I have added some extra info in the startpost. Sorry for providing incomplete info.
The envvar section contains the folowing vars:
<envvars>
   <ENVVAR0>
      <str>
         <![CDATA[1;ROS_BUILDNOSTRIP;yes]]>
      </str>
   </ENVVAR0>
   <ENVVAR1>
      <str>
         <![CDATA[1;CPLUS_INCLUDE_PATH;G:\RosBE\4.1.3\include;G:\RosBE\4.1.3\include\c++\4.1.3;G:\RosBE\4.1.3\include\c++\4.1.3\mingw32;G:\RosBE\4.1.3\lib\gcc\mingw32\4.1.3\include]]>
      </str>
   </ENVVAR1>
   <ENVVAR2>
      <str>
         <![CDATA[1;C_INCLUDE_PATH;G:\RosBE\4.1.3\include;G:\RosBE\4.1.3\lib\gcc\mingw32\4.1.3\include]]>
      </str>
   </ENVVAR2>
   <ENVVAR3>
      <str>
         <![CDATA[1;LIBRARY_PATH;G:\RosBE\4.1.3\lib;G:\RosBE\4.1.3\lib\gcc\mingw32\4.1.3]]>
      </str>
   </ENVVAR3>
</envvars>
After closing C::B and opening again, only the first var is showing (and working) in the plugin, the others not. I have to add the last three again and then they work, until I close C::B again...
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: stahta01 on May 01, 2007, 11:31:58 pm
It does NOT like semi colons is my guess. Try replacing ; with : if minGW GCC is being used, it might work till they can figure out the cause/fix.

I duplicated the issue using C:\apps\RosBE\4.1.2\include;C:\apps\RosBE\4.1.2\include\c++\4.1.2
Note, the above are valid paths on my system. It seems to check for valid paths somewhere on saving.

Tim S

CPLUS_INCLUDE_PATH
G:\RosBE\4.1.3\include|G:\RosBE\4.1.3\include\c++\4.1.3|G:\RosBE\4.1.3\include\c++\4.1.3\mingw32|G:\RosBE\4.1.3\lib\gcc\mingw32\4.1.3\include

Title: Re: Envvar plugin not retreaving vars from config-file
Post by: MortenMacFly on May 02, 2007, 09:37:39 am
It does NOT like semi colons is my guess.
...right - that will give me a hint. I believe it's related to the way configmanager stores/restores the information, but I'll check out... be patient... ;-)
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: MortenMacFly on May 02, 2007, 10:34:53 am
...right - that will give me a hint.
It did. I'm using a SDK function there (GetArrayFromString) that obviously doesn't like semi-colons. We had that issue some time ago already (Thomas: remember?! ;-)) - I'll think about what to do...
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: MortenMacFly on May 02, 2007, 11:42:28 am
Should be fixed now. SVN r3917... ;-)
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: buiteldk on May 02, 2007, 09:25:21 pm
Thank you! I will try it soon.
Title: Re: Envvar plugin not retreaving vars from config-file
Post by: buiteldk on May 02, 2007, 10:27:40 pm
Great! It works now using the '|'-symbol instead of the ';'. Thank you very much.