Lazarus

Installation => General => Topic started by: bee on February 01, 2020, 08:08:57 am

Title: [SOLVED] FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 08:08:57 am
I’m trying to build latest Lazarus fixes (not trunk) using latest FPC fixes (not trunk) or Lazarus 2.0 fixes using FPC 3.2 fixes on Mac Mojave. But it failed while it should not.

Here’s some error messages from fpcUpDeluxe before it failed:

Code: Text  [Select][+][-]
  1. fpcupdeluxe: info: FPC native builder: Detected source version FPC: 3.2.0
  2. fpcupdeluxe: info: FPC native builder: Using FPC bootstrap compiler with version: 3.0.4
  3. fpcupdeluxe: info: Lazarus: WARNING: found modified files.
  4. fpcupdeluxe: info: LazarusNativeInstaller (GetModule: Lazarus): Lazarus is at revision: 62558
  5. fpcupdeluxe: WARNING: LazarusNativeInstaller (GetModule: Lazarus): Going to patch Lazarus sources !!
  6. fpcupdeluxe: info: Lazarus native builder: Detected source version Lazarus: 2.0.7
  7. fpcupdeluxe: info: Lazarus native builder: Using FPC compiler with version: 3.2.0
  8. fpcupdeluxe: Start of compile error summary.
  9. <home>freepascal/lazarus/components/lazutils/dynhasharray.pp(173,5) Error: (4032) Can't assign values to const variable
  10. fpcupdeluxe: Start of compile error summary.
  11. <home>/freepascal/lazarus/components/lazutils/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variable
  12. fpcupdeluxe: Start of compile error summary.
  13. dynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stopping
  14. <home>/freepascal/lazarus/components/lazutils/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variable
  15. fpcupdeluxe: Start of compile error summary.
  16. Fatal: (1018) Compilation aborted
  17. dynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stopping
  18. fpcupdeluxe: Start of compile error summary.
  19. Error: <home>/freepascal/fpc/bin/x86_64-darwin/ppcx64 returned an error exitcode
  20. fpcupdeluxe: Start of compile error summary.
  21. fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom: Lazbuild): make returned error code #512
  22. fpcupdeluxe: Done !!

Note: <home> is the folder of installation.

What’s wrong? Is there any way to achieve what I want using fpcupdeluxe?

Thank you.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: Thaddy on February 01, 2020, 08:47:29 am
Code: Pascal  [Select][+][-]
  1. // unit DynHashArray
  2. // this code at line 173 should be in J+ mode, it is a assignable typed const.
  3. const
  4. {$push}{J+}
  5.   ItemMemManager: TDynHashArrayItemMemManager = nil;
  6. {$pop}
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: DonAlfredo on February 01, 2020, 08:47:57 am
I am still investigating this.
Up until now, I have to find the fix.

There were some recent changes that went into FPC fixes regarding cocoa.
Some of them did introduce changes that are not (yet) compatible with Lazarus.

I will inform you about any progress.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: Thaddy on February 01, 2020, 08:51:03 am
See my proposed fix above.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: DonAlfredo on February 01, 2020, 08:58:26 am
@Thaddy
Thanks !
But I am also getting other errors, that have to be investigated.
I will include your fix into the final patch !
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 12:38:38 pm
Code: Pascal  [Select][+][-]
  1. // unit DynHashArray
  2. // this code at line 173 should be in J+ mode, it is a assignable typed const.
  3. const
  4. {$push}{J+}
  5.   ItemMemManager: TDynHashArrayItemMemManager = nil;
  6. {$pop}

It should be:
Code: Pascal  [Select][+][-]
  1. // unit DynHashArray
  2. var
  3.   ItemMemManager: TDynHashArrayItemMemManager = nil;
Writable constant doesn’t make any senses. FPC should disable it by default, at least on ObjFPC mode.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 12:42:37 pm
There were some recent changes that went into FPC fixes regarding cocoa.
Some of them did introduce changes that are not (yet) compatible with Lazarus.
Yes, this problem prevents me using latest fixes. Thank you.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: Thaddy on February 01, 2020, 01:09:43 pm

Writable constant doesn’t make any senses. FPC should disable it by default, at least on ObjFPC mode.
It should be ENabled to achieve proper result. The declaration writes it as nil, afterwards it needs to be assigned......
So it is precisely the other way around. I thought you knew.....
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 01:15:39 pm
It should be ENabled to achieve proper result. The declaration writes it as nil, afterwards it needs to be assigned......
So it is precisely the other way around. I thought you knew.....
That’s why it should be a var, not a const. I thought you knew.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: DonAlfredo on February 01, 2020, 01:18:45 pm
Alright. Here you go.
Two patches included. One for FPC. The other for Lazarus.

If you use latest fpcupdeluxe, just drop the:
FPC patch into "patchfpc" directory.
Lazarus patch into "patchlazarus" directory.

Rebuild FPC and Lazarus.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: Thaddy on February 01, 2020, 01:34:01 pm
It should be ENabled to achieve proper result. The declaration writes it as nil, afterwards it needs to be assigned......
So it is precisely the other way around. I thought you knew.....
That’s why it should be a var, not a const. I thought you knew.
wrong again. It is actually a singleton after assignment. The same happens with e.g. the memorymanager entrypoints in system.pas.
A var would be way to much scope (although it is a great deal a notational issue, const is more correct here.)
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 01:58:17 pm
wrong again. It is actually a singleton after assignment. The same happens with e.g. the memorymanager entrypoints in system.pas.
When I said writable constant doesn’t make senses, I was talking about the semantic. A constant shouldn’t be allowed to be changed once it contains a value. If you need to change the value later then it should be a variable, not a constant. Hence, writeable const in Pascal is semantically wrong.

But since it’s there since the Turbo Pascal era as the legacy from Borland and too much codes depend on it, we can do nothing but maintain that semantic. However, as we have the option to disable it (using $J- compiler switch), we have a choice to disable it on new codes and using initialized variable instead. Even Delphi have had disable it by default. Why didn’t FPC too?

A var would be way to much scope (although it is a great deal a notational issue, const is more correct here.)
Why var and const have different scope?
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 02:01:54 pm
If you use latest fpcupdeluxe, just drop the:
FPC patch into "patchfpc" directory.
Lazarus patch into "patchlazarus" directory.
Those will go to the next official release, right?

I’ll test them soon. Thank you.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 02:20:47 pm
If you use latest fpcupdeluxe, just drop the:
FPC patch into "patchfpc" directory.
Lazarus patch into "patchlazarus" directory.

Rebuild FPC and Lazarus.
Nope, it still fails. Here’s the error messages:

Code: [Select]
fpcupdeluxe: info: Lazarus: WARNING: found modified files.
fpcupdeluxe: info: LazarusNativeInstaller (GetModule: Lazarus): Lazarus is at revision: 62558
fpcupdeluxe: WARNING: LazarusNativeInstaller (GetModule: Lazarus): Going to patch Lazarus sources !!
fpcupdeluxe: info: Lazarus native builder: Detected source version Lazarus: 2.0.7
fpcupdeluxe: info: Lazarus native builder: Using FPC compiler with version: 3.2.0
fpcupdeluxe: Start of compile error summary.
<home>/Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp(173,5) Error: (4032) Can't assign values to const variable
fpcupdeluxe: Start of compile error summary.
<home>/Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variable
fpcupdeluxe: Start of compile error summary.
dynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stopping
<home>/Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variable
fpcupdeluxe: Start of compile error summary.
Fatal: (1018) Compilation aborted
dynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stopping
fpcupdeluxe: Start of compile error summary.
Error: <home>/Programs/freepascal/fpc/bin/x86_64-darwin/ppcx64 returned an error exitcode
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom: Lazbuild): make returned error code #512
fpcupdeluxe: Done !!
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: DonAlfredo on February 01, 2020, 02:31:17 pm
I left this error open, due to the discussing you had with Thaddy.
You can solve. And report this as a bugger towards the Lazarus team.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 01, 2020, 02:44:32 pm
I left this error open, due to the discussing you had with Thaddy.
You can solve. And report this as a bugger towards the Lazarus team.

What’s the relevancy of this error with my discussion with Thaddy? You have the right to do whatever you like to fix the errors, even if you’re using writeable constant. My discussion is about writeable constant semantic, not about how to fix the errors.

I’ve posted the same problem in Lazarus list and they said FPC 3.2 fixes can be used to build Lazarus 2.0.6 fixes. I believe it because I’ve done it before a few versions ago, though I did it manually. Since we now have FPCUpDeluxe, I want to use it as it makes the process a lot more easier.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: DonAlfredo on February 01, 2020, 05:19:49 pm
Its working for me.
See screenshot.
Title: Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 02, 2020, 01:07:53 am
Well… unfortunately, it’s not working for me.

Here’s the complete error messages from FPCUpDeluxe:
Code: [Select]
fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC is at revision: 44080
fpcupdeluxe: WARNING: FPCNativeInstaller (GetModule: FPC): Going to patch FPC sources !!
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patching with <home>/Programs/freepascal/patchfpc/fpc_cocoa_fixes_3_2.patch failed.
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patch output: patching file packages/cocoaint/fpmake.pp
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patching with <home>/Programs/freepascal/patchfpc/fpcpatch_all_makesearchpath_fixes_3_2.patch failed.
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patch output: patching file Makefile
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patching with <home>/Programs/freepascal/patchfpc/fpcpatch_darwin_makepackages_fixes_3_2.patch failed.
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patch output: patching file packages/Makefile
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patching with <home>/Programs/freepascal/patchfpc/fpcpatch_dragonfly_fixes_3_2.patch failed.
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patch output: patching file rtl/dragonfly/Makefile
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patching with <home>/Programs/freepascal/patchfpc/fpcpatch_freebsd_fixes_3_2.patch failed.
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patch output: patching file rtl/bsd/ostypes.inc
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patching with <home>/Programs/freepascal/patchfpc/fpcpatch_linux_linker_fixes_3_2.patch failed.
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: FPCNativeInstaller (GetModule: FPC): FPC patch output: patching file compiler/systems/t_linux.pas
fpcupdeluxe: info: FPC native builder: Detected source version FPC: 3.2.0
fpcupdeluxe: info: FPC native builder: Using FPC bootstrap compiler with version: 3.0.4
fpcupdeluxe: info: Lazarus: WARNING: found modified files.
fpcupdeluxe: info: LazarusNativeInstaller (GetModule: Lazarus): Lazarus is at revision: 62558
fpcupdeluxe: WARNING: LazarusNativeInstaller (GetModule: Lazarus): Going to patch Lazarus sources !!
fpcupdeluxe: info: Lazarus native builder: Detected source version Lazarus: 2.0.7
fpcupdeluxe: info: Lazarus native builder: Using FPC compiler with version: 3.2.0
fpcupdeluxe: Start of compile error summary.
<home>/Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp(173,5) Error: (4032) Can't assign values to const variable
fpcupdeluxe: Start of compile error summary.
<home>/Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variable
fpcupdeluxe: Start of compile error summary.
dynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stopping
<home>/Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variable
fpcupdeluxe: Start of compile error summary.
Fatal: (1018) Compilation aborted
dynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stopping
fpcupdeluxe: Start of compile error summary.
Error: <home>/Programs/freepascal/fpc/bin/x86_64-darwin/ppcx64 returned an error exitcode
fpcupdeluxe: Start of compile error summary.
fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom: Lazbuild): make returned error code #512
fpcupdeluxe: Done !!

And below is the screenshot of FPCUpDeluxe app.
Title: Re: [SOLVED] FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
Post by: bee on February 03, 2020, 11:20:06 am
Problem solved. After applying the above patches, you have to build FPC first. Once it’s done, then build Lazarus. It should work though I don’t know why. :D
TinyPortal © 2005-2018