LongDirtyAnimAlf / Reiniero-fpcup

fpcup (and fpclazup) are installers for FPC (and Lazarus).
54 stars 11 forks source link

Bootstrap compiler generation is not recursive #36

Closed martok closed 6 years ago

martok commented 6 years ago

When trying to build a native Win64 trunk compiler, fpcup 1.4.0k does not correctly detect how to get a bootstrap compiler for that:

fpclazup: info: FPCNativeInstaller (BuildModule: FPC): Building module FPC...
fpclazup: info: FPCNativeInstaller (BuildModule: FPC): We have a FPC source (@ C:\Dev\fpcup\fpc_3_1src) with version: 3.1.1
fpclazup: info: FPCNativeInstaller (BuildModule: FPC): To compile this FPC, we need (required) a compiler with (lowest) version : 3.0.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for a bootstrap compiler from official FPC bootstrap binaries.
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for official FPC bootstrapper with version 3.0.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for (online) bootstrapper x86_64-win64-ppcx64.zip in ftp://ftp.freepascal.org/pub/fpc/dist/3.0.2/bootstrap/
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Found FPC v3.0.2 online bootstrappers: ppc386-i386-freebsd11.bz2,ppc386-i386-win32.zip,ppcx64-x86_64-freebsd10.bz2,ppcx64-x86_64-freebsd11.bz2

fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for official FPC bootstrapper with version 3.0.0
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for (online) bootstrapper x86_64-win64-ppcx64.zip in ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/bootstrap/
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Found FPC v3.0.0 online bootstrappers: i386-win32-ppc386.zip,x86_64-macosx-10.7-ppcx64.tar.bz2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for official FPC bootstrapper with version 2.6.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for (online) bootstrapper x86_64-win64-ppcx64.zip in ftp://ftp.freepascal.org/pub/fpc/dist/2.6.4/bootstrap/
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Found FPC v2.6.4 online bootstrappers: i386&powerpc-macosx-10.4-ppcuniversal.tar.bz2,i386-freebsd10-ppc386.bz2,i386-freebsd8-ppc386.bz2,i386-freebsd9-ppc386.bz2,i386-linux-ppc386.bz2,i386-win32-ppc386.zip,universal-macosx-10.5-ppcuniversal.tar.bz2,x86_64-freebsd-ppcx64.bz2,x86_64-freebsd8-ppcx64.bz2,x86_64-freebsd9-ppcx64.bz2,x86_64-win64-ppcrossx64.zip
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for official FPC bootstrapper with version 2.6.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for (online) bootstrapper x86_64-win64-ppcx64.zip in ftp://ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Found FPC v2.6.2 online bootstrappers: arm-linux-ppcarm.bz2,i386-freebsd7-ppc386.bz2,i386-freebsd8-ppc386.bz2,i386-freebsd9-ppc386.bz2,i386-linux-ppc386.bz2,i386-netbsd-ppc386.bz2,i386-win32-ppc386.zip,powerpc-linux-ppcppc.bz2,powerpc64-linux-ppcppc64.bz2,x86_64-freebsd8-ppcx64.bz2,x86_64-freebsd9.ppcx64.bz2,x86_64-linux-ppcx64.bz2,x86_64-netbsd-ppcx64.bz2,x86_64-openbsd-ppcx64.bz2,x86_64-win64-ppcx64.zip
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Got a bootstrap compiler from official FPC bootstrap sources.
Executing : C:\Dev\fpcup\fpcbootstrap\ppcx64.exe "-iV" (working dir: )
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Check if we already have a bootstrap compiler with version 2.6.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): No correct bootstrapper. Going to download bootstrapper from ftp://ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/x86_64-win64-ppcx64.zip
fpclazup: info: Native downloader: Getting x86_64-win64-ppcx64.zip from ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/
fpclazup: info: TNormalUnzipper: Going to extract files from C:\...\TMP00059.tmp into C:\Users\Sebastian\AppData\Local\Temp\
fpclazup: info: Extracting ppcx64.exe. #1 out of #1
Executing : C:\Dev\fpcup\fpcbootstrap\ppcx64.exe "-iV" (working dir: )
2.6.2
Executing : C:\Dev\fpcup\fpcbootstrap\ppcx64.exe "-iV" (working dir: )
2.6.2
Executing : C:\Dev\fpcup\fpcbootstrap\ppcx64.exe "-iV" (working dir: )
2.6.2
fpclazup: info: FPCNativeInstaller (BuildModule: FPC): We need to build an FPC 3.0.2 intermediate compiler.

It then starts to build a 3.0.2 compiler using 2.6.2 - which obviously doesn't work. The correct solution would be to build all intermediates: use 2.6.2 to build 2.6.4, use 2.6.4 to build 3.0.0, use 3.0.0 to build 3.0.2 and then compile the actual source with that.

martok commented 6 years ago

Additionally, I cannot seem to circumvent this problem by starting with a crosscompiler, because while make distclean gets passed the correct CPU_TARGET=x86_64,OS_TARGET=win64, this is missing for make all install. This means that fpclazup-x86_64-win64 will only work with a native bootstrapper.

LongDirtyAnimAlf commented 6 years ago

New release: 1.6.0k Would you mind testing ?

martok commented 6 years ago

I just saw you have made more changes since then, I will test again when they are merged over here. In the mean time, here's my test results:

fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for official FPC bootstrapper with version 2.6.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking for (online) bootstrapper x86_64-win64-ppcx64.zip in ftp://ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Found FPC v2.6.2 online bootstrappers: [....]
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Got a bootstrap compiler from official FPC bootstrap sources.
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Now looking for a better [version] bootstrap compiler from Github FPCUP(deluxe) releases.
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 3.0.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 3.0.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 3.0.0
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.6.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.6.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.6.0
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.4.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.4.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.4.0
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.2.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.2.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.2.0
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.1.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.1.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.0.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.0.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 2.0.0
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 1.9.8
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 1.9.6
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 1.9.4
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 1.9.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with version 1.9.0
Executing: C:\Dev\fpcup\fpcbootstrap\ppcx64.exe "-iV" (working dir: )
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): Check if we already have a bootstrap compiler with version 2.6.2
fpclazup: info: FPCNativeInstaller (CheckAndGetTools): No correct bootstrapper. Going to download bootstrapper from ftp://ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/x86_64-win64-ppcx64.zip
fpclazup: info: Native downloader: Getting x86_64-win64-ppcx64.zip from ftp.freepascal.org/pub/fpc/dist/2.6.2/bootstrap/

Something appears to be wrong with the FPCUP(deluxe) bootstrapper detection?

Substituting a renamed ppcrossx64 does work.

LongDirtyAnimAlf commented 6 years ago

As you can see, fpcup tries to find a better bootstrapper from FPCUP (through GitHub) bootstrap binaries. This should have succeeded. I do not know if you are blocked from GitHub, or that https is not working correct.

https://github.com/newpascal/fpcupdeluxe/releases/tag/bootstrappers_v1.0 Do you succeed in manual download a bootstrapper from above link ?

martok commented 6 years ago

There is indeed something wrong with the SSL support. When I start fpcup from within Lazarus, it downloads openssl (but a 32 bit version for win64? That seems wrong. Also, it does not seem to like that I have the 32bit and 64bit fpcup next to each other in the same folder). I manually deleted the existing ssleay+libssl, they got redownloaded and the bootstrapper was found. Needs some form of explicit SSL error handling/reporting?

LongDirtyAnimAlf commented 6 years ago

The latest release should have solved all pending issues. Please re-open if needed.