Recent

Author Topic: Strange problem: make invokes fpc with unwanted -Fu option  (Read 1745 times)

Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Strange problem: make invokes fpc with unwanted -Fu option
« on: April 30, 2020, 10:29:46 pm »
Hi,

I have a strange problem with rebuilding Lazarus.
First things first.
I'm on Windows.
I'm using Lazarus trunk (but the problem is the same with fixes branch)
My default compiler is currently fpc 3.2.0RC1 for i386-win32.
This compiler is also in my systems %PATH%

I also have fpc trunk installed (from source) in C:\pp (the default installation path), also 32-bit.
Both fpc's (trunk and 3.2.0RC1) are properly configured.

Now, whenever I try to (re)build Lazarus, the make process appends -Fuc:/pp/units/i386-win32/rtl to the fpc command.
This makes the compiler search for ppu's in that place.
And that place exists, and there is a system.ppu there (of course)

Fpc 3.2.0RC1 does not like that: it errors out with a "Fatal: (10016) Invalid PPU-File entry: 242"

There are several things that I don't understand here:

1.
Why does the build mechanism add the -Fuc:/pp/units/i386-win32/rtl parameter to the call to fpc?
Code: [Select]
C:/devel/fpc/3.2.0/bin/i386-Win32/fpc.exe -gl -vbqewnhi -Sci -dlclwin32 -Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter -Fu../packager -Fu../packager/frames -Fu../components/custom -Fuinclude/win -Fuframes -Fu. -Fuc:/pp/units/i386-win32/rtl -Fiinclude -Fiinclude/win32 -Fi../images -FE.. -FU../units/i386-win32/win32 -WG @C:\Users\Bart\AppData\Local\lazarus\idemake.cfg -di386 lazarus.ppThis -Fu path is nowhere in fpc.cfg of the compiler, it is not in the idemake.cfg file.

This happens when you build from within the IDE, but also if you do a simple make bigide from the commandline.

2.
When I build with fpc 3.0.4 the same -Fuc:/pp/units/i386-win32/rtl is appended to the fpc commandline by the build process, but fpc 3.0.4 does not mind: it determines this is not the correct PPU and tries the one specified in it's fpc.cfg file.

3.
If I use -Fu and point to fpc's 3.0.4 units, the fpc 3.2.0RC1 happily compiles a test program. Just like I described in point 2, the compiler determines this is not the correct PPU and tries the one specified in it's fpc.cfg file. It does NOT give a fatal error in this case, it only does that if you point it to the units directory of fpc trunk.

4.
Now for the weird part:
If I remove the c:\PP folder (I just renamed it), then the build mechanisme does NOT add the -Fuc:/pp/units/i386-win32/rtl parameter to fpc's commandline.
Building succeeds.

This sucks.

What have I tried.
  • Removed lazarus config folder: doesn't solve the problem
  • Removed fpc's config folder (config for fppkg system): doesn't solve the problem
  • Tried to build fpc fixes branch (a separate folder, and the ide uses a different config folder): same problem
  • Asked on lazarus-devel ML: no reply
  • Asked on fpc-devel ML: no solution

This is driving me crazy.
As it is now, my fpc trunk installation cannot co-exist with the combination Lazarus/Fpc 3.2.0RC1

Does anybody here have any idea of what the hell is going on on my system?

Bart
« Last Edit: April 30, 2020, 10:32:51 pm by Bart »

Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #1 on: May 01, 2020, 06:03:01 pm »
OK, for now the immediate problem is solved.
Sven has kindly increased the PPU version number of fpc trunk, so now when fpc 3.2.0 examines the system.ppu of fpc trunk, it will reject that as invalid PPU version and happily proceed to use it's own system.ppu.

Notice that it still has to do that for every unit in the rtl folder.

The root cause of the problem has not been solved yet.

Bart

TRon

  • Hero Member
  • *****
  • Posts: 535
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #2 on: May 01, 2020, 07:35:37 pm »
Helo Bart,

Sorry in case i'm stating the obvious but did you had a look at your environment variables ?

The only thing i can think of atm is that Lazarus (as i assume that is what you meant with IDE) get's thrown off, so i would take a closer look there (assuming that you have no dangling fpc.fpg somewhere around).

I have (multiple) Lazarus happily co-existing with fpc 2.6.4/3.0.4/RC1 and trunk. The only thing different from my perspective is that i never use Lazarus fpc default compiler. If it somehow get's there, i torn it out immediately and configure Lazarus manually.

fwiw: fpc bins do not have to be on your path ever.

I take it you are aware of the -va switch ? yes, it is tedious but also very informative).


Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #3 on: May 01, 2020, 11:02:59 pm »
My environments variables contain nothing related to this.
The only fpc that is in the path is fpc 3.2.0RC1
Fpc trunk is not in the path.
Code: [Select]
C:\Users\Bart>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Bart\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=(censored)
ComSpec=C:\WINDOWS\system32\cmd.exe
DriverData=C:\Windows\System32\Drivers\DriverData
FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
FPS_BROWSER_USER_PROFILE_STRING=Default
HOMEDRIVE=C:
HOMEPATH=\Users\Bart
LOCALAPPDATA=C:\Users\Bart\AppData\Local
LOGONSERVER=\\(censored)
NUMBER_OF_PROCESSORS=4
OneDrive=C:\Users\Bart\OneDrive
OnlineServices=Online Services
OS=Windows_NT
Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\SlikSvn\bin;C:\devel\fpc\3.2.0\bin\i386-Win32;C:\Users\Public\bin;C:\devel\delphi\d7\Bin;C:\devel\delphi\d7\Projects\Bpl\;C:\WINDOWS\System32\OpenSSH\;C:\Users\Bart\AppData\Local\Microsoft\WindowsApps;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
platformcode=KV
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=8e09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
RegionCode=EMEA
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\Bart\AppData\Local\Temp
TMP=C:\Users\Bart\AppData\Local\Temp
USERDOMAIN=(censored)
USERDOMAIN_ROAMINGPROFILE=(censored)
USERNAME=Bart
USERPROFILE=C:\Users\Bart
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
windir=C:\WINDOWS

Notice that the path to Delhi is behind all relevant paths to fpc related stuff, so this won't interfere (if it would the wrong make would be called, whic errors out immediately)

My setup:
Installed fpc 3.2.0RC1 form windows installer
Built Lazarus from souce (I have not install of Lazarus)
Also have a Lazarus fixes built from sources.
Built fpc trunk form sources and installed that in c:\pp

All different Lazarus' use there own config paths by means of the --pcp=path/to/config parameter, except for my main work-horse, which is Lazarus trunk whichs uses the default location (%LocalAppData%\lazarus) for that.

Basically:
c:\devel\
-- lazarus (lazarus trunk, compiled with default compiler, so ATM 3.2.0RC1, was 3.0.4)
-- fixes20 (compiled with default compiler)
-- laztrunktrunk (lazarus trunk, compiled with fpc trunk, for testing purposes)
-- fpc
----3.0.4\bin\i386-win32\fpc.exe
----3.2.0\bin\i386-win32\fpc.exe (=3.2.0RC1)
---- trunk (svn checkout of the fpc sources)
c:\pp (installation of trunk compiler by means of make install)

I did not have any problem with these co-exsiting Lazarus / fpc versions when I had fpc 3.0.4 as compiler (also installed from the fpc windows installer)
Havoc began when I installed fpc 3.2.0RC1 (at the same time I removed fpc 3.0.4 from %PATH%).

When I switched back to fpc 3.0.4 and examined the build log, I noticed that the same erroneous -Fuc:/pp/units/i386-win32/rtl was added by the build process.

 So far, nobody has been able to give me a clue as to why the build sytem adds this infurious -Fuc:/pp/units/i386-win32/rtl.
I went so far as to search for the phrase "pp/units" in all text files (source files, .txt, .xml, .cfg) on my entire harddisk.
The only hits were:
c:\pp\bin\i386-win32\fpc.cfg
The search history file of the Lazarus I was using to search for this.

It's a complete mystery to me.
Especially the utterly weird thing I described in point 4.

Bart

TRon

  • Hero Member
  • *****
  • Posts: 535
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #4 on: May 02, 2020, 01:11:49 am »
Hello Bart,

I seem to vaguely remember something.

Can you paste the contents of this file @C:\Users\Bart\AppData\Local\lazarus\idemake.cfg ?

Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #5 on: May 02, 2020, 02:26:02 pm »
Here it is.

Code: [Select]
-FuC:\devel\lazarus\packager\units\i386-win32
-FuC:\devel\lazarus\components\lazutils\lib\i386-win32
-FuC:\devel\lazarus\components\codetools\units\i386-win32
-FuC:\devel\lazarus\lcl\units\i386-win32
-FuC:\devel\lazarus\components\lazdebuggers\cmdlinedebuggerbase\lib\i386-win32
-FuC:\devel\lazarus\components\datetimectrls\lib\i386-win32\win32
-FuC:\devel\lazarus\components\debuggerintf\lib\i386-win32
-FuC:\devel\lazarus\lcl\units\i386-win32\win32
-FuC:\devel\lazarus\components\sdf\lib\i386-win32\win32
-FuC:\devel\lazarus\components\cairocanvas\lib\i386-win32\win32
-FuC:\devel\lazarus\components\fpdebug\lib\i386-win32
-FuC:\devel\lazarus\components\lazcontrols\lib\i386-win32\win32
-FuC:\devel\lazarus\components\lazdebuggers\lazdebuggerlldb\lib\i386-win32
-FuC:\devel\lazarus\components\chmhelp\packages\help\lib\i386-win32\win32
-FuC:\devel\lazarus\components\PascalScript\Source\lib\i386-win32
-FuC:\devel\lazarus\components\synedit\units\i386-win32\win32
-FuC:\devel\lazarus\components\ideintf\units\i386-win32\win32
-FuC:\devel\lazarus\components\printers\lib\i386-win32\win32
-FuC:\devel\lazarus\components\chmhelp\packages\idehelp\lib\i386-win32\win32
-FuC:\devel\lazarus\components\datetimectrls\design\lib\i386-win32\win32
-FuC:\devel\lazarus\components\tdbf\lib\i386-win32\win32
-FuC:\devel\lazarus\components\macroscript\lib\i386-win32
-FuC:\devel\lazarus\components\externhelp\lib\i386-win32\win32
-FuC:\devel\lazarus\components\fpcunit\ide\lib\i386-win32\win32
-FuC:\devel\lazarus\components\instantfpc\lib\i386-win32\win32
-FuC:\devel\lazarus\components\jcf2\IdePlugin\lazarus\lib\i386-win32\win32
-FuC:\devel\lazarus\components\lazcontrols\design\lib\i386-win32\win32
-FuC:\devel\lazarus\components\lazdebuggergdbmi\units\i386-win32\win32
-FuC:\devel\lazarus\components\leakview\lib\i386-win32\win32
-FuC:\devel\lazarus\components\memds\lib\i386-win32\win32
-FuC:\devel\lazarus\components\printers\design\lib\i386-win32\win32
-FuC:\devel\lazarus\components\projecttemplates\lib\i386-win32\win32
-FuC:\devel\lazarus\components\rtticontrols\lib\i386-win32\win32
-FuC:\devel\lazarus\components\sqldb\lib\i386-win32\win32
-FuC:\devel\lazarus\components\synedit\design\units\i386-win32\win32
-FuC:\devel\lazarus\components\tachart\lib\i386-win32\win32
-FuC:\devel\lazarus\components\todolist\lib\i386-win32\win32
-FuC:\devel\lazarus\components\turbopower_ipro\units\i386-win32\win32
-FuC:\devel\lazarus\components\turbopower_ipro\design\lib\i386-win32\win32
-Fu.
-dLCL
-dLCLwin32
-dAddStaticPkgs
-FiC:\Users\Bart\AppData\Local\lazarus\
-vbq
-g
-gl
-vu
-FUC:\devel\lazarus\units\i386-win32\win32

Bart

Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #6 on: May 02, 2020, 03:45:17 pm »
OK, I have been able to reproduce the problem on another computer, that did not have any fpc/lazarus software on it ever before, so absolutely clean w.r.t. fpc/lazarus.
Again a Win10-64 system.

Installed sliksvn
Did a fresh svn checkout of lazarus trunk in c:\devel\lazarus
Installed fpc3.2.0RC1 in c:\devel\fpc\3.2.0
So fpc 3.2.0RC1 is now in %PATH%

c:\devel\lazarus> make bigide
Build Lazarus as expected.
There is NO -Fuc:/pp/units/i386-win32/rtl in the calls to fpc

Did fresh svn checkout of fpc trunk in c:\devel\fpc
c:\devel\fpc\trunk>make all
Builds OK
c:\devel\fpc\trunk>make install
Installs fpc to C:\pp

C:\devel\lazarus>make bigide
This calls fpc 3.2.0RC1 with the -Fuc:/pp/units/i386-win32/rtl in the
calls to fpc immediately:

Code: [Select]
C:\devel\lazarus>make bigide
make -C packager/registration
make[1]: Entering directory `C:/devel/lazarus/packager/registration'
c:\devel\fpc\3.2.0\bin\i386-win32\ppc386.exe -MObjFpc -Scghi -O1 -g -gl -i -vewnhibq -Fu.  -Fuc:/pp/units/i386-win32/rtl -FE. -FU../units/i386-win32 -g -gl -di386 fcllaz.pas

Bart

TRon

  • Hero Member
  • *****
  • Posts: 535
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #7 on: May 03, 2020, 02:32:11 pm »
Thank you for the posts.

fwiw: i have had a similar experience, but can't remember if it was the same version as you are using right now. What i do remember is that Lazarus messed up things somewhere along the line (pick up on the wrong FPC directory). One thing i vividly remember is a dangling fpc.cfg in some "etc" directory. Lazarus kept insisting on using that particular configuration file no matter what i tried. I ended up removing the offending file so that Lazarus did not had any other choice left then to pick up on using the config from another location.

I do not know if the make for building the IDE supports the same (build) parameters but i urge again to build with -va to see if it is possible to determine where (if any) the fpc.cfg was picked up from. For fpc you can add OPT="-va" to the make command. Don[t forget to pipe the error/output so that it can be read/pasted afterwards :-)

PS: what i kind of hoping was to see an environment variable in your system messing up the build and/or config files (the latter can be influenced by them in case it uses them).
« Last Edit: May 03, 2020, 02:42:33 pm by TRon »

lucamar

  • Hero Member
  • *****
  • Posts: 3017
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #8 on: May 03, 2020, 03:14:10 pm »
[...] i urge again to build with -va to see if it is possible to determine where (if any) the fpc.cfg was picked up from.

Using -va just for that is seriously overkill; after all, it means "show ALL"! Instead, one might use -vt which shows the "Tried/used files" It's still too much info (includes all the configuration files, compiled and source units, etc) but much, much less than -va. ;)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

TRon

  • Hero Member
  • *****
  • Posts: 535
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #9 on: May 03, 2020, 03:35:13 pm »
[...] i urge again to build with -va to see if it is possible to determine where (if any) the fpc.cfg was picked up from.

Using -va just for that is seriously overkill; after all, it means "show ALL"! Instead, one might use -vt which shows the "Tried/used files" It's still too much info (includes all the configuration files, compiled and source units, etc) but much, much less than -va. ;)
Hmz, i had the impression -vt not show which fpc.cfg is used, but only the search for the units. In case it does then i've learned something new and i'll thank you for that. Even though -va is very informative, and much can be learned from that (in case you are interested in that sort of thing).

lucamar

  • Hero Member
  • *****
  • Posts: 3017
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #10 on: May 03, 2020, 04:11:28 pm »
Even though -va is very informative, and much can be learned from that (in case you are interested in that sort of thing).

I only use -va if a I need the "ultra-heavy artillery" for debuging, because it produces way too much information most of which is normally of little use and tends to obscure what you're looking for; otherwise I use any of the other -v? options, depending of what I need.

For example, with a simple program "fpc -va myprog.pas" will produce close to a thousand lines of output while "fpc -vt myprog.pas" halves that to less than 500. Still considerable (so I usually pass it through grep or similar to make it even less) but more manageable :)

Say we are trying to see where fpc is looking for to find fpc.cfg; I would use someting like:
Code: Bash  [Select][+][-]
  1. fpc -vt testset.pas | grep -Fi "fpc.cfg" | tee fpc-vt_grep.txt
which in this machine produces just this:
Code: Text  [Select][+][-]
  1. Configfile search: /home/lucamar/.fpc.cfg
  2. Configfile search: /usr/lib/fpc/etc/fpc.cfg
  3. Configfile search: /etc/fpc.cfg
  4. Reading options from file /etc/fpc.cfg
both in the console and, for reference, to the file fpc-vt_grep.txt Way better (and quicker) than having fcpc generate and I having to wade through a thousand lines. :D
« Last Edit: May 03, 2020, 04:20:01 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #11 on: May 03, 2020, 05:59:47 pm »
This is getting a little bit off-topic.
For the record I added -vu to the compiler flags and it shows me the units it tries, that's how I got the output from my first post.

Is there something in the Makefile that causes this maybe?

Bart

PascalDragon

  • Hero Member
  • *****
  • Posts: 2101
  • Compiler Developer
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #12 on: May 03, 2020, 07:53:50 pm »
Is there something in the Makefile that causes this maybe?

Did you rebuild your IDE with the Makefile or from the IDE? If the latter, then this could also be a parameter passed in by the IDE otherwise that is likely to be the case as there aren't that many options left otherwise.

Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #13 on: May 03, 2020, 09:31:12 pm »
Did you rebuild your IDE with the Makefile or from the IDE? If the latter, then this could also be a parameter passed in by the IDE otherwise that is likely to be the case as there aren't that many options left otherwise.

I first noticed this when I rebuild from within IDE, this passes the idemake.cfg file.
So, I started looking into config files of the IDE, but found nothing related.

However then I found out that a simple plain make all in the console also does this, as you can see in reply #6.

Bart

Bart

  • Hero Member
  • *****
  • Posts: 3897
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #14 on: May 03, 2020, 09:43:50 pm »
Code: [Select]
C:\devel\lazarus>make fpc_baseinfo

== Package info ==
Package Name..... lazarus
Package Version.. 2.1.0

== Configuration info ==

FPC.......... C:/devel/fpc/3.2.0/bin/i386-Win32/ppc386.exe
FPC Version.. 3.2.0
Source CPU... i386
Target CPU... i386
Source OS.... win32
Target OS.... win32
Full Source.. i386-win32
Full Target.. i386-win32
SourceSuffix. i386-win32
TargetSuffix. i386-win32
FPC fpmake... C:/devel/fpc/3.2.0/bin/i386-Win32/ppc386.exe

== Directory info ==

Required pkgs... rtl regexpr

Basedir......... C:/devel/lazarus
FPCDir.......... c:/pp
CrossBinDir.....
UnitsDir........ c:/pp/units/i386-win32   <<=========
PackagesDir..... c:/pp

Related in any way to this problem?

Bart

 

TinyPortal © 2005-2018