Recent

Author Topic: [SOLVED] FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.  (Read 4130 times)

bee

  • Sr. Member
  • ****
  • Posts: 393
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.
« Last Edit: February 03, 2020, 11:17:53 am by bee »
-Bee-

A long time pascal lover.

Thaddy

  • Hero Member
  • *****
  • Posts: 10287
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #1 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}
« Last Edit: February 01, 2020, 08:50:38 am by Thaddy »
I am more like donkey than shrek

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1324
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #2 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.

Thaddy

  • Hero Member
  • *****
  • Posts: 10287
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #3 on: February 01, 2020, 08:51:03 am »
See my proposed fix above.
I am more like donkey than shrek

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1324
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #4 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 !

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #5 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.
« Last Edit: February 01, 2020, 12:40:39 pm by bee »
-Bee-

A long time pascal lover.

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #6 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.
-Bee-

A long time pascal lover.

Thaddy

  • Hero Member
  • *****
  • Posts: 10287
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #7 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.....
I am more like donkey than shrek

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #8 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.
-Bee-

A long time pascal lover.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1324
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #9 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.

Thaddy

  • Hero Member
  • *****
  • Posts: 10287
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #10 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.)
I am more like donkey than shrek

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #11 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?
-Bee-

A long time pascal lover.

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #12 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.
-Bee-

A long time pascal lover.

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #13 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 !!
-Bee-

A long time pascal lover.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1324
Re: FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes.
« Reply #14 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.

 

TinyPortal © 2005-2018