Recent

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

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #15 on: May 04, 2020, 02:11:36 am »
Related in any way to this problem?
Most probably yes.

If i remember correctly FPCDir is either an environment variable that gets used for substitution in the makefile or the compiler itself checks for this environment variable. Setting such variable thus influences the build-script. Lazarus codetools seems to use the same naming as well.

Just do a grep for it in the fpc source-tree and you can spot the usage of this variable.

The plot thickens :-)

PS:
This is getting a little bit off-topic.
Is it really ?

Although you perhaps might believe otherwise, it is still related to the topic on how to approach such situation in a quick manner.

In that regards i thank @lucamar for his neat grep trick. For some reason I never thought about grepping it directly.

On the other hand, i make my builds unattended doing it as clean as possible and when my script encounters an error it then re-tries failed build automatically with -va parameter and stores the output. That way i'm f.e. able to directly see what fpc.cfg was loaded and what options where set for that specific part that failed.

These days I have but one fpc.cfg file to rule them all, no matter which version/revision of the compiler.

But... it is your thread so i'll keep quiet if you prefer. Just wanted to say thank you to lucamar.

Quote
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.
Yeah, but that still does not tell you where it came from. First thing that I always try to rule out are dangling/overlooked fpc.cfg file (and where in the build process does it get loaded), or in your case where the heck does this option/setting originate from.
« Last Edit: May 04, 2020, 02:45:56 am by TRon »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #16 on: May 04, 2020, 08:53:34 am »
Related in any way to this problem?
Most probably yes.

If i remember correctly FPCDir is either an environment variable that gets used for substitution in the makefile or the compiler itself checks for this environment variable. Setting such variable thus influences the build-script. Lazarus codetools seems to use the same naming as well.

Just do a grep for it in the fpc source-tree and you can spot the usage of this variable.

The plot thickens :-)

Indeed. Now we need to find out where this comes from.

PS:
This is getting a little bit off-topic.
Is it really ?

Although you perhaps might believe otherwise, it is still related to the topic on how to approach such situation in a quick manner.

Well, it is in so far offtopic that it's not about the compiler finding some unwanted directory, but that someone already passes such a directory to the compiler (so it can already be seen in the command line that is passed to the compiler). Thus the verbosity switches aren't useful for this case.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #17 on: May 04, 2020, 09:21:55 am »
Maye discuss this further in the bugtracker?
That way all relevant info will be in one place.

Bart

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #18 on: May 04, 2020, 09:22:39 am »
PS:
This is getting a little bit off-topic.
Is it really ?

Although you perhaps might believe otherwise, it is still related to the topic on how to approach such situation in a quick manner.

Well, it is in so far offtopic that it's not about the compiler finding some unwanted directory, but that someone already passes such a directory to the compiler (so it can already be seen in the command line that is passed to the compiler). Thus the verbosity switches aren't useful for this case.
That is fair enough :-)

In my defence (?) though, at least i did not know that yet at the time Bart made that comment. It could still have been a not expected fpc.cfg where that particular option was defined.

That is, unless there is a way to see that from (for instance) the particular order in which the buildscript passes along the parameters to the compiler. If there is then i did not notice or am unaware of such a thing.

I am aware though that i could have concluded that (from user Bart's posts thereafter and) before i posted that comment. My apologies if it did upset someone. It was not my intention to cause any grieve.


Anyhows, it also indicates that user Bart's issue is not the same as the one i encountered (stray .cfg file originating from Lazarus) as that was what i eventually suspected.

What would be the best cause of action now ? On the hunt for a FPCDir define inside the build system that was (unintentionally) constructed/assigned wrongly ?

Could it also be caused by performing several builds directly after another ? In which case the FPCDir setting could have been a leftover from a previous build ?

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #19 on: May 04, 2020, 10:31:16 am »
Well... there are these makefiles in lazarus packager and component dirs ... which has some hardcode C:\PP somewhere:
Code: [Select]
ifeq ($(FPCDIR),wrong)
  ifdef inUnix
    override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
    ifeq ($(wildcard $(FPCDIR)/units),)
      override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
    endif
  else
    override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
    override FPCDIR:=$(FPCDIR)/..
    ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
      override FPCDIR:=$(FPCDIR)/..
      ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
        override FPCDIR:=$(BASEDIR)
        ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
          override FPCDIR=c:/pp
        endif
      endif
    endif
  endif
endif
Hopefully i did not messed up the indentation :-)

@Bart: try to set that to something utterly worthless so that it is visible enough in the output of the build. I missed what the first makefile was that failed for you.

Unfortunately i do not know enough about debugging makefiles properly ...
« Last Edit: May 04, 2020, 11:10:00 am by TRon »

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #20 on: May 04, 2020, 11:41:21 am »
Could it also be caused by performing several builds directly after another ? In which case the FPCDir setting could have been a leftover from a previous build ?

Not likely, since on the other machine I closed the console every time before proceeding to the neext step.
If the build process would have set some environment variable, that would have been lost already.

Bart

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #21 on: May 04, 2020, 01:26:54 pm »
PS:
This is getting a little bit off-topic.
Is it really ?

Although you perhaps might believe otherwise, it is still related to the topic on how to approach such situation in a quick manner.

Well, it is in so far offtopic that it's not about the compiler finding some unwanted directory, but that someone already passes such a directory to the compiler (so it can already be seen in the command line that is passed to the compiler). Thus the verbosity switches aren't useful for this case.
That is fair enough :-)

In my defence (?) though, at least i did not know that yet at the time Bart made that comment. It could still have been a not expected fpc.cfg where that particular option was defined.

No, cause this is what he provided in his first post:

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.pp
That is already the commandline that FPC is called with. And there already is the offending -Fuc:/pp/units/i386-win32/rtl.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #22 on: May 04, 2020, 01:33:29 pm »
Again: I think it is is better to move the discussion to the bugtracker.

Bart

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #23 on: May 04, 2020, 01:37:56 pm »
No, cause this is what he provided in his first post:

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.pp
That is already the commandline that FPC is called with. And there already is the offending -Fuc:/pp/units/i386-win32/rtl.
Wait, what !?

I must be missing something here. I do not see a -n on that line. Am i wrong in believing that @ is only adding to existing config file ?

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #24 on: May 04, 2020, 01:48:43 pm »
Again: I think it is is better to move the discussion to the bugtracker.

Bart
In that case i would have nothing to contribute because current discussion (my side) is imho not bugtracker-worthy  :D

fwiw: i can reproduce, it just doesn't affect my setup because c:\pp simply does not exist on my system. I have too less knowledge on makefile variable substitution to be able to comprehend why it doesn't pick up on the path that it obvious is able to obtain from the compiler (which it is able to find).

Good luck though !

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Strange problem: make invokes fpc with unwanted -Fu option
« Reply #25 on: May 04, 2020, 02:17:50 pm »
OK, thanks for your input here though!
I'm locking this topic, so we can continue  the discussion to the bugtracker.

Bart

 

TinyPortal © 2005-2018