Recent

Author Topic: Build a fresh FPC and Lazarus everyday.  (Read 7279 times)

stocki

  • Full Member
  • ***
  • Posts: 144
Build a fresh FPC and Lazarus everyday.
« on: November 29, 2015, 09:58:35 am »
@echo on

:: Build a fresh FPC+LAZ from SVN everyday
::    Based on http://www.getlazarus.org/

::prerequisites
:: 1. Internet connection
:: 2. Installed SVN (e.g. Tortoise SVN) from http://tortoisesvn.net/
:: 3. Installed bootstrap compiler FPC 3.0.0 at %BASE%\bootstrap from e.g. ftp://wiki.freepascal.org/pub/fpc/dist/3.0.0/i386-win32/fpc-3.0.0.i386-win32.exe


set BASE=c:\FpDev
set BOOTSTRAP=%BASE%\bootstrap\bin\i386-win32
set NEWCOMPILER=%BASE%\fpc\bin\i386-win32

::---SVN---

cd %BASE%
svn co http://svn.freepascal.org/svn/fpc/trunk fpc
if errorlevel 1 goto failed
svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
if errorlevel 1 goto failed

pause

::---FPC---

cd %BASE%
cd fpc
::%BOOTSTRAP%\make clean
%BOOTSTRAP%\make all
if errorlevel 1 goto failed

::---Make install---
%BOOTSTRAP%\make install INSTALL_PREFIX=%BASE%\fpc
if errorlevel 1 goto failed

::---FPC Win64---
%BOOTSTRAP%\make crossinstall CPU_TARGET=x86_64 OS_TARGET=win64 INSTALL_PREFIX=%BASE%\fpc
if errorlevel 1 goto failed

::---FPC Lin32---
%BOOTSTRAP%\make crossinstall CPU_TARGET=i386   OS_TARGET=linux INSTALL_PREFIX=%BASE%\fpc
if errorlevel 1 goto failed

::---Make cfg---
cd %NEWCOMPILER%
fpcmkcfg -d basepath=%BASE%\fpc -o .\fpc.cfg
if errorlevel 1 goto failed

cd %BASE%
set PATH=%NEWCOMPILER%;%PATH%
::fpc -iV

::---Lazarus---

cd %BASE%
cd lazarus
::%BOOTSTRAP%\make clean
%BOOTSTRAP%\make all
::%BOOTSTRAP%\make bigide OPT="-dWIN9XPLATFORM -gl -gw"
if errorlevel 1 goto failed

call %BASE%\lazarus\startlazarus.exe

::---end---

goto exit

:failed
color 0C
echo ERROR!!!

:exit

pause

« Last Edit: December 25, 2015, 02:01:28 pm by stocki »

Silvernine

  • New member
  • *
  • Posts: 8
Re: Build a fresh FPC and Lazarus everyday.
« Reply #1 on: November 30, 2015, 07:15:52 am »
Great script! One issue to note though it probably does not affect everyone is the line:
::%BOOTSTRAP%\make bigide OPT="-dWIN9XPLATFORM -gl -gw"

For some odd reason, even though it's commented out, my computer still attempted to run that line which cause the script to fail. I easily fixed that by changing the :: to a REM which still signify that line as a comment. Odd issue but that's how I solved it. Or you can merely remove that line if you don't need it.

This script is so much easy than my own way of doing it manually and in my case, much easier than fpcup which I just cannot get it working at all. Even the newest version that just came out always end up giving me an error 64. Simple is best in this case since I merely want the most up-to-date trunk compilation. Thank you!

stocki

  • Full Member
  • ***
  • Posts: 144
Re: Build a fresh FPC and Lazarus everyday.
« Reply #2 on: November 30, 2015, 08:33:02 am »
corrected!  :)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Build a fresh FPC and Lazarus everyday.
« Reply #3 on: November 30, 2015, 12:53:58 pm »
Anybody who offers and promotes such scripts should also mention that FPC trunk is not needed for Lazarus trunk and vice-versa.
Based on the number of support questions many new users have a wrong impression that they need trunk versions of both.

There was a discussion about it in mailing list with fpcup's current maintainer :
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Install-FPC-and-Lazarus-from-source-td4045670.html

As I wrote there it almost never makes sense for anybody to update both FPC and Lazarus trunks.
Updating both of them fits only for geeks who get their kicks from solving the potential compilation problems. For them it is OK of course.
Reasoning:

- People who follow and test latest FPC features use command line programs for testing. They use Lazarus for editing, code completion etc. but don't need to update it all the time.

- People who follow or participate in Lazarus development (like me) do not update FPC often. Lazarus must support 2 latest FPC releases, it cannot use the very latest syntax additions in any case. Those people get Lazarus trunk directly from SVN repo ("svn up"). It is so easy that no extra tool or script is needed.

New users that come from Delphi may want to look at latest development in Lazarus trunk. For them "svn" command is the right tool.
I honestly don't understand the obsession for complex scripts for a simple task.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Silvernine

  • New member
  • *
  • Posts: 8
Re: Build a fresh FPC and Lazarus everyday.
« Reply #4 on: November 30, 2015, 01:33:51 pm »
@JuhaManneinen
That's a very good point! Even I modified this script a bit just so that I have the latest Lazarus at all times except for FPC which I simply leave it at the stable branch (which is now 3.0 with fixes).

But sometimes it's fun/hell to have both (just like you said as well haha).

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Build a fresh FPC and Lazarus everyday.
« Reply #5 on: November 30, 2015, 04:55:20 pm »
That's a very good point! Even I modified this script a bit just so that I have the latest Lazarus at all times except for FPC which I simply leave it at the stable branch (which is now 3.0 with fixes).

Ok, but using a script for that is even more dummy!
The script has :
  svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
That command is needed only ONCE. After the first time you must run "svn up" instead. Please tell me why would you need a script for running "svn up"?
Also the build command "make all" or "make bigide" is typically needed only once. When you have Lazarus executable then you can rebuild it from itself.

Using stocki's script means you run a full "svn checkout" every time which is a very stupid thing to do.
It sounds unbelievable but people are actually doing very stupid things when they want to try Lazarus trunk. I have seen already few questions like "how can I build Lazarus trunk with the released FPC?". In reality the installed FPC is used automatically for compilation. It is a non-issue.
However those people have screwed their system with fpcup or some poor script so that nothing works any more.

A question for stocki :
Your script is meant to be run only once because it gets a full svn checkout, right?
I don't see it mentioned anywhere. Instead it says :
:: Build a fresh FPC+LAZ from SVN everyday
::    Based on http://www.getlazarus.org/

That may give an impression that the script should be used more than once. Misleading!
In reality people should learn even the very basics of Subversion revision control tool.
Just 2 commands is enough to get started : "svn co ..." and "svn up".

All scripts and tools that mislead people to do stupid things should be banned and their authors should be forced to do 50 push-ups as a penalty.

BTW, I removed the FPC trunk part from here :
  http://wiki.freepascal.org/Getting_Lazarus
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Build a fresh FPC and Lazarus everyday.
« Reply #6 on: November 30, 2015, 05:25:03 pm »
IMHO fpc(laz)up does not screw your system, because, by default, it does an isolated install of stable versions of FPC (and Lazarus).

Do not forget that there is a reason why (stupid) people need (stupid) scripts and other (stupid) tools to install our beloved tools.

I have done my daily push-ups already ....

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Build a fresh FPC and Lazarus everyday.
« Reply #7 on: November 30, 2015, 05:29:51 pm »
Stocki, good job and thanks for the getlazarus.org credit! :)

stocki

  • Full Member
  • ***
  • Posts: 144
Re: Build a fresh FPC and Lazarus everyday.
« Reply #8 on: November 30, 2015, 07:23:11 pm »
That's a very good point! Even I modified this script a bit just so that I have the latest Lazarus at all times except for FPC which I simply leave it at the stable branch (which is now 3.0 with fixes).

A question for stocki :
Your script is meant to be run only once because it gets a full svn checkout, right?
I don't see it mentioned anywhere. Instead it says :
:: Build a fresh FPC+LAZ from SVN everyday
::    Based on http://www.getlazarus.org/



No. Have you tried it? I use it every few hours.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Build a fresh FPC and Lazarus everyday.
« Reply #9 on: November 30, 2015, 08:54:40 pm »
No. Have you tried it? I use it every few hours.

Well, then you must learn how to update your repository.
The ability to update only the latest revisions is one of the major features of SVN.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Awkward

  • Full Member
  • ***
  • Posts: 135
Re: Build a fresh FPC and Lazarus everyday.
« Reply #10 on: November 30, 2015, 09:18:37 pm »
Strange, but i got errors when tried to "make all" for FPC repo through 3.0.0 version. fpcres and fpcdoc compilation problem (identifier not found) :(

Silvernine

  • New member
  • *
  • Posts: 8
Re: Build a fresh FPC and Lazarus everyday.
« Reply #11 on: November 30, 2015, 10:20:05 pm »
Haha OK I will take a closer at using SVN more than. Still new too all these stuff and I only recently learned how to use Git closer and started messing around with that. Will figure this out later. Either way, this script here by Stocki was useful I think especially for first installs.

stocki

  • Full Member
  • ***
  • Posts: 144
Re: Build a fresh FPC and Lazarus everyday.
« Reply #12 on: December 01, 2015, 02:08:49 am »
No. Have you tried it? I use it every few hours.

Well, then you must learn how to update your repository.
The ability to update only the latest revisions is one of the major features of SVN.

Nothing to learn. My svn update took 2 seconds.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Build a fresh FPC and Lazarus everyday.
« Reply #13 on: December 01, 2015, 02:44:10 am »
No. Have you tried it? I use it every few hours.

Well, then you must learn how to update your repository.
The ability to update only the latest revisions is one of the major features of SVN.

Nothing to learn. My svn update took 2 seconds.
Glad that you like it.

My (wireless) phone company likes wasting such bandwidth as well  >:D

Downloading the archives from fpc ftp server would even cost me less, although those archives aren't updated every two seconds (i wonder why, don't you ?  ;) )

Just check if there is a new revision to begin with and use update, and yes that will complicate the script even further.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Build a fresh FPC and Lazarus everyday.
« Reply #14 on: December 01, 2015, 11:15:42 am »
Nothing to learn. My svn update took 2 seconds.

Oops, the svn command appears to be clever enough to do a partial update when running "svn co ..." again. I thought it would download the whole repo again.
The whole Lazarus repo has 18534 objects, total 284 Mb. Initial checkout took a minute and 11 secs with my rather fast 4G connection.

So, the script was not as bad as I first feared.
However a fundamental problem with all such scripts (not only this one) remains. They give the impression that it is OK for a new user to install trunk versions of both FPC and Lazarus. No it is not OK. It should be done only by people who know both projects well and/or love solving compilation problems.

Typically people who ask help for compilation problems after trying both trunk versions, only wanted to test Lazarus trunk.
For them this is better :
  http://wiki.freepascal.org/Getting_Lazarus
and even that is too verbose.
Once FPC is properly installed, getting Lazarus trunk is as simple as :
 $ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
 $ make bigide
That's it!
Later updates with "svn up" and rebuilding Lazarus from Tools menu.
It is so simple that nobody needs a script for it. And yes, TortoiseSVN GUI makes it even simpler.

I am only asking that people promoting these scripts/tools also explain clearly what is their target audience. It is NOT new users.
« Last Edit: December 01, 2015, 04:42:25 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018