News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

batchbuild issues with backticked commands

Started by tiwag, October 18, 2006, 07:27:12 PM

Previous topic - Next topic

takeshimiya

#15
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.

tiwag

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

MortenMacFly

#17
Quote from: tiwag on October 18, 2006, 09:39:39 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

tiwag

Quote from: MortenMacFly on October 18, 2006, 09:59:29 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

MortenMacFly

Quote from: tiwag on October 18, 2006, 09:57:41 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

takeshimiya

Quote from: tiwag 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

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.

Quote from: tiwag on October 18, 2006, 09:57:41 PM
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.

Quote from: tiwag on October 18, 2006, 09:57:41 PM
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.


Quote from: tiwag on October 18, 2006, 09:57:41 PM
CB environment variables plugin should also work in batch-build mode !!!!
SDK  :)


tiwag

Quote from: MortenMacFly on October 18, 2006, 10:04:36 PM
Quote from: tiwag on October 18, 2006, 09:57:41 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

tiwag

Quote from: Takeshi Miya on October 18, 2006, 10:09:32 PM
Quote from: tiwag 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

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.

Quote from: tiwag on October 18, 2006, 09:57:41 PM
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.

Quote from: tiwag on October 18, 2006, 09:57:41 PM
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.


Quote from: tiwag on October 18, 2006, 09:57:41 PM
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

#23
Quote from: tiwag on October 18, 2006, 10:14:07 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.

tiwag


MortenMacFly

#25
Quote from: tiwag on October 18, 2006, 10:14:07 PM
wx-config --leckmich > wx-config.log
I couldn't resist: lol :lol:

Quote from: tiwag on October 18, 2006, 10:33:58 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...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

tiwag

Quote from: MortenMacFly on October 18, 2006, 10:43:44 PM

Quote from: tiwag on October 18, 2006, 10:33:58 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

I've narrowed it down to calling
Quotewx-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



tiwag

#28
i tried the following :

//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

tiwag

Quote from: Takeshi Miya on October 18, 2006, 10:58:18 PM
I've narrowed it down to calling
Quotewx-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`