Recent

Author Topic: Lazarus "main" fails to build on macOS Intel and ARM64  (Read 2119 times)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Lazarus "main" fails to build on macOS Intel and ARM64
« on: March 10, 2022, 11:01:29 am »
Code: Bash  [Select][+][-]
  1. /Applications/Xcode.app/Contents/Developer/usr/bin/make -C components/chmhelp/lhelp distclean
  2. /bin/rm -f lhelp lhelp.o lhelp.bclibplhelp.a libimplhelp.a
  3. /bin/rm -f lib/aarch64-darwin/basecontentprovider.o lib/aarch64-darwin/chmcontentprovider.o lib/aarch64-darwin/chmdataprovider.o lib/aarch64-darwin/chmspecialparser.o lib/aarch64-darwin/filecontentprovider.o lib/aarch64-darwin/lhelp.o lib/aarch64-darwin/lhelpcore.o lib/aarch64-darwin/lhelpstrconsts.o lib/aarch64-darwin/basecontentprovider.ppu lib/aarch64-darwin/chmcontentprovider.ppu lib/aarch64-darwin/chmdataprovider.ppu lib/aarch64-darwin/chmspecialparser.ppu lib/aarch64-darwin/filecontentprovider.ppu lib/aarch64-darwin/lhelpcore.ppu lib/aarch64-darwin/lhelpstrconsts.ppu   lib/aarch64-darwin/lhelpcore.lfm lib/aarch64-darwin/lhelp.or lib/aarch64-darwin/lhelp.res  
  4. /bin/rm -rf units
  5. /bin/rm -rf bin
  6. /bin/rm -f *.o *.bc *.ppu *.rst *.s *.a *.so *.ppl
  7. /bin/rm -rf *.sl
  8. /bin/rm -f fpcmade.* Package.fpc *.fpm
  9. /bin/rm -f   script*.res link*.res *_script.res *_link.res
  10. /bin/rm -f ./ppas.sh *_ppas.sh ppas.sh ppaslink.sh
  11. /Applications/Xcode.app/Contents/Developer/usr/bin/make -C examples clean
  12. make[1]: *** No rule to make target `clean'.  Stop.
  13. make: *** [purge] Error 2

Same error on Intel and ARM64 macOS.

Related to recent examples commits.
« Last Edit: March 10, 2022, 11:12:53 am by trev »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4542
  • I like bugs.
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #1 on: March 10, 2022, 12:58:38 pm »
make -C examples clean
OK, the projects were structured into subdirectories.
I am away from my development computer now, I will study the issue soon...

[Edit]@Trev, what is the command that you actually run?
I can do "make clean all" for Lazarus sources without errors.
Typing "make -C examples clean" gives the error but I don't need to type it.
« Last Edit: March 11, 2022, 04:00:47 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #2 on: March 11, 2022, 10:53:30 pm »
The commands my daemons run to make my daily Sourceforge macOS aarch64 and Intel Lazarus snapshots is respectively:

Code: Bash  [Select][+][-]
  1. make clean distclean all LCL_PLATFORM=cocoa CPU_TARGET=aarch64 bigide
  2. make clean distclean all LCL_PLATFORM=cocoa CPU_TARGET=x86_64 bigide

This has worked for the last 4 11 months.
« Last Edit: March 12, 2022, 12:23:39 am by trev »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #3 on: March 11, 2022, 11:01:20 pm »

Quote
   clean          deletes files that 'bigide' creates. It does not clean up all possible
                    targets. Clean other target: make clean LCL_PLATFORM=qt
   distclean      Clean all targets and common leftovers.

The culprit is distclean. I assume there's a makefile change needed.

dbannon

  • Hero Member
  • *****
  • Posts: 3192
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #4 on: March 12, 2022, 12:29:32 am »
Trev, as the origin of those example changes, maybe it is down to me ?

I am sure your script is not expecting a Makefile in each and every directory ?  That has not been the case in the past, there is no point in making all those examples in bulk.

But there was a Makefile in ~/examples itself.  Seemed to me totally redundant and it was not being called, in my tests, by, eg, a "make clean bigide".

It appears to be intended to build "simple" examples and, as you found, clean up afterwards. Would require some cleaning up ! The definition of "simple" examples seems to be the ones loose in the ~/examples dir, not the ones in their own dir. I have either removed or moved all such examples.

Many were demonstrating how to use the various components before we had the ObjectInspector and are generally irrelevant now. As they were first seen, they were causing a lot of confusion with new users. I have retained a few to demonstrate the technique in case some has a special requirement but its sure not how we encourage people to work generally.

If its really necessary, maybe a dummy Makefile that does nothing, is the answer ?

Note that ~/components/examplewindow does not have a Makefile either, its a standalone Package and, IMHO, should not have a Makefile. But ...

Davo

EDIT : Post post thought, previously, building all those quite unnecessary examples and shipping them with the Install Package ? Undesirable.
« Last Edit: March 12, 2022, 12:35:03 am by dbannon »
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #5 on: March 12, 2022, 12:52:54 am »
My makefile knowledge and experience is limited to very simple cases when programming in C. However, I assume the current issue is because you removed the examples makefile but did not check that it was being called when distclean was being used in a parent makefile. I could always be wrong...

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #6 on: March 12, 2022, 01:05:21 am »
Sure enough, this patch to the parent makefile fixes the issue:

Quote
diff --git a/Makefile b/Makefile
index e76160faab..dac58d6eab 100644
--- a/Makefile
+++ b/Makefile
@@ -3836,7 +3836,6 @@ purge:
        $(MAKE) -C components distclean
        $(MAKE) -C tools distclean
        $(MAKE) -C components/chmhelp/lhelp distclean
-   $(MAKE) -C examples clean
 cleanall: purge
 distclean: purge
 installbase:

Note: There's another reference to the same line also in the Makefile. I did not remove it, so there is still an issue, just not when compiling with the command line I use.
« Last Edit: March 12, 2022, 01:27:59 am by trev »

dbannon

  • Hero Member
  • *****
  • Posts: 3192
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #7 on: March 12, 2022, 07:19:20 am »
Yes, Makefiles are not really mean to be read, just written.

I suspect the change should be to Makefile.fpc rather than to the Makefile which is built, as I understand it, from Makefile.fpc.

Makefile.fpc appears to call examples twice, once to build the 'simple' examples and once to clean them.  I suggest we need neither because -

1. There are no more examples that fit that 'simple' qualifier.
2. Its quite silly building examples in bulk, just what is the use case ?
3. Cleaning is no longer appropriate because with the new Examples manager, examples are not built in the src tree but are moved to another area first. This has two benefits, is sure to be writable and user can choose to 'refresh' it at some time if they have played with and made a mess of the code.

So, summary, I suggest removing all reference to "examples" from Makefile.fpc

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4542
  • I like bugs.
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #8 on: March 12, 2022, 10:47:12 am »
Yes, I can reproduce with target distclean.

Note that ~/components/examplewindow does not have a Makefile either, its a standalone Package and, IMHO, should not have a Makefile. But ...
It must have a Makefile when it is part of target BigIde.

I suspect the change should be to Makefile.fpc rather than to the Makefile which is built, as I understand it, from Makefile.fpc.
Exactly, and the tools to generate Makefiles should be taken from FPC trunk. Somehow I always failed with the task. Mattias has maintained the build system mostly.

Quote
So, summary, I suggest removing all reference to "examples" from Makefile.fpc
Yes, I am planning to do that. In some earlier discussion I remember developers considered it an important feature, saying some people want to build all examples at one go and then test them. If that is really needed, the new Example Projects GUI can have such a feature.

[Edit] Please test with commit 23fca0b552 for "make distclean". Commit bc0b58a5bb adds Makefile.fpc and Makefile for the new package.
Commit c82846d50fb1 adds ExampleProjects package to BigIde target.
« Last Edit: March 13, 2022, 10:03:31 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dbannon

  • Hero Member
  • *****
  • Posts: 3192
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #9 on: March 12, 2022, 11:06:41 am »
Yeah, I also can replicate the problem with distclean, I am not sure why 'clean' does not also trigger it.

I have manually edited Makefile, removed both calls to "-C examples/" and tested using bigide, all, clean, distclean and install.  All good.

I have been unable to make a new Makefile using fpcmake and Makefile.fpc however so am not quite ready to start editing Makefile.fpc - and thats whats needed.

You mention "Exactly, and the tools to generate Makefiles should be taken from FPC trunk. " - perhaps thats my problem ?  I am not using fpcmake from trunk ....

Yes, I quite agree, that target to make a small inappropriate subset of examples if far more than its worth.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 3192
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #10 on: March 12, 2022, 11:56:26 am »

Nope, fpcmake is not cooperating.  I am not sure how to tell it where its rtl is, the compilers normally know ....
Code: Pascal  [Select][+][-]
  1. dbannon@dell:~/bin/Lazarus/TEST$ fpcmake -Tall
  2. Processing Makefile.fpc
  3. Error: Target "linux", package "rtl" not found

I have built a current main, compiled with fpc322 and am in a dir with lazarus source including the Makefile.fpc -

Code: Bash  [Select][+][-]
  1. dbannon@dell:~/bin/Lazarus/TEST$ which fpcmake
  2. /home/dbannon/bin/FPC/fpc-main/bin/fpcmake
  3.  
  4. dbannon@dell:~/bin/Lazarus/TEST$ ls -la Makefile*
  5. -rw-rw-r-- 1 dbannon dbannon 116393 Mar 12 19:31 Makefile
  6. -rw-rw-r-- 1 dbannon dbannon  15839 Mar 12 09:59 Makefile.fpc
  7. -rw-rw-r-- 1 dbannon dbannon 116451 Mar 12 18:29 Makefile.old
  8.  
  9. dbannon@dell:~/bin/Lazarus/TEST$ fpc -iVSPTPSOTO
  10. 3.3.1 x86_64 x86_64 linux linux


Neither the man page nor the wiki page mention anything about how fpcmake gets its config.  There is a fpcmake.ini but it appears to have mostly make template stuff and is compiled in anyway.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 3192
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus "main" fails to build on macOS Intel and ARM64
« Reply #11 on: March 13, 2022, 11:06:14 am »
Juha has commited a fix, 23fca0b5

 :)

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018