Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: killerbot on August 13, 2007, 03:10:06 pm

Title: </envars> being added to project file
Post by: killerbot on August 13, 2007, 03:10:06 pm
today I noticed still a bunch of them get added, when I edit my project.
Title: Re: </envars> being added to project file
Post by: Biplab on August 13, 2007, 03:57:09 pm
I faced similar problem. Later I recompiled EnvVars and it became fine.  :)
Title: Re: </envars> being added to project file
Post by: killerbot on August 13, 2007, 04:27:21 pm
hmm, will kick out its objects and do the same ;-)
Title: Re: </envars> being added to project file
Post by: thomas on August 13, 2007, 05:39:17 pm
Hmm.... is EnvVars writing raw strings to the project file?

It seems weird that it would add a closing tag without opening tag, TinyXML won't do that (at least not unless something is seriously amiss).
Title: Re: </envars> being added to project file
Post by: killerbot on August 13, 2007, 05:47:58 pm
 :? :?  <envvars /> is what it should be, silly me.

So in the end you get something like this in the <Extensions> section :

   <envvars />
   <envvars />
   <envvars />
   <envvars />
Title: Re: </envars> being added to project file
Post by: MortenMacFly on August 13, 2007, 06:01:55 pm
This has already been reported in another topic. I asked to give me steps to reproduce as this never happened to me. I got no answer so far. How to achive this?
With regards, Morten.
Title: Re: </envars> being added to project file
Post by: MortenMacFly on August 13, 2007, 06:12:50 pm
I doubt it's my fault, here is the code responsible for saving:
Code
    TiXmlElement* node = elem->FirstChildElement("envvars");
    if (!node)
      node = elem->InsertEndChild(TiXmlElement("envvars"))->ToElement();
    node->Clear();
    if (!m_ProjectSets[project].IsEmpty())
      node->SetAttribute("set", cbU2C(m_ProjectSets[project]));
Notice that it is checked whether the node exists. But please prove mw wrong...?! :?: :?: :?:
Might this be possibly related to the changes Yiannis did in 4332?
With regards, Morten.
Title: Re: </envars> being added to project file
Post by: killerbot on August 13, 2007, 06:24:08 pm
what I did : just adjust some setting of the project. Will try to find a test case for reproduction.
Title: Re: </envars> being added to project file
Post by: killerbot on August 13, 2007, 06:50:11 pm
just reproduced it, this is what I did :

(tested on linux) :

0) in CB create new console project, build it and close cb
 ==>

Quote
      <Extensions>
         <envvars />
         <code_completion />
         <debugger />
      </Extensions>

1) open CB, and open the project (I did that by drag and drop from konqueror to CB [no idea if this is a required action for reproduction])

2) Project properties : build targets : I changed for the Debug target the Platforms (unticked : windows)

3) File menu : save project, close cb
==>
Quote
      <Extensions>
         <envvars />
         <code_completion />
         <debugger />
         <envvars />
      </Extensions>

4) do the same thing : Project properties etc, an tick Windows back on, then file menu save project, close cb

==>

Quote
      <Extensions>
         <envvars />
         <code_completion />
         <debugger />
         <envvars />
         <envvars />
      </Extensions>

EDIT : rev 4370
Title: Re: </envars> being added to project file
Post by: MortenMacFly on August 14, 2007, 07:29:40 am
Thanks Lieven!

just reproduced it, this is what I did :
[...]
EDIT : rev 4370

Did that under Windows and it worked like a charm - no duplicate nodes. Could you try under Windows, too please?!
Unfortunetely my Linux environment is broken (asks me to provide wx26 libs after I have removed them and updated to wx28). So I cannot test it currently under Linux until I have re-installed Ubuntu.

But I would really wonder why the hell this should be platform dependend...?!?!?! And in addition: CC uses quite the very same code - so why doesn't this happen for CC, too?!

With regards, Morten.
Title: Re: </envars> being added to project file
Post by: killerbot on August 14, 2007, 04:35:23 pm
in windows it is ok, seems to be linux specific then
Title: Re: </envars> being added to project file
Post by: MortenMacFly on August 14, 2007, 04:42:57 pm
in windows it is ok, seems to be linux specific then
Dammed. I was hoping that I wouldn't have to re-install the VM. I'll ask in another topic for help - I believe it's a simple configuration error... hopefully.
Edit: Done. See http://forums.codeblocks.org/index.php/topic,6679.msg51408.html#msg51408 please.
Title: Re: </envars> being added to project file
Post by: JGM on August 14, 2007, 04:57:49 pm
But I would really wonder why the hell this should be platform dependend...?!?!?! And in addition: CC uses quite the very same code - so why doesn't this happen for CC, too?!.

I hate when this kind of mysterious things occur. Resolving them is sometimes a headache. :(