[SOLVED] FPCUPDELUXE: Failed to build Lazarus fixes using FPC fixes. lazarus / 3-General ---------------------------------------------------------------------- bee · 2020-02-01 07:08 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i fpcupdeluxe: info: FPC native builder: Detected source version FPC: 3.2.0fpcupdeluxe: info: FPC native builder: Using FPC bootstrap compiler with version: 3.0.4fpcupdeluxe: info: Lazarus: WARNING: found modified files.fpcupdeluxe: info: LazarusNativeInstaller (GetModule: Lazarus): Lazarus is at revision: 62558fpcupdeluxe: WARNING: LazarusNativeInstaller (GetModule: Lazarus): Going to patch Lazarus sources !!fpcupdeluxe: info: Lazarus native builder: Detected source version Lazarus: 2.0.7fpcupdeluxe: info: Lazarus native builder: Using FPC compiler with version: 3.2.0fpcupdeluxe: Start of compile error su mmary.freepascal/lazarus/components/lazutils/dynhasharray.pp(173 ,5) Error: (4032) Can't assign values to const variablefpcupdeluxe: Start of compile error summary./freepascal/lazarus/components/la zutils/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variablefpcupdeluxe: Start of compile error summary.dynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stopping/freepascal/lazarus/components/lazutil s/dynhasharray.pp(945,28) Error: (4032) Can't assign values to const variablefpcupdeluxe: Start of compile error summary.Fatal: (1018) Compilation aborteddynhasharray.pp(948) Fatal: (10026) There were 2 errors compiling module, stoppingfpcupdeluxe: Start of compile error summary.Error: /freepascal/fpc/bin/x86_64-darwin/ppcx64 returned an error exitcodefpcupdeluxe: Start of compile error summary.fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom: Lazbuild): make returned error code #512fpcupdeluxe: Done !! Note: is the folder of installation. What’s wrong? Is there any way to achieve what I want using fpcupdeluxe? Thank you. ---------------------------------------------------------------------- Thaddy · 2020-02-01 07:47 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // unit DynHashArray// this code at line 173 should be in J+ mode, it is a assignable typed const.const{$push}{J+}  ItemMemManager: TDynHashArrayItemMemManager = nil;{$pop} ---------------------------------------------------------------------- DonAlfredo · 2020-02-01 07:47 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 · 2020-02-01 07:51 See my proposed fix above. ---------------------------------------------------------------------- DonAlfredo · 2020-02-01 07:58 @Thaddy Thanks ! But I am also getting other errors, that have to be investigated. I will include your fix into the final patch ! ---------------------------------------------------------------------- bee · 2020-02-01 11:38 Quote from: Thaddy on February 01, 2020, 08:47:29 amCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // unit DynHashArray// this code at line 173 should be in J+ mode, it is a assignable typed const.const{$push}{J+}  ItemMemManager: TDynHashArrayItemMemManager = nil;{$pop} It should be: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // unit DynHashArrayvar  ItemMemManager: TDynHashArrayItemMemManager = nil;Writable constant doesn’t make any senses. FPC should disable it by default, at least on ObjFPC mode. ---------------------------------------------------------------------- bee · 2020-02-01 11:42 Quote from: DonAlfredo on February 01, 2020, 08:47:57 amThere 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. ---------------------------------------------------------------------- Thaddy · 2020-02-01 12:09 Quote from: bee on February 01, 2020, 12:38:38 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..... ---------------------------------------------------------------------- bee · 2020-02-01 12:15 Quote from: Thaddy on February 01, 2020, 01:09:43 pmIt 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. ---------------------------------------------------------------------- DonAlfredo · 2020-02-01 12:18 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 · 2020-02-01 12:34 Quote from: bee on February 01, 2020, 01:15:39 pmQuote from: Thaddy on February 01, 2020, 01:09:43 pmIt 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.) ---------------------------------------------------------------------- bee · 2020-02-01 12:58 Quote from: Thaddy on February 01, 2020, 01:34:01 pmwrong 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? Quote from: Thaddy on February 01, 2020, 01:34:01 pmA 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 · 2020-02-01 13:01 Quote from: DonAlfredo on February 01, 2020, 01:18:45 pmIf 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 · 2020-02-01 13:20 Quote from: DonAlfredo on February 01, 2020, 01:18:45 pmIf 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. /Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp (173,5) Error: (4032) Can't assign values to const variable fpcupdeluxe: Start of compile error summary. /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 /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: /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 !! ---------------------------------------------------------------------- DonAlfredo · 2020-02-01 13:31 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. ---------------------------------------------------------------------- bee · 2020-02-01 13:44 Quote from: DonAlfredo on February 01, 2020, 02:31:17 pmI 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. ---------------------------------------------------------------------- DonAlfredo · 2020-02-01 16:19 Its working for me. See screenshot. ---------------------------------------------------------------------- bee · 2020-02-02 00:07 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 /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 /Programs/freepascal/patchfpc/fpcpatch_all_makesearchpath_f ixes_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 /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 /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 /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 /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. /Programs/freepascal/lazarus/components/lazutils/dynhasharray.pp (173,5) Error: (4032) Can't assign values to const variable fpcupdeluxe: Start of compile error summary. /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 /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: /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. ---------------------------------------------------------------------- bee · 2020-02-03 10:20 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.