Author Topic: batchbuild issues with backticked commands  (Read 28109 times)

takeshimiya

  • Guest
Re: batchbuilds broken since rev 3103
« Reply #15 on: October 18, 2006, 09:46:42 pm »
Sorry to ruin the party, I'm at Rev. 3086 and here it builds fine both from the IDE and from Build from explorer, using same wx-config exe from http://wxconfig.googlepages.com/) .

HOWEVER, I must note something is wrong with C::B file associations: when I do a double click on any CBP I get a Windows cannot find 'path\to\file.cbp'...

Something strange?

Log I get when I use batch builds:
-------------- Build: Release-wxdll in autobuildnumber ---------------
mingw32-g++.exe -fexpensive-optimizations -Os -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -ID:\Develop\src\wxWidgets-2.6.3\lib\gcc_dll\msw -ID:\Develop\src\wxWidgets-2.6.3\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0      -ID:\Develop\bin\mingw345\include -ID:\Develop\MyPaks\include -ID:\Develop\DevPaks\include  -ID:\cbbb\ -c autobuildnumber.cpp -o .objs\autobuildnumber.o
mingw32-g++.exe -LD:\Develop\bin\mingw345\lib -LD:\Develop\MyPaks\lib -LD:\Develop\DevPaks\lib  -o autobuildnumber.exe .objs\autobuildnumber.o   -s  -mthreads -LD:\Develop\src\wxWidgets-2.6.3\lib\gcc_dll -lwxmsw26 -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregex -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregex -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32   
autobuildnumber.cpp: In function `void IncrementVersion(const wxString&, wxString*, const wxString&)':
autobuildnumber.cpp:286: warning: int format, long int arg (arg 2)
Process terminated with status 0 (0 minutes, 5 seconds)
0 errors, 1 warnings

 
Log when I use the IDE:
-------------- Build: Release-wxdll in autobuildnumber ---------------
mingw32-g++.exe -fexpensive-optimizations -Os -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D_UNICODE -ID:\Develop\src\wxWidgets-2.6.3\lib\gcc_dll\mswu -ID:\Develop\src\wxWidgets-2.6.3\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0      -ID:\Develop\bin\mingw345\include -ID:\Develop\MyPaks\include -ID:\Develop\DevPaks\include  -ID:\cbbb\ -c autobuildnumber.cpp -o .objs\autobuildnumber.o
mingw32-g++.exe -LD:\Develop\bin\mingw345\lib -LD:\Develop\MyPaks\lib -LD:\Develop\DevPaks\lib  -o autobuildnumber.exe .objs\autobuildnumber.o   -s  -mthreads -LD:\Develop\src\wxWidgets-2.6.3\lib\gcc_dll -lwxmsw26u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32   
Process terminated with status 0 (0 minutes, 5 seconds)
0 errors, 0 warnings


EDIT: if this is a bug and was introduced in some rev. between 3086~3105, then at a first glance 3099 or 3094 seems the most likely.
« Last Edit: October 18, 2006, 09:56:59 pm by Takeshi Miya »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken since rev 3103
« Reply #16 on: October 18, 2006, 09:57:41 pm »
i found the reason

the problem is, that wx-config doesn't return anything to stdout, when it errors out,
this obviously confuses the backticked-command expander

the reason, why it behaves different when using from the IDE or from batchbuild
is obviously located in the environment variables plugin.

normally i don't have an environment variable WXWIN defined,
but i defined it to a valid value in the environmentvariables plugin,
which works fine with wx-config when using from the ide

defined in environment variables: WXWIN=D:\wx263
`wx-config --cxxflags` expands fine to shared ansi release wx-library

when batchbuilding the same project, CB hangs because `wx-config --cxxflags` doesn't return anything

evidence:
when using `wx-config --prefix=d:\wx263 --cxxflags` instead, then the project builds fine from the IDE and
from batch-build.

conclusion:
wx-config should return at least an error message if it couldn't find the requested wx-library
CB should check if there was any character returned and handle the case if no chars are coming instead of hanging around lazy  :P
CB environment variables plugin should also work in batch-build mode !!!!


brgds, tiwag

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: batchbuilds broken when using backticked commands
« Reply #17 on: October 18, 2006, 09:59:29 pm »
but it doesn't explain, why it freezes CB only when batch-building ?!
wx-config doesn't freeze CB when you build a project normally from the IDE ?!
No, actually this I didn't try - until now. The project I used for testing previously did not use wx-config.
So yes: Using wx-config also freezes C::B in non-batch-build-mode, but only if using wx-config. Any other tools I enter just works fine (but of course causes a compilation error).
@Takeshi: Could you try another C::B with a higher revision, please? Maybe we can narrow down when this happened - so obvioulsy between 3086 and 3003... or what?! ;-)
With regards, Morten.
« Last Edit: October 18, 2006, 10:01:44 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 tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken when using backticked commands
« Reply #18 on: October 18, 2006, 10:02:44 pm »
...Any other tools I enter just works fine (but of course causes a compilation error)...

try any other tool which doesn't return anything to stdout

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: batchbuilds broken since rev 3103
« Reply #19 on: October 18, 2006, 10:04:36 pm »
conclusion:
wx-config should return at least an error message if it couldn't find the requested wx-library
CB should check if there was any character returned and handle the case if no chars are coming instead of hanging around lazy  :P
CB environment variables plugin should also work in batch-build mode !!!!
Our posts have crossed - sorry for that. But what I don't get: I don't have a WXWIN variable defined in the envvar plugin thus if I use wx-config it also freezes the IDE during non-batch-build-mode build. Did you say it doesn't freezes your IDE in non-batch-build-mode? Could you try what happens if you remove the WXWIN envvar and try to compile this project from the IDE (in non-batch-build-mode)?
With regards, Morten.

Ps.: You said previously that you've disabled all plugins for the batch-build. How should the envvar plugin work then?!
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

takeshimiya

  • Guest
Re: batchbuilds broken since rev 3103
« Reply #20 on: October 18, 2006, 10:09:32 pm »
i found the reason

the problem is, that wx-config doesn't return anything to stdout, when it errors out,
this obviously confuses the backticked-command expander

Have you tested that from the command line? wx-config output this if you call wx-config --cxxflags:

   *** Error: wxWidgets hasn't been found installed at 'C:\wxWidgets'.

       Please use the --prefix flag (as in `wx-config --prefix=C:\wxWidgets`)
       or set the environment variable WXWIN (as in WXWIN=C:\wxWidgets)
       to specify where is your installation of wxWidgets.


Side note: I don't know if it's better to output those errors to std:cerr instead of std::cout.

the reason, why it behaves different when using from the IDE or from batchbuild
is obviously located in the environment variables plugin.
Another side note: Don't you think environment variables should become part of the SDK? I happen to want to use it on plugins and wizards.

normally i don't have an environment variable WXWIN defined,
but i defined it to a valid value in the environmentvariables plugin,
which works fine with wx-config when using from the ide
Well, I can confirm that unsetting WXWIN, etc definitely hangs C::B, but it should be because wx-config outputs the "message garbage Error: wxWidgets hasn't been found installed...", not because it doesn't outputs anything.


CB environment variables plugin should also work in batch-build mode !!!!
SDK  :)


Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken since rev 3103
« Reply #21 on: October 18, 2006, 10:12:48 pm »
conclusion:
wx-config should return at least an error message if it couldn't find the requested wx-library
CB should check if there was any character returned and handle the case if no chars are coming instead of hanging around lazy  :P
CB environment variables plugin should also work in batch-build mode !!!!
Our posts have crossed - sorry for that. But what I don't get: I don't have a WXWIN variable defined in the envvar plugin thus if I use wx-config it also freezes the IDE during non-batch-build-mode build. Did you say it doesn't freezes your IDE in non-batch-build-mode? Could you try what happens if you remove the WXWIN envvar and try to compile this project from the IDE (in non-batch-build-mode)?
With regards, Morten.

Ps.: You said previously that you've disabled all plugins for the batch-build. How should the envvar plugin work then?!

the compiler and environmentvariables plugins are enabled, and it works from the ide,
and yes, it does freeze CB when building from the ide, when i disable the WXWIN environment variable.

we have shot the problem !

btw. i tested a program, which return nothing, and this DOES NOT FREEZE CB !!!
my previous assumption was wrong !

but also wx-config is no longer running, when CB freezes

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken since rev 3103
« Reply #22 on: October 18, 2006, 10:14:07 pm »
i found the reason

the problem is, that wx-config doesn't return anything to stdout, when it errors out,
this obviously confuses the backticked-command expander

Have you tested that from the command line? wx-config output this if you call wx-config --cxxflags:

   *** Error: wxWidgets hasn't been found installed at 'C:\wxWidgets'.

       Please use the --prefix flag (as in `wx-config --prefix=C:\wxWidgets`)
       or set the environment variable WXWIN (as in WXWIN=C:\wxWidgets)
       to specify where is your installation of wxWidgets.


Side note: I don't know if it's better to output those errors to std:cerr instead of std::cout.

the reason, why it behaves different when using from the IDE or from batchbuild
is obviously located in the environment variables plugin.
Another side note: Don't you think environment variables should become part of the SDK? I happen to want to use it on plugins and wizards.

normally i don't have an environment variable WXWIN defined,
but i defined it to a valid value in the environmentvariables plugin,
which works fine with wx-config when using from the ide
Well, I can confirm that unsetting WXWIN, etc definitely hangs C::B, but it should be because wx-config outputs the "message garbage Error: wxWidgets hasn't been found installed...", not because it doesn't outputs anything.


CB environment variables plugin should also work in batch-build mode !!!!
SDK  :)



i guess this goes to stderr and not to stdout !

try

wx-config --leckmich > wx-config.log

what do you see in the log file ? nothing !

takeshimiya

  • Guest
Re: batchbuilds broken since rev 3103
« Reply #23 on: October 18, 2006, 10:18:16 pm »
wx-config --leckmich > wx-config.log

what do you see in the log file ? nothing !

  *** Error: Unrecognised option: '--leckmich'

Usage: wx-config [options]
Options:
  --prefix[=DIR]              Path of the wxWidgets installation (ie. C:\wxWidgets2.6.3)
  --wxcfg[=DIR]               Relative path of the build.cfg file (ie. gcc_dll\mswud)
  --cflags                    Outputs all pre-processor and compiler flags.
  --cxxflags                  Same as --cflags but for C++.
  --rcflags                   Outputs all resource compiler flags. [UNTESTED]
  --libs                      Outputs all linker flags.

  --debug[=yes|no]            Uses a debug configuration if found.
  --unicode[=yes|no]          Uses an unicode configuration if found.
  --static[=yes|no]           Uses a static configuration if found.
  --universal[=yes|no]        Uses an universal configuration if found.
  --easymode[=yes|no]         Outputs warnings, and optimize flags.
  --compiler[=gcc,dmc,vc]     Selects the compiler.
  --release                   Outputs the wxWidgets release number.
  --cc                        Outputs the name of the C compiler.
  --cxx                       Outputs the name of the C++ compiler.
  --ld                        Outputs the linker command.
  -v                          Outputs the revision of wx-config.

  Note that using --prefix is not needed if you have defined the
  environmental variable WXWIN.

  Also note that using --wxcfg is not needed if you have defined the
  environmental variable WXCFG.



 :?

But anyways I get the C::B crash from the IDE.
« Last Edit: October 18, 2006, 10:32:36 pm by Takeshi Miya »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken since rev 3103
« Reply #24 on: October 18, 2006, 10:33:58 pm »
maybe a buffer overflow in CB ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: batchbuilds broken since rev 3103
« Reply #25 on: October 18, 2006, 10:43:44 pm »
wx-config --leckmich > wx-config.log
I couldn't resist: lol :lol:

maybe a buffer overflow in CB ?
But I don't see what could have caused this in the changes between those revisions we have identified...?!
« Last Edit: October 18, 2006, 10:47:00 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 tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken since rev 3103
« Reply #26 on: October 18, 2006, 10:51:37 pm »

maybe a buffer overflow in CB ?
But I don't see what could have caused this in the changes between those revisions we have identified...?!

i know the reason :

the output from the error message is:

>wx-config --prefix=d:\x263 --cxxflags

*** Error: wxWidgets hasn't been found installed at 'd:\x263'.

       Please use the --prefix flag (as in `wx-config --prefix=C:\wxWidgets`)
       or set the environment variable WXWIN (as in WXWIN=C:\wxWidgets)
       to specify where is your installation of wxWidgets.


this makes an infinite loop !

takeshimiya

  • Guest
Re: batchbuilds broken since rev 3103
« Reply #27 on: October 18, 2006, 10:58:18 pm »
I've narrowed it down to calling
Quote
wx-config --prefix=
from command line. It hangs.

So it seems that when wx-config hangs it hangs C::B too.
Anyways the exe was built with MSVC 2005 Express and I can't debug it. :?

But when built with GCC or DMC it doesn't hangs and everything seems normal.

So in the meantime I've uploaded one built with DMC:
http://wx-config-win.googlecode.com/svn/binary/wx-config.exe



Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken since rev 3103
« Reply #28 on: October 18, 2006, 11:00:39 pm »
i tried the following :

Code
//nix.cpp -> nix.exe

#include <iostream>

int main(){
   std::string s1 = "`nix` ;-)";
   std::cout << s1 << std::endl;
   return 0;
}

and use this as backticked command  `nix` to the compiler options  :P

result, CB hangs because it recursively tries to resolve  `nix`


conclusion:
1.) wx-config MUST return an error message WITHOUT a self-referencing backticked command !!!
2.) the CB environmentvariables plugin doesn't work in batchbuild mode or isn't initialized at the time,
     when the compiler starts resolving backticked commands

brgds, tiwag
« Last Edit: October 18, 2006, 11:05:52 pm by tiwag »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuilds broken since rev 3103
« Reply #29 on: October 18, 2006, 11:03:43 pm »
I've narrowed it down to calling
Quote
wx-config --prefix=
from command line. It hangs.

So it seems that when wx-config hangs it hangs C::B too.
Anyways the exe was built with MSVC 2005 Express and I can't debug it. :?

But when built with GCC or DMC it doesn't hangs and everything seems normal.

So in the meantime I've uploaded one built with DMC:
http://wx-config-win.googlecode.com/svn/binary/wx-config.exe

wx-config doesn't hang, it is called infinitely !
see other post using `nix`