Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-03

bug in make install ?

21 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi,

How to install fpc 3.3.1?

When I use make install under Linux, Lazarus complains: Error: the Fppkg configuration is corrupt.

I can compile everything without errors.

Mattias

Reply by email

Joost van der Sluis
to Mattias Gaertner

Op 15-03-19 om 22:48 schreef Mattias Gaertner via fpc-pascal:

Show quoted text 6 lines
How to install fpc 3.3.1? When I use make install under Linux, Lazarus complains: Error: the Fppkg configuration is corrupt. I can compile everything without errors.

"Make install" does not create any configuration-files (like fpc.cfg and fppkg.cfg). Use samplecfg to do that:

sh compiler/utils/samplecfg /usr/local/lib/fpc/3.3.1

Btw: you can also use the button in Lazarus in the initial configuration screen which will essentially do the same. At least is should.

Regards,

Joost.

Reply by email

Mattias Gaertner
to Joost van der Sluis
Show quoted text 10 lines
Op 15-03-19 om 22:48 schreef Mattias Gaertner via fpc-pascal: > How to install fpc 3.3.1? > > When I use make install under Linux, Lazarus complains: > Error: the Fppkg configuration is corrupt. > > I can compile everything without errors. "Make install" does not create any configuration-files (like fpc.cfg and fppkg.cfg).

If fppkg.cfg is the cause, why does the Lazarus initial setup not tell this?

Use samplecfg to do that: sh compiler/utils/samplecfg /usr/local/lib/fpc/3.3.1

Or this?

Btw: you can also use the button in Lazarus in the initial configuration screen which will essentially do the same. At least is should.

Does not work. Can you elaborate, what it should do?

Mattias

Reply by email

Joost van der Sluis
to Mattias Gaertner

Op 18-03-19 om 18:20 schreef Mattias Gaertner via fpc-pascal:

Show quoted text 16 lines
On Mon, 18 Mar 2019 17:02:35 +0100 Joost van der Sluis wrote: > Op 15-03-19 om 22:48 schreef Mattias Gaertner via fpc-pascal: >> How to install fpc 3.3.1? >> >> When I use make install under Linux, Lazarus complains: >> Error: the Fppkg configuration is corrupt. >> >> I can compile everything without errors. > > "Make install" does not create any configuration-files (like fpc.cfg > and fppkg.cfg). If fppkg.cfg is the cause, why does the Lazarus initial setup not tell this?

I found it difficult to come up with a descriptive message.

Do you think that "fppkg.cfg" is better then "fppkg configuration"? Problem is that it could also be in the fppkg-compiler configuration file (by default called default). But it could also be something else. To be honest, I don't have a clue why it does not work for you. One guess would be that you do not have the fpmkunit-directory available.

Show quoted text 12 lines
> Use samplecfg to do that: > > sh compiler/utils/samplecfg /usr/local/lib/fpc/3.3.1 Or this? > Btw: you can also use the button in Lazarus in the initial > configuration screen which will essentially do the same. At least is > should. Does not work. Can you elaborate, what it should do?

Call samplecfg. ;)

The dialog checks if the given prefix is valid. (It checks for the existence of a few files) It has some hard-coded paths to check for to fill the combobox, and it extracts the prefix from the given compiler-executable.

When you click on the button to create the new configuration-file, it calls 'fpcmkcfg -3' and 'fpcmkcfg -4' with the parameters deducted from the given prefix. Just like samplecfg on Linux does.

After this, it re-loads fppkg. And it checks if the rtl-package can be found. If this is not the case, it complains.

So, can you give the output of 'fppkg listsettings' and 'fppkg list -d', to check why it can not find the rtl?

Regards,

Joost.

Reply by email

Mattias Gaertner
to Joost van der Sluis
Show quoted text 7 lines
[...] > If fppkg.cfg is the cause, why does the Lazarus initial setup not > tell this? I found it difficult to come up with a descriptive message. Do you think that "fppkg.cfg" is better then "fppkg configuration"?

Definitely.
It would be even better to tell the full file name. e.g. /etc/fpcpkg.cfg.

Problem is that it could also be in the fppkg-compiler configuration file (by default called default). But it could also be something else. To be honest, I don't have a clue why it does not work for you.

That's my problem too. That's why I'm asking for a better error message.

One guess would be that you do not have the fpmkunit-directory available.

It would be extremely helpful, if it would check common mistakes, like this. An error message "Directory /path/fpmkunit is missing. Check your /etc/fpcpkg.cfg." would be far better than "Error: the Fppkg configuration is corrupt."
What is corrupt? Is something missing, too much, not readable, did a command fail? What did it check to come to this conclusion?

Or if it does not fit into a one or two sentences, you can give a link "See here how to setup fppkg http://wiki.freepascal.org/...".

Same with
"Failed to create a new Fppkg configuration. You will have to fix the configuration manually or reinstall Free Pascal."
What did it try? What command failed?

>> Use samplecfg to do that: >> >> sh compiler/utils/samplecfg /usr/local/lib/fpc/3.3.1

As root that would overwrite my /etc/fpc.cfg
As normal user it creates /home/mattias/.fpc.cfg

Show quoted text 13 lines
> Or this? > > >> Btw: you can also use the button in Lazarus in the initial >> configuration screen which will essentially do the same. At least >> is should. > > Does not work. Can you elaborate, what it should do? Call samplecfg. ;) The dialog checks if the given prefix is valid. (It checks for the existence of a few files)

Lazarus does similar checks with fpc. Some fpc version changed some paths, some platforms have different files. Boom, the user gets a wrong error message. That's why the IDE should tell exactly, what it checked.

It has some hard-coded paths to check for to fill the combobox, and it extracts the prefix from the given compiler-executable.

It guessed the prefix correctly.

Show quoted text 9 lines
When you click on the button to create the new configuration-file, it calls 'fpcmkcfg -3' and 'fpcmkcfg -4' with the parameters deducted from the given prefix. Just like samplecfg on Linux does. After this, it re-loads fppkg. And it checks if the rtl-package can be found. If this is not the case, it complains. So, can you give the output of 'fppkg listsettings' and 'fppkg list -d', to check why it can not find the rtl?

Probably it fails because I have old 2.6.4 fppkg configs.

Mattias

Reply by email

Joost van der Sluis
to Mattias Gaertner
Mattias Gaertner wrote 13 lines
On Mon, 18 Mar 2019 22:04:17 +0100 Joost van der Sluis wrote: Definitely. It would be even better to tell the full file name. e.g. /etc/fpcpkg.cfg. > Problem is that it could also be in the fppkg-compiler configuration > file (by default called default). But it could also be something > else. To be honest, I don't have a clue why it does not work for you. That's my problem too. That's why I'm asking for a better error message.

I can not give a better error-message, if I do not even know myself what the problem of your configuration is.

Show quoted text 9 lines
> One guess would be that you do not have the fpmkunit-directory > available. It would be extremely helpful, if it would check common mistakes, like this. An error message "Directory /path/fpmkunit is missing. Check your /etc/fpcpkg.cfg." would be far better than "Error: the Fppkg configuration is corrupt." What is corrupt? Is something missing, too much, not readable, did a command fail? What did it check to come to this conclusion?

It already does all checks I can think of. And it does have special messages for all those cases.

But, as long as I do not know what the problem is that you or others are experiencing, I can not give a better message.

The message you see is the last message, when it failes but the system has no clue why.

Maybe I should change this message to what is exactly happens, that it can not find the rtl. But this was the message in the past, leading to all kind of complains like: 'But the RTL is just there!'.

We have to find the right message. It also took a while until we found the right text for the other problems in this dialog.

But first I have to know what your issue actually is.

Show quoted text 11 lines
>> Does not work. Can you elaborate, what it should do? > > Call samplecfg. ;) > > The dialog checks if the given prefix is valid. (It checks for the > existence of a few files) Lazarus does similar checks with fpc. Some fpc version changed some paths, some platforms have different files. Boom, the user gets a wrong error message. That's why the IDE should tell exactly, what it checked.

When it can not find those files, it will tell you so. Just like the other screens do. Just type something on the combobox with the prefix, it will give you hints until the path is probably right.

Show quoted text 12 lines
> When you click on the button to create the new configuration-file, it > calls 'fpcmkcfg -3' and 'fpcmkcfg -4' with the parameters deducted > from the given prefix. Just like samplecfg on Linux does. > > After this, it re-loads fppkg. And it checks if the rtl-package can > be found. If this is not the case, it complains. > > So, can you give the output of 'fppkg listsettings' and 'fppkg list > -d', to check why it can not find the rtl? Probably it fails because I have old 2.6.4 fppkg configs.

It should be able to handle those. And even when not, fpcmkcfg should just overwrite those.

Another guess would be: it uses an old version of fpcmkcfg. Older versions need other parameters for it to work. But it seaches for fpcmkcfg at the same location it finds the compiler. So when you did do a 'make install', it should use the latest version.

How do your fppkg.cfg and default files looks like? After the re-create that is?

Regards,

Joost.

Reply by email

Mattias Gaertner
to Joost van der Sluis
[...] > Probably it fails because I have old 2.6.4 fppkg configs.

I ran the samplecfg, which said it would create ~/.fpc.cfg, ~/.fp, ... Then the error was gone.

I restored the files from backup. Initial dialog pops up with error. But to my surprise the create config button worked. So apparently samplecfg changes more files than it claims. I have to find out what it does.

Mattias

Reply by email

Joost van der Sluis
to Mattias Gaertner
Mattias Gaertner wrote 13 lines
On Tue, 19 Mar 2019 11:17:42 +0100 Joost van der Sluis wrote: > [...] >> Probably it fails because I have old 2.6.4 fppkg configs. I ran the samplecfg, which said it would create ~/.fpc.cfg, ~/.fp, ... Then the error was gone. I restored the files from backup. Initial dialog pops up with error. But to my surprise the create config button worked. So apparently samplecfg changes more files than it claims. I have to find out what it does.

This was useful information. I have the same error-message now.

Do you also have something like this in your fppkg.cfg? (The one that fails)

Path=/home/CNOC/joost/fpc/lib/fpc/{CompilerVersion}//{CompilerVersion}/

(Note the duplicate {CompilerVersion} ?)

Not so easy to solve, though. I can imagine that some people do have FPC installed in a directory that does not contain the compiler-version. So I'll have to adapt fpcmkcfg...

Regards,

Joost.

Reply by email

Joost van der Sluis
to Joost van der Sluis
Joost van der Sluis wrote 27 lines
On 3/19/19 11:35 AM, Mattias Gaertner via fpc-pascal wrote: > On Tue, 19 Mar 2019 11:17:42 +0100 > Joost van der Sluis wrote: > >> [...] >>> Probably it fails because I have old 2.6.4 fppkg configs. > > I ran the samplecfg, which said it would create ~/.fpc.cfg, ~/.fp, ... > Then the error was gone. > > I restored the files from backup. Initial dialog pops up with error. > But to my surprise the create config button worked. > So apparently samplecfg changes more files than it claims. > I have to find out what it does. This was useful information. I have the same error-message now. Do you also have something like this in your fppkg.cfg? (The one that fails) Path=/home/CNOC/joost/fpc/lib/fpc/{CompilerVersion}//{CompilerVersion}/ (Note the duplicate {CompilerVersion} ?) Not so easy to solve, though. I can imagine that some people do have FPC installed in a directory that does not contain the compiler-version. So I'll have to adapt fpcmkcfg...

On a second look it seems that this problem has been resolved already. Did you have an old version of fpcmkcfg, maybe?

I'll add a check for that.

Regards,

Joost.

Reply by email

Bart
to Joost van der Sluis

I installed fpctrunk from sources r41749 (make clean; make install). It resides in C:\PP

I think it is not an unusual setup.

I built lazarus trunk r60747 with it.

Lazarus tells me:
"Warning: Failed to retrieve the version of the fpcmkcfg configuration tool. It is probably too old to create the configuration files. Make sure a recent version is installed and available in the path or alongside the compiler-executable."

But it (fpcmkcfg ) is there, in the same folder as the compiler:

C:\pp\bin\i386-win32>dir fpcmkcfg.exe /b
fpcmkcfg.exe
C:\pp\bin\i386-win32>dir ppc386.exe /b
ppc386.exe
C:\pp\bin\i386-win32>dir fpc.exe /b
fpc.exe

And it is the current path:
C:\pp\bin\i386-win32>path
PATH=C:\pp\bin\i386-win32;C:\Program Files .....

So, at least this error message is wrong.

The "Create new Fppkg configuration" is disabled.

How to proceed from here?

Bart

Reply by email

Bart
to Bart
PM Bart wrote
"Warning: Failed to retrieve the version of the fpcmkcfg configuration tool. It is probably too old to create the configuration files. Make sure a recent version is installed and available in the path or alongside the compiler-executable."

in TInitialSetupDialog.UpdateFppkgCandidates
CheckPath('C:\PP', Result) calls CheckFppkgQuality, which for 'C:\PP' sets result to sddqCompatible

(Minor error in the code:
DirPathExistsCached(C:\PP\\fpmkinst)=True
DirPathExistsCached(C:\PP\\units)=True
Notice the double backslashes:
we call DirPathExistsCached(LibPath+PathDelim+'fpmkinst') but 1 line above we already did:
LibPath := IncludeTrailingPathDelimiter(LibPath);
)

Then later in TInitialSetupDialog.CheckFpcmkcfgQuality TInitialSetupDialog.CheckFpcmkcfgQuality A
FpcmkcfgExecutable=C:\pp\bin\i386-win32\fpcmkcfg.exe FileExistsUtf8(FpcmkcfgExecutable)=True

      Proc.Options := proc.Options + [poWaitOnExit,poUsePipes];
      // Write fppkg.cfg
      Proc.Executable := FpcmkcfgExecutable;
      proc.Parameters.Add('-V');
      proc.Execute;
  Error: proc.ExitStatus=1

C:\pp\bin\i386-win32>fpcmkcfg -h
Usage: fpcmkcfg.exe [options]
Where options is one or more of
-t filename Template file name. Default is built-in -o filename Set output file. Default is standard output. -d name=value define name=value pair.
-h show this help and exit.
-u name remove name from list of name/value pairs. -m show builtin macros and exit.
-b show builtin template and exit.
-s skip the creation of a backup-file.
-p force directory creation.
-v be verbose.
-0 use built in fpc.cfg template (default) -1 use built in fp.cfg template
-2 use built in fp.ini template
-3 use built in fppkg.cfg template
-4 use built in fppkg default compiler template

fpcmkcfg.exe does not support -V parameter

fppkg.exe does support -V parameter and shows:
Warning: The directory
"C:\Users\Bart\AppData\Local\FreePascal\fppkg\config/conf.d\" of the include-mask "C:\Users\Bart\AppData\Local\FreePascal\fppkg\config/conf.d/*.conf" does not exist
Version: 3.3.1

Bart

Reply by email

Bart
to Bart

Notice also that when you cancel the InitialSetupDialog, the IDE raises an exception when closing down:

LAZARUS END - cleaning up ...
[FORMS.PP] ExceptionOccurred
Sender=EAccessViolation
Exception=Access violation
Stack trace:
$0056EB8A TWINCONTROL__HANDLEALLOCATED, line 7442 of ./include/wincontrol.inc
$0045493A TMAINIDE__SETTOOLSTATUS, line 3611 of main.pp $0044CF1C TMAINIDE__DESTROY, line 1648 of main.pp $0040FDA2 TOBJECT__FREE, line 336 of C:/devel/fpc/trunk/rtl/inc/objpas.inc TApplication.HandleException: EAccessViolation
Access violation
Stack trace:
$0056EB8A TWINCONTROL__HANDLEALLOCATED, line 7442 of ./include/wincontrol.inc
$0045493A TMAINIDE__SETTOOLSTATUS, line 3611 of main.pp $0044CF1C TMAINIDE__DESTROY, line 1648 of main.pp $0040FDA2 TOBJECT__FREE, line 336 of C:/devel/fpc/trunk/rtl/inc/objpas.inc TApplication.HandleException: Strange Exception
Exception at 0056EB8A: EAccessViolation:
Access violation.
Stack trace:
$0056EB8A TWINCONTROL__HANDLEALLOCATED, line 7442 of ./include/wincontrol.inc
$0045493A TMAINIDE__SETTOOLSTATUS, line 3611 of main.pp $0044CF1C TMAINIDE__DESTROY, line 1648 of main.pp $0040FDA2 TOBJECT__FREE, line 336 of C:/devel/fpc/trunk/rtl/inc/objpas.inc Hint: (lazarus) [TMainIDE.Destroy] B -> inherited Destroy... TMainIDE Hint: (lazarus) [TMainIDE.Destroy] END

Bart

Reply by email

Joost van der Sluis
to Bart: in TInitialSetupDialog.UpdateFppkgCandidates CheckPath('C:\PP', Result) calls…

Op 24-03-19 om 01:30 schreef Bart:

Show quoted text 47 lines
On Sat, Mar 23, 2019 at 7:56 PM Bart wrote: > "Warning: Failed to retrieve the version of the fpcmkcfg configuration > tool. It is probably too old to create the configuration files. Make > sure a recent version is installed and available in the path or > alongside the compiler-executable." Then later in TInitialSetupDialog.CheckFpcmkcfgQuality TInitialSetupDialog.CheckFpcmkcfgQuality A FpcmkcfgExecutable=C:\pp\bin\i386-win32\fpcmkcfg.exe FileExistsUtf8(FpcmkcfgExecutable)=True Proc.Options := proc.Options + [poWaitOnExit,poUsePipes]; // Write fppkg.cfg Proc.Executable := FpcmkcfgExecutable; proc.Parameters.Add('-V'); proc.Execute; Error: proc.ExitStatus=1 C:\pp\bin\i386-win32>fpcmkcfg -h Usage: fpcmkcfg.exe [options] Where options is one or more of -t filename Template file name. Default is built-in -o filename Set output file. Default is standard output. -d name=value define name=value pair. -h show this help and exit. -u name remove name from list of name/value pairs. -m show builtin macros and exit. -b show builtin template and exit. -s skip the creation of a backup-file. -p force directory creation. -v be verbose. -0 use built in fpc.cfg template (default) -1 use built in fp.cfg template -2 use built in fp.ini template -3 use built in fppkg.cfg template -4 use built in fppkg default compiler template fpcmkcfg.exe does not support -V parameter fppkg.exe does support -V parameter and shows: Warning: The directory "C:\Users\Bart\AppData\Local\FreePascal\fppkg\config/conf.d\" of the include-mask "C:\Users\Bart\AppData\Local\FreePascal\fppkg\config/conf.d/*.conf" does not exist Version: 3.3.1

The -V option has been added in r41742, but it has only been added to the help-screen in r41771. You have a version which is in between those two.

So can you test 'fpcmkcfg -V'. Seems like this does not work, as in Lazarus it gives a problem. But given your fpc-revision, it should work?

Regards,

Joost.

Reply by email

Joost van der Sluis
to Bart: Notice also that when you cancel the InitialSetupDialog, the IDE raises an exception when…

Op 24-03-19 om 01:33 schreef Bart:

Show quoted text 33 lines
Notice also that when you cancel the InitialSetupDialog, the IDE raises an exception when closing down: LAZARUS END - cleaning up ... [FORMS.PP] ExceptionOccurred Sender=EAccessViolation Exception=Access violation Stack trace: $0056EB8A TWINCONTROL__HANDLEALLOCATED, line 7442 of ./include/wincontrol.inc $0045493A TMAINIDE__SETTOOLSTATUS, line 3611 of main.pp $0044CF1C TMAINIDE__DESTROY, line 1648 of main.pp $0040FDA2 TOBJECT__FREE, line 336 of C:/devel/fpc/trunk/rtl/inc/objpas.inc TApplication.HandleException: EAccessViolation Access violation Stack trace: $0056EB8A TWINCONTROL__HANDLEALLOCATED, line 7442 of ./include/wincontrol.inc $0045493A TMAINIDE__SETTOOLSTATUS, line 3611 of main.pp $0044CF1C TMAINIDE__DESTROY, line 1648 of main.pp $0040FDA2 TOBJECT__FREE, line 336 of C:/devel/fpc/trunk/rtl/inc/objpas.inc TApplication.HandleException: Strange Exception Exception at 0056EB8A: EAccessViolation: Access violation. Stack trace: $0056EB8A TWINCONTROL__HANDLEALLOCATED, line 7442 of ./include/wincontrol.inc $0045493A TMAINIDE__SETTOOLSTATUS, line 3611 of main.pp $0044CF1C TMAINIDE__DESTROY, line 1648 of main.pp $0040FDA2 TOBJECT__FREE, line 336 of C:/devel/fpc/trunk/rtl/inc/objpas.inc Hint: (lazarus) [TMainIDE.Destroy] B -> inherited Destroy... TMainIDE Hint: (lazarus) [TMainIDE.Destroy] END

I noticed this also, tried to fix it, but did not succeed so far. (I don't think it has anything to do with my changes, the problem was already there)

Regards,

Joost.

Reply by email

Bart
to Bart: in TInitialSetupDialog.UpdateFppkgCandidates CheckPath('C:\PP', Result) calls…
AM Bart wrote
fpcmkcfg.exe does not support -V parameter

Never mind that: it helps if you actually rebuild fpc, not just update the sources ;-)

fpcmkcfg -h however does not list the "-V" option.

Now I get the rather ludicrous error message: "Warning: The fpcmkcfg configuration tool it too old [3.3.1]."

In function TInitialSetupDialog.CheckFpcmkcfgQuality(out Note:
string): TSDFilenameQuality;

else if not ((Ver.Major = 0) or (Ver.Major > 3) or (((Ver.Major = 3)) and (Ver.Minor>3))) then <<=====================

            begin
            // fpcmkcfg's version must be > 3.1.

I think the above code checks for 0.x, 4.x and > 3.3.x, which is not what the comment says.

I changed that to
else if not ((Ver.Major = 0) or (Ver.Major > 3) or (((Ver.Major = 3)) and (Ver.Minor>1))) then

Now it lets me create a new Fppkg configuration.

Note: I see several times a window (console?) flash when starting up Lazarus now.
Maybe add poNoConsole to ProcessOptions ?
It's a bit annoying now.

Bart

Reply by email

Joost van der Sluis
to Bart

Op 24-03-19 om 11:48 schreef Bart:

Show quoted text 15 lines
On Sun, Mar 24, 2019 at 1:30 AM Bart wrote: Now I get the rather ludicrous error message: "Warning: The fpcmkcfg configuration tool it too old [3.3.1]." In function TInitialSetupDialog.CheckFpcmkcfgQuality(out Note: string): TSDFilenameQuality; else if not ((Ver.Major = 0) or (Ver.Major > 3) or (((Ver.Major = 3)) and (Ver.Minor>3))) then <<===================== begin // fpcmkcfg's version must be > 3.1. I think the above code checks for 0.x, 4.x and > 3.3.x, which is not what the comment says.

Sorry. I had to test the message, so adapted the check so that it needs at least 3.4.0. And accidentally comitted that.

Show quoted text 5 lines
I changed that to else if not ((Ver.Major = 0) or (Ver.Major > 3) or (((Ver.Major = 3)) and (Ver.Minor>1))) then Now it lets me create a new Fppkg configuration.

Good to hear.

Note: I see several times a window (console?) flash when starting up Lazarus now. Maybe add poNoConsole to ProcessOptions ? It's a bit annoying now.

Can you test if this actually works on Windows (on Linux this is not an issue)

Joost

Reply by email

Bart
to Joost van der Sluis
PM Joost van der Sluis wrote 7 lines
> Note: I see several times a window (console?) flash when starting up > Lazarus now. > Maybe add poNoConsole to ProcessOptions ? > It's a bit annoying now. Can you test if this actually works on Windows (on Linux this is not an issue)

I added poNoConsole to the 2 occasions of TProcessUtf8 I could fine in InitialSetupDlg, but I still see 2 console windows flashing by.

Adding [poNoconsole] may also prevent the program in question to write output to StdOut?
But since we're using pipes, that should not matter?

Sorry, I just never use that stuff in my programs.

Bart

Bart

Reply by email

Bart
to Bart
PM Bart wrote
Sorry, I just never use that stuff in my programs.

It seems that when you try to execute a program that writes to console and you specify [poNoconsole] then the program will exit with: Proc.ExitCode=C0000005, Proc.ExitStatus=C0000005

Bart

Reply by email

Bart
to Bart
PM Bart wrote
> Sorry, I just never use that stuff in my programs.
In a simple test program I can make this work withou a console wndow popping up:
procedure TForm1.Button1Click(Sender: TObject);
var
  S: String;
begin
  Proc.Executable := 'C:\pp\bin\i386-win32\fpcmkcfg.exe';
  Proc.Options := [poWaitOnExit,poUsePipes];
  if paramstr(1)='no' then
    Proc.Options := [poWaitOnExit,poNoConsole,poUsePipes];
  Proc.Parameters.Add('-V');
  Proc.Execute;
  SetLength(S, Proc.Output.NumBytesAvailable);
  wr('Proc.Output.NumBytesAvailable='+IntToSTr(Proc.Output.NumBytesAvailable));
  if Proc.Output.NumBytesAvailable>0 then
    Proc.Output.Read(S[1], Proc.Output.NumBytesAvailable)
  else
    S:='No sigar...';
  wr(format('S= "%s"',[S]));
  wr('Proc.ExitCode='+Proc.ExitCode.ToHexString+ ', Proc.ExitStatus='+
Proc.ExitStatus.ToHexString);
  Proc.Free;
end;

So, now I'm not sure why I see 2 console windows popping in and out of existence when starting IDE...

Bart

Reply by email

Cyrax
to Bart: I added poNoConsole to the 2 occasions of TProcessUtf8 I could fine in InitialSetupDlg,…
Bart wrote 21 lines
On Sun, Mar 24, 2019 at 6:10 PM Joost van der Sluis wrote: >> Note: I see several times a window (console?) flash when starting up >> Lazarus now. >> Maybe add poNoConsole to ProcessOptions ? >> It's a bit annoying now. > > Can you test if this actually works on Windows (on Linux this is not an > issue) I added poNoConsole to the 2 occasions of TProcessUtf8 I could fine in InitialSetupDlg, but I still see 2 console windows flashing by. Adding [poNoconsole] may also prevent the program in question to write output to StdOut? But since we're using pipes, that should not matter? Sorry, I just never use that stuff in my programs. Bart
Does adding clauses for TProcess.StartupOptions := [suoUseShowWindow]
and TProcess.ShowWindow := swoHIDE help?

Reply by email

Bart
to Cyrax
AM Cyrax wrote 5 lines
> I added poNoConsole to the 2 occasions of TProcessUtf8 I could fine in > InitialSetupDlg, but I still see 2 console windows flashing by. Does adding clauses for TProcess.StartupOptions := [suoUseShowWindow] and TProcess.ShowWindow := swoHIDE help?

Makes no totally removed all that code from InitialSetUpDlg and I still see 2 console windows flashing.
So something else in the IDE seems to do that.

Bart

Reply by email