Re: [Lazarus] Build number in my application
On Wed, Nov 19, 2008 at 3:07 PM, Henry Vermaak [EMAIL PROTECTED] wrote: before each compile, you can execute a program (see lazarus/tools/svn2revisioninc.pas) that puts the revision number in a revision.inc, or something. see the compilation tab of compiler options. you can obviously use this method in a Makefile, too (like lazarus does). I didn't know about the svn2revisioninc.pas file, but I did know about the 'compilation' tax I added a 'getrevision.sh' in the Execute Before Command edit box and checked Build and Compile. When I compile, Lazarus IDE crashed and closed without showing any error message. I then thought maybe Lazarus IDE can't find my 'getrevision.sh' script, so I added the following in the Command edit box: $(ProjPath)/getrevision.sh Again the same thing. When I compile Ctrl+F9 Lazarus IDE simply crashes and closes. :-( Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Build number in my application
2008/11/19 Graeme Geldenhuys [EMAIL PROTECTED]: Hi, My current project is in SubVersion. I user the SubVersion revision number as my Build number in my project version. Currently I use a revision.inc file which I have to manually edit from time to time (I'm lazy doing after every commit). Is there a way I can somehow tell Lazarus to automatically populate that file with the correct revision number *before* each compile? before each compile, you can execute a program (see lazarus/tools/svn2revisioninc.pas) that puts the revision number in a revision.inc, or something. see the compilation tab of compiler options. you can obviously use this method in a Makefile, too (like lazarus does). henry ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Build number in my application
On Wed, Nov 19, 2008 at 3:28 PM, Graeme Geldenhuys [EMAIL PROTECTED] wrote: When I compile, Lazarus IDE crashed and closed without showing any error message. Running Lazarus from the command line, I get the following output as soon as I press Ctrl+F9. ---[ begin ]-- [EMAIL PROTECTED]:lazarus$ ./lazarus TMainIDE.ParseCmdLineOptions: PrimaryConfigPath=/home/graemeg/.lazarus SecondaryConfigPath=/etc/lazarus [TExternalToolList.Run] CmdLine=/home/graemeg/programming/MasterMaths/M2Browser_v3/Source/tutoradmin/getrevision.sh WorkDir=/home/graemeg/programming/MasterMaths/M2Browser_v3/Source/tutoradmin/ TOutputFilter.Execute :TProcessUTF8 TExternalToolList.Run Failed to run tool Access violation Stack trace: $0805E595 $08069563 $0818911B TCONTROL__SETTEXT, line 3745 of ./include/control.inc $080B5412 TMAINIDE__UPDATECAPTION, line 10649 of main.pp $080C59C2 TMAINIDEBASE__SETTOOLSTATUS, line 231 of mainbase.pas $0809A137 TMAINIDE__SETTOOLSTATUS, line 3068 of main.pp $0809382C TMAINIDE__DESTROY, line 1207 of main.pp $080691F2 $08076A7D BEFOREFINALIZATION, line 1435 of forms.pp $0806CFA9 $08342899 TPROCESSUTF8__EXECUTE, line 220 of asyncprocess.pp $0836243E TOUTPUTFILTER__EXECUTE, line 8569 of outputfilter.pas $0831BD51 TEXTERNALTOOLLIST__RUN, line 372 of exttooldialog.pas $0831B5F1 TEXTERNALTOOLLIST__RUN, line 284 of exttooldialog.pas $080B394D TMAINIDE__ONRUNEXTERNALTOOL, line 10229 of main.pp $0836188E TCOMPILATIONTOOLOPTIONS__EXECUTE, line 3119 of compileroptions.pp $080B02B7 TMAINIDE__DOBUILDPROJECT, line 9258 of main.pp Xlib: sequence lost (0x13cae 0x3cae) in reply type 0x0! The program 'lazarus' received an X Window System error. This probably reflects a bug in the program. The error was 'BadImplementation (server does not implement operation)'. (Details: serial 15534 error_code 17 request_code 20 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) TExternalToolList.Run Exception: there was an error Xlib: unexpected async reply (sequence 0x3eaf)! Xlib: unexpected async reply (sequence 0x3eb8)! The program 'lazarus' received an X Window System error. This probably reflects a bug in the program. The error was 'BadWindow (invalid Window parameter)'. (Details: serial 16230 error_code 3 request_code 18 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) ---[ end ]- ---[ getrevision.sh ]--- #!/bin/sh svnversion -n revision.inc [ end ] I can run getrevision.sh from the console without problems... Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Build number in my application
Zitat von Graeme Geldenhuys [EMAIL PROTECTED]: On Wed, Nov 19, 2008 at 3:07 PM, Henry Vermaak [EMAIL PROTECTED] wrote: before each compile, you can execute a program (see lazarus/tools/svn2revisioninc.pas) that puts the revision number in a revision.inc, or something. see the compilation tab of compiler options. you can obviously use this method in a Makefile, too (like lazarus does). I didn't know about the svn2revisioninc.pas file, but I did know about the 'compilation' tax I added a 'getrevision.sh' in the Execute Before Command edit box and checked Build and Compile. When I compile, Lazarus IDE crashed and closed without showing any error message. I then thought maybe Lazarus IDE can't find my 'getrevision.sh' script, so I added the following in the Command edit box: $(ProjPath)/getrevision.sh Again the same thing. When I compile Ctrl+F9 Lazarus IDE simply crashes and closes. :-( I can reproduce the bug under linux by creating an empty file with executable perms set. TProcess then forks a child process and for some reason the Halt of the child process is not invoked. Two instances of the IDE are running, playing havoc, resulting in a crash. I was not able to reproduce it in a simple example though. I have no clue what to search next. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Build number in my application
2008/11/19 Graeme Geldenhuys [EMAIL PROTECTED]: ---[ getrevision.sh ]--- #!/bin/sh svnversion -n revision.inc [ end ] I can run getrevision.sh from the console without problems... that's because the your shell knows how to run scripts? maybe you need to put sh getrevision.sh in the edit box. henry ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Build number in my application
On Wed, Nov 19, 2008 at 6:46 PM, Henry Vermaak [EMAIL PROTECTED] wrote: ---[ getrevision.sh ]--- #!/bin/sh svnversion -n revision.inc [ end ] I can run getrevision.sh from the console without problems... that's because the your shell knows how to run scripts? maybe you need to put sh getrevision.sh in the edit box. No, that doesn't seem to be needed. I played around with my script file and stored the 'svnversion -n' output into a variable and then 'echo -n ' the information out to revision.inc. All the the script obviously. And suddenly, Lazarus is happy with that an no more crashes. I then reverted to the old script just to be sure, and Lazarus IDE crashes on demand. I have no clue what causes Lazarus to crash in one script and not in another. The both get called the same way in the Command edit box. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus