Bug#902888: [lcl-utils-1.8] lazbuild crash when lazarus-src is not installed

2019-01-13 Thread Abou Al Montacir
On Sun, 2019-01-13 at 12:31 +0100, Abou Al Montacir wrote:...
> The error messages current location is decided by FPC make file and not by our
> scripts. And even it we are going to overwrite this we may want to move the
> error files to either/usr/share/fpc/3.0.4/compiler/msg/errore.msgor
> to/usr/share/fp-compiler-3.0.4/msg/errore.msgbut not
> to/usr/share/fpcsrc/3..4/compiler/msg/errore.msg
> For now I'll probably try to change Lazarus default search path.
I've tried several attempts to fix that but failed to find a way to get "gnu" in
"$(TargetCPU)-$(TargetOS)-gnu" in the attached patch.
I now consider again using the upstream path:
> /usr/share/fpcsrc/3..4/compiler/msg/errore.msg
using either a move command in rules file or a symbolic link entry in the .link
file.
Can anyone advise what is better? 
-- 
Cheers,
Abou Al Montacirdiff --git a/ide/etfpcmsgparser.pas b/ide/etfpcmsgparser.pas
index 38da4adb..4d423b44 100644
--- a/ide/etfpcmsgparser.pas
+++ b/ide/etfpcmsgparser.pas
@@ -1013,6 +1013,13 @@ begin
   FPCVer:=CodeToolBoss.FPCDefinesCache.GetFPCVersion(CompilerFilename,TargetOS,TargetCPU,false)
 else
   FPCVer:='';
+aFileName := GetForcedPathDelims('/usr/lib/$(TargetCPU)-$(TargetOS)-gnu/fpc/$(FpcVer)/msg/errore.msg');
+if not GlobalMacroList.SubstituteStr(aFilename) then begin
+  debugln(['TFPCMsgFilePool.GetMsgFileNames failed for ',CompilerFilename,' TargetCPU="',TargetCpu,'"',' TargetOS="',TargetOs,'"']);
+end;
+if FileExistsCached(aFilename) then begin
+  fCurrentEnglishFile:=aFilename;
+end else begin
 FPCSrcDir:=EnvironmentOptions.GetParsedFPCSourceDirectory(FPCVer);
 if FilenameIsAbsolute(FPCSrcDir) then begin
   // FPCSrcDir exists => use the errore.msg
@@ -1020,6 +1027,7 @@ begin
   if FileExistsCached(aFilename) then
 fCurrentEnglishFile:=aFilename;
 end;
+end;
 if not FileExistsCached(fCurrentEnglishFile) then begin
   // as fallback use the copy in the Codetools directory
   aFilename:=EnvironmentOptions.GetParsedLazarusDirectory;


signature.asc
Description: This is a digitally signed message part


Bug#902888: [lcl-utils-1.8] lazbuild crash when lazarus-src is not installed

2019-01-13 Thread Abou Al Montacir
On Sun, 2018-12-02 at 22:16 +0100, Abou Al Montacir wrote:
> On Mon, 2018-11-12 at 16:21 +0300, Alexander Kernozhitsky wrote:
> > Yes. The program is very minimalistic (see the attachments)
> > ...
> > It seems that lazbuild tries to find the file with compiler messages, but 
> > fails.
> I finally understood the issue.
It seems not true, actually!
> Lazbuild tries to look to the compiler error message at the wrong location:
> /usr/share/fpcsrc/3..4/compiler/msg/errore.msgHowever the error messages file
> is located in Debian at:
> /usr/lib/x86_64-linux-gnu/fpc/3.0.4/msg/errore.msgSo Lazarus/lazbuild does not
> find it and falls back on a copy shipped by lazarus-src:
> /usr/lib/lazarus/1.8.4/components/codetools/fpc.errore.msgHowever as you did
> not install lazarus-src, the file pointer is nil and an error happens when
> trying to access it.
> The first step to fix this is to try to understand why do we install the error
> message file in the wrong place?
The error messages current location is decided by FPC make file and not by our
scripts. And even it we are going to overwrite this we may want to move the
error files to either
/usr/share/fpc/3.0.4/compiler/msg/errore.msgor to
/usr/share/fp-compiler-3.0.4/msg/errore.msg
but not to
/usr/share/fpcsrc/3..4/compiler/msg/errore.msg
For now I'll probably try to change Lazarus default search path.
-- 
Cheers,
Abou Al Montacir

signature.asc
Description: This is a digitally signed message part


Bug#902888: [lcl-utils-1.8] lazbuild crash when lazarus-src is not installed

2018-12-02 Thread Abou Al Montacir
On Mon, 2018-11-12 at 16:21 +0300, Alexander Kernozhitsky wrote:
> Yes. The program is very minimalistic (see the attachments)
> ...
> It seems that lazbuild tries to find the file with compiler messages, but 
> fails.
I finally understood the issue.
Lazbuild tries to look to the compiler error message at the wrong location:
/usr/share/fpcsrc/3.0.4/compiler/msg/errore.msgHowever the error messages file
is located in Debian at:
/usr/lib/x86_64-linux-gnu/fpc/3.0.4/msg/errore.msgSo Lazarus/lazbuild does not
find it and falls back on a copy shipped by lazarus-src:
/usr/lib/lazarus/1.8.4/components/codetools/fpc.errore.msgHowever as you did not
install lazarus-src, the file pointer is nil and an error happens when trying to
access it.
The first step to fix this is to try to understand why do we install the error
message file in the wrong place?
-- 
Cheers,
Abou Al Montacir

signature.asc
Description: This is a digitally signed message part


Bug#902888: [lcl-utils-1.8] lazbuild crash when lazarus-src is not installed

2018-11-12 Thread Alexander Kernozhitsky
> Can you please provide a minimalistic program so that we can try to
> reproduce the issue in order to fix it?

Yes. The program is very minimalistic (see the attachments)

The lines that crash lazbuild are


  

  


in .lpi.

It seems that lazbuild tries to find the file with compiler messages, but 
fails.

-- 
Alexander Kernozhitsky

krash.tar.gz
Description: application/compressed-tar


Bug#902888: [lcl-utils-1.8] lazbuild crash when lazarus-src is not installed

2018-11-11 Thread Abou Al Montacir
Hi Alexander,
Sorry for my late answer but it the messaged ended on my ISP spam folder.
It may be that the program is trying to open a file that is not installed on the
file system. However I'd expect an error message rather than a crash.
Can you please provide a minimalistic program so that we can try to reproduce
the issue in order to fix it?
-- 
Cheers,
Abou Al Montacir



signature.asc
Description: This is a digitally signed message part


Bug#902888: [lcl-utils-1.8] lazbuild crash when lazarus-src is not installed

2018-07-02 Thread Alexander Kernozhitsky
Package: lcl-utils-1.8
Version: 1.8.4+dfsg-1
Severity: normal

I was trying to build a project using lazbuild. To do this, I installed the 
following packages: lcl-utils, lcl-units, lcl-nogui (not the entire Lazarus 
IDE). Then I ran

$ lazbuild .lpi

and got a crash at lazbuild startup. The stacktrace is:

An unhandled exception occurred at $009D6060:
EAccessViolation: Access violation
  $009D6060 line 952 of etfpcmsgparser.pas
  $00587F6A line 3053 of compileroptions.pp
  $005DC005 line 1048 of ../packager/packagesystem.pas
  $005E584A line 3544 of ../packager/packagesystem.pas
  $005E52F8 line 3442 of ../packager/packagesystem.pas
  $005E99BB line 4027 of ../packager/packagesystem.pas
  $005E917B line 3871 of ../packager/packagesystem.pas
  $004049B5 line 800 of lazbuild.lpr
  $004043DE line 965 of lazbuild.lpr
  $00402286 line 417 of lazbuild.lpr
  $00408B7E line 1467 of lazbuild.lpr
  $0040BCD6 line 1870 of lazbuild.lpr

(To make this stacktrace, I recompiled lazbuild with debugging symbols)

Nothing else was printed to the console.

After I installed lazarus-src, the problem disappeared. With the entire ide 
(lazarus-ide packages) the bug isn't reproducible also.

The bug doesn't happen on all projects, but on the projects where it happens, 
it is reproducible always (attempts to rebuild >10 times exposes the same 
problem)

--- System information. ---
Architecture: 
Kernel:   Linux 4.16.0-2-amd64

Debian Release: buster/sid
  990 testing ftp.by.debian.org 
  500 unstableftp.by.debian.org 

--- Package information. ---
Depends  (Version) | Installed
==-+-===
fp-compiler| 
debconf  (>= 0.5)  | 1.5.67
 OR debconf-2.0| 
libc6   (>= 2.2.5) | 


Recommends   (Version) | Installed
==-+-===
lazarus-ide-1.8| 1.8.4+dfsg-1
lcl-1.8| 1.8.4+dfsg-1


Package's Suggests field is empty.
-- 
-
Alexander Kernozhitsky