Author Topic: The 10 May 2007 build will NOT be out. (developers please read this)  (Read 18908 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
because once again the linux build is broken.


Could things please be corrected (I have done it once, but things got changed again ...) :

1) keybinder.cpp is using the following stuff :
Code
Manager::Get()->GetMessageManager()->DebugLog(wxString::Format(wxT("KeyBinder failed UpdateById on[%d][%s]"), nMenuItemID, pMenuItem->GetText().GetData()));

that means that the following includes are needed (don't just think fucking pch) :
Code
#include "manager.h"  	 
#include "messagemanager.h"
 

And : they belong here and not in the corresponding header file !!!

2) And let the error speak for itself :
Code
cbkeybinder.cpp: In member function 'void cbKeyBinder::OnAppStartShutdown(wxCommandEvent&)':
cbkeybinder.cpp:1086: error: 'Sleep' was not declared in this scope
make[4]: *** [cbkeybinder.lo] Error 1

Please understand my frustration.

Offline Grom

  • Almost regular
  • **
  • Posts: 206
write your own h file  and contribute it to wx :lol:
gcc+winXP+suse.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7680
    • My Best Post
FYI:

I created thread "Quick and Dirty way to compile CB using wxMSW without using PCH"
http://forums.codeblocks.org/index.php/topic,5881.msg45006.html#msg45006

I plan to double check my patches and upload them to BerliOS in a few hours.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Well, I think pch is getting blamed more than it deserves.

The mistake was forgetting to copy the code back from Linux to Windows before commiting.

I was surprised to see the errs. I created and fixed those around 5 am this morning.


This is all confusing to me. On the one hand we have a core developer removing preprocessor flags so that pch always works, and on the other hand we have another developer yelling at us NOT to use pch at all.

geesh

I wouldn't mind relegating pch to the rubish pile anyway. It's bitten too many times.

« Last Edit: May 11, 2007, 01:23:22 am by Pecan »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7680
    • My Best Post
Well, I think pch is getting blamed more than it deserves.

The mistake was forgetting to copy the code back from Linux to Windows before commiting.

I was surprised to see the errs. I created and fixed those around 5 am this morning.


This is all confusing to me. On the one hand we have a core developer removing preprocessor flags so that pch always works, and on the other hand we have another developer yelling at us NOT to use pch at all.

geesh

I wouldn't mind relegating pch to the rubish pile anyway. It's bitten too many times.



@Pecan:

[ Patch #1993 ] Enable Keybinder build using wxMSW without PCH
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1993&group_id=5358

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Hmm, I was thinking lately about writing some tool that would add such missing headers automatically.

It's really easy task. It would base on fact that certain identifiers used in sources require certain header files. So when there's for example GetMessageManager or DebugLog used anywhere, it would notify that messagemanager.h is needed. After generating list of headers it could scan for all #include directives and add missing ones. Of course it would be not an universal tool but could work perfectly in case of C::B stuff (for both missing sdk and wx headers).

I think no more than few hours to make core tool. Maybe some more time to create Ident -> header bindings., but that doesn't have to be complite from the very beginning. What do you think about that?

I could sacrifice one night so Killerbot would be able to sleep well all the time without having nightmares about missing headers 8)

Regards
   BYO

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
well I don't say don't use pch. They have some advantage, they can speed up compilation, certainly when one is using a 'stable' sdk. The sdk of CB is not stable yet so because of that sometimes pch make the compilation longer, because there's a very high coupling of unrelated things in that pch file. On the other hand it introduces broken builds way to many, why because one adds an extra statement with whatever objects or types, hit compile .... it compiles. Cool, yes, but it compiled because most of the developers are using the pch build system or they environment automatically does the pch way, but then when building on a non pch build environment, the build is broken because the correct headers were not added for those just added statements.

My personal feeling is that pch makes programmers a bit lazy and the programmers forget to think about how headers actually (should) work. How would I say it, it gives a sense of false safety.

The basic line is : use headers correctly --> then it builds for non pch, and if you also want to support pch well then you add some special things to your file.
I once have written an article on correct use, I will review it once more tjhis weekend and publish it, I think it will make a whole bunch of things more clear.

Synopsis : pch are not bad, they need to be used correctly in ADDITION to the normal way of header inclusion, so one gets correct and portable code. ;-)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
My personal feeling is that pch makes programmers a bit lazy and the programmers forget to think about how headers actually (should) work. How would I say it, it gives a sense of false safety.
I've another solution besides Byo's beautiful idea (which I think is great):
I'm about to submit an update to the envvars plugin where I have simply added another target "no_pch". In there I do *not* define the *PRECOMP stuff but simply define NOPCH. Thus if this target builds it's most likely that it will immediately work on other machines without PCH (Linux), too. I've detected quite some PCH issues using this method. Once I have submitted you can have a look at it... 8)

With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Ok, as promised, tool that can help fixing missing headers. Sources are in attachment (project file may still need some tuning since I've not updated it to use $(WX_SUFFIX) etc. stuff).

I've added most of identifiers from C::B so it should work in most critical situations.

The plugin itself is very "dumb". For example, when processing any file, it won't process included files and check what stuff they include. So generally, when it process cpp file and some headers are in corresponsing h file, all those headers will probably be added into cpp.

As a result, the tool adds missing includes at the beginning of file, before any previous content (that was easiest to implement ;) ) surrounding it with // *** ADDED BY HEADER FIXUP ***  and // *** END *** comments so they can be quickly found by Search In Files.

I have tested it on wxSmith and it looks like it's working, but of courseback-up your files before using it ;).

BTW. I don't provice cbplugin file because there's some binary incompatibility between my wx and the one used in nightlies.

BYO

[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Thanks Byo, as we have seen here: http://forums.codeblocks.org/index.php/topic,5903.msg45142.html#msg45142 my attempt was far from being perfect anyway... :cry:
With regards, Morten.

Edit: Wohooo! Looks great! Have tested in on some of the plugins and (in fact) discovered missing includes. As you said there are some header included twice then but it's easy to remove the duplicates afterwards. Much easier than searching for the header files missing. Great work! 8)
« Last Edit: May 14, 2007, 06:16:24 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: The 10 May 2007 build will NOT be out. (developers please read this)
« Reply #10 on: May 14, 2007, 10:16:03 pm »
Right then... I had the crazy idea of starting to add support for wxWidgets to this plugin. So what I did was entering the config, creating a new set and started with "wxBeginBusyCursor". Unfortunately I received the error "Please enter valid C++ identifier". I looked into configuration.cpp and found the line:
Code
if ( wxString(_T("_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstvwxyz")).Find(Identifier.GetChar(0)) == wxNOT_FOUND )
which is causing the error message. Well... Identifier.GetChar(0) is obviously "w" (I verified that)... Now I read the line a million times - either it's too late or I'm simply too dumb: Why is it failing??? I mean: it seems obviously to be a minor bug but I cant' find the reason for this .Find() method to fail. Any help?!
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: The 10 May 2007 build will NOT be out. (developers please read this)
« Reply #11 on: May 15, 2007, 12:05:34 am »
Right then... I had the crazy idea of starting to add support for wxWidgets to this plugin. So what I did was entering the config, creating a new set and started with "wxBeginBusyCursor". Unfortunately I received the error "Please enter valid C++ identifier". I looked into configuration.cpp and found the line:
Code
if ( wxString(_T("_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstvwxyz")).Find(Identifier.GetChar(0)) == wxNOT_FOUND )
which is causing the error message. Well... Identifier.GetChar(0) is obviously "w" (I verified that)... Now I read the line a million times - either it's too late or I'm simply too dumb: Why is it failing??? I mean: it seems obviously to be a minor bug but I cant' find the reason for this .Find() method to fail. Any help?!
With regards, Morten.

'u' is missing in strings with allowed chars  :oops:

Offline gjsmo

  • Multiple posting newcomer
  • *
  • Posts: 28
  • i luv computers
    • My Blog
Re: The 10 May 2007 build will NOT be out. (developers please read this)
« Reply #12 on: May 15, 2007, 12:30:10 am »
reason
'u' is missing in strings with allowed chars  :oops:
Huh. How did that happen? I wonder...

P.S. I am not really familiar with the CB code and wxWidgets. However, I can pretty much see what this is doing (checking for allowed characters by having a string with all allowed chars, then searching for the entered char in the string to see if it is valid) and I would think that this would be an obvious mistake.

Now I read the line a million times - either it's too late or I'm simply too dumb: Why is it failing???

I am not sure but I think maybe the latter reason explains it. :oops:
http://www.danasoft.com/sig/gjsmo.jpg i luv linux.
There are 10 types of people in this world - those who understand binary and those who don't.
oh yeah: "I didn't really say everything I said."      -Yogi Berra

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: The 10 May 2007 build will NOT be out. (developers please read this)
« Reply #13 on: May 15, 2007, 08:53:52 am »
Thanks Byo, as we have seen here: http://forums.codeblocks.org/index.php/topic,5903.msg45142.html#msg45142 my attempt was far from being perfect anyway... :cry:
With regards, Morten.

Edit: Wohooo! Looks great! Have tested in on some of the plugins and (in fact) discovered missing includes. As you said there are some header included twice then but it's easy to remove the duplicates afterwards. Much easier than searching for the header files missing. Great work! 8)

sounds nice but ...... I had a look at the envvars.h, you added cbproject.h to the include list. Why ?
I don't see any reason why, or maybe it's still to early in the morning for me ;-)


In case it would be for FileTreeData : you should use the forward declaration :
class FileTreeData;

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: The 10 May 2007 build will NOT be out. (developers please read this)
« Reply #14 on: May 15, 2007, 09:28:32 am »
In case it would be for FileTreeData : you should use the forward declaration :
class FileTreeData;
It was indeed for that. Anyway - forward decl's are not yet supported by the plugin... but yes - would have been better. :oops: I'd better had not done that.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ