Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-09

Can't find unit Interfaces on launchpad's build farm - is Lazarus/FPC broken in Ubuntu 12.04?

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd

Ubuntu precise (12.04), simple empty lazarus hello world project, This is the build log:
https://launchpadlibrarian.net/117046564/buildlog_ubuntu-precise-i386.laz-launchpad-example_1.0.2-ppa1_FAILEDTOBUILD.txt.gz

Around line 258 it begins installing necessary packages, I have specified the following build dependencies:
lazarus, lcl-utils

At line 672 the build is started with
lazbuild --build-mode=Debug project1.lpi

producing some strange warnings:
invalid Package Link: file
"/usr/lib/lazarus/0.9.30.2/components/codetools/codetools.lpk" does not exist.
invalid Package Link: file
"/usr/lib/lazarus/0.9.30.2/components/lazcontrols/lazcontrols.lpk" does not exist.

and then around line 687 it will fail with:
Fatal: Can't find unit Interfaces used by project1

Am I missing something obvious or is it just broken in Ubuntu and I simply won't ever be able to use launchpad to build packages? This would be really bad :-(

Reply by email

Mattias Gaertner
to Bernd
Show quoted text 15 lines
Ubuntu precise (12.04), simple empty lazarus hello world project, This is the build log: https://launchpadlibrarian.net/117046564/buildlog_ubuntu-precise-i386.laz-launchpad-example_1.0.2-ppa1_FAILEDTOBUILD.txt.gz Around line 258 it begins installing necessary packages, I have specified the following build dependencies: lazarus, lcl-utils At line 672 the build is started with lazbuild --build-mode=Debug project1.lpi producing some strange warnings: invalid Package Link: file "/usr/lib/lazarus/0.9.30.2/components/codetools/codetools.lpk" does not exist.

How did you install Lazarus?

Mattias

Reply by email

Bernd
to Mattias Gaertner

2012/9/23 Mattias Gaertner :

How did you install Lazarus?

the build server did it (probably with apt-get) satisfying my two build-dependencies:
lazarus lcl-utils

so theoretically the equivalent on the command line would have been: sudo apt-get install lazarus lcl-utils

Reply by email

Mattias Gaertner
to Bernd
Show quoted text 10 lines
2012/9/23 Mattias Gaertner : > How did you install Lazarus? the build server did it (probably with apt-get) satisfying my two build-dependencies: lazarus lcl-utils so theoretically the equivalent on the command line would have been: sudo apt-get install lazarus lcl-utils

Have you tried removing ~/.lazarus?

Have you tried installing lazarus 1.0?

Mattias

Reply by email

Bernd
to Mattias Gaertner

2012/9/23 Mattias Gaertner :

Have you tried removing ~/.lazarus?

No, it always starts with a freshly bootstrapped clean and virgin virtual ubuntu server, I have no other influence than specifying build dependencies in the source package and maybe some ugly hackish trickery in my "all" target. Here is the complete log:

https://launchpadlibrarian.net/117046564/buildlog_ubuntu-precise-i386.laz-launchpad-example_1.0.2-ppa1_FAILEDTOBUILD.txt.gz

here is my Makefile:

# this will be the name of our ubuntu package
PACKAGENAME = laz-launchpad-example

# you need a new UPSTREAMVERSION everytime you try a new upload to # launchpad because this will be considered the version of the # upstream .orig.tar.gz and since we basically *are* upstream and indeed # have changed upstream sources we also need a new uptream version number UPSTREAMVERSION = 1.0.2
FULLDEBVERSION = $(UPSTREAMVERSION)-ppa1
DESCRIPTION = demo package
EXDESCRIPTION = extended description may not be empty AUTHOR = Bernd Kreuss
COPYRIGHT = 2012 $(AUTHOR)

# this must be the same email address used in launchpad AND in the gpg key! # make ubuntu_upload will ask for passphrase to sign the source package # and after uploading launchpad will check the signature to authenticate you EMAIL =
PPANAME = ppa:prof7bit/lazarus-ppa-skeleton

# some licenses need a second line referring to the license file LICENSE = GPL-2
LICENSE2 = /usr/share/common-licenses/GPL-2

# more tweaking can be done by directly altering the code # that creates the debian/* files near the end of this makefile

DISTRIBUTION = precise
BUILD_DEPENDS = lazarus, lcl-utils, debhelper (>= 8) DEPENDS =

EXENAME = project1
LPINAME = project1.lpi

SRCDIRNAME = $(PACKAGENAME)-$(UPSTREAMVERSION)
TARBALLNAME = $(PACKAGENAME)_$(UPSTREAMVERSION).orig.tar.gz

# need bash with extglob for some of the synax in this makefile SHELL = /bin/bash -O extglob

########################################################## # all, clean and install are totally standard stuff and # # are supposed to work the same without debuild. # ##########################################################

# all will build the entire project from source, using lazbuild, # this assumes that there exists a build mode "Release" all:
#lazbuild --build-mode=Release $(LPINAME)
lazbuild --build-mode=Debug $(LPINAME)

# clean will remove all compiled files
clean:
$(RM) -r lib
$(RM) $(EXENAME)
$(RM) *.res

$(RM) -r DEBUILD

# install all the files into their final destinations. This should # work without debuild (for testing or normal install without .deb) # and also work when called during debuild (debuild will also set # the $(DESTDIR) variable to install into a fakeroot) so don't forget # to prefix all destination paths with $(DESTDIR) and also don't forget # to install with -D so that it will create missing directories. install:
install -D $(EXENAME) $(DESTDIR)/usr/bin/$(EXENAME)

# uninstall is not used for the packaging, or anywhere else, I only use # it during development after testing the installer on my local machine uninstall:
$(RM) /usr/bin/$(EXENAME)

#########################################
# here comes the debian specific stuff. #
#########################################

# make ubuntu_src does everything needed to create a debian source package. # It will create a BUILDEB directory, copy the entire source there, # make the .orig.tar.gz tarball from it and then call itself again from # within this new location to make the debian files and all the rest. # after this has completed you can call make ubuntu_upload ubuntu_src: _copyorig
$(MAKE) -C DEBUILD/$(SRCDIRNAME) _ubuntu_src

# make ubuntu_bin is similar to ubuntu_src but it makes a binary package # this should be used to debug the build proces, test the .deb but it # can not be used to produce the source package. Use this only for # debugging. Use ubuntu_src instead to produce the launchpad upload files. ubuntu_bin: _copyorig
$(MAKE) -C DEBUILD/$(SRCDIRNAME) _ubuntu_bin

# after you have run make ubuntu_src (and confirmed that all is ok) # you call make ubuntu_upload which will then sign your source package # and upload it to your ppa. It will first ask you for your gpg # passphrase twice to sign the two files (.dsc and .changes) and then # upload them using dput. You don't need your launchpad password, # launchpad will authenticate you by your gpg signature, launchpad will # send you a notification email to inform you about errors or success. ubuntu_upload:
cd DEBUILD/$(SRCDIRNAME); debsign -S
dput $(PPANAME) DEBUILD/$(PACKAGENAME)_$(FULLDEBVERSION)_source.changes

_copyorig: clean
mkdir -p DEBUILD/$(SRCDIRNAME)
cp -r !(DEBUILD) DEBUILD/$(SRCDIRNAME)/
cd DEBUILD; tar czf $(TARBALLNAME) $(SRCDIRNAME)

#################################################### # everything below happens when we are in the copy # # of the source files inside the DEBUILD directory # ####################################################

_ubuntu_bin: _debfiles _package_bin
_ubuntu_src: _debfiles _package_src
_debfiles: _debdir _changelog _compat _control _copyright _rules

_debdir:
mkdir debian

# this are the changes between upstream and deb. Since we always take # the latest upstream and apply no changes other than debianizing it # this change log will never contain more than one item" _changelog:

	echo "$(PACKAGENAME) ($(FULLDEBVERSION)) $(DISTRIBUTION);

urgency=low" > debian/changelog
echo "" >> debian/changelog
echo " * Upstream release." >> debian/changelog
echo "" >> debian/changelog
echo " -- $(AUTHOR) <$(EMAIL)> `date -R`" >> debian/changelog

# compat contains only a magic number
_compat:
echo 8 > debian/compat

# creates the control file. runtime dependencies will be # automatically detected and inserted by debuild
_control:
echo "Source: $(PACKAGENAME)" > debian/control
echo "Maintainer: $(AUTHOR) <$(EMAIL)>" >> debian/control echo "Section: misc" >> debian/control
echo "Priority: optional" >> debian/control
echo "Standards-Version: 3.9.3" >> debian/control
echo "Build-Depends: $(BUILD_DEPENDS)" >> debian/control echo "" >> debian/control
echo "Package: $(PACKAGENAME)" >> debian/control
echo "Architecture: any" >> debian/control
echo "Depends: \$${shlibs:Depends}, \$${misc:Depends}, $(DEPENDS)" >> debian/control
echo "Description: $(DESCRIPTION)" >> debian/control echo " $(EXDESCRIPTION)" >> debian/control

# copyright file syntax is a bit tricky and and some licenses need # to refer to their license text file or lintian will complain. # see also the debian policy, there may be multiple paragraphs # referrimg to different files having different licenses. The code # below simply assumes all files have the same license. _copyright:
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"

debian/copyright

echo "" >> debian/copyright
echo "Files: *" >> debian/copyright
echo "Copyright: $(COPYRIGHT)" >> debian/copyright echo "License: $(LICENSE)" >> debian/copyright
echo " $(LICENSE2)" >> debian/copyright
echo "" >> debian/copyright

# rules file. This is a makefile wrapping some deep debian voodoo, # can be used to override targets in the build process, we don't need # to mess around with it, leave it as is.
_rules:
echo "#!/usr/bin/make -f" > debian/rules
echo "" >> debian/rules
echo "%:" >> debian/rules
echo " dh \$$@" >> debian/rules

_package_src:
debuild -S -d -us -uc

_package_bin:
debuild -d -us -uc

Reply by email

Bernd
to Bernd

Ok, I am making porogress:
https://launchpadlibrarian.net/117051530/buildlog_ubuntu-precise-i386.laz-launchpad-example_1.0.3-ppa1_FAILEDTOBUILD.txt.gz

Now I have specified following dependencies (I added lcl to the list):

lazarus, lcl, lcl-utils

now it installs the following (from above log file):

fp-compiler
fp-compiler-2.4.4 fp-units-base fp-units-base-2.4.4 fp-units-fcl fp-units-fcl-2.4.4 fp-units-gtk2 fp-units-gtk2-2.4.4 fp-units-rtl-2.4.4

and

lazarus-0.9.30.2
lazarus-doc-0.9.30.2 lazarus-ide-0.9.30.2 lazarus-ide-gtk2-0.9.30.2 lazarus-src-0.9.30.2 lcl-0.9.30.2 lcl-gtk2-0.9.30.2 lcl-units-0.9.30.2 lcl-utils-0.9.30.2

and it fails differently now:

Fatal: Can't find unit iconvenc used by LConvEncoding

I just hope I don't run out of allowed build-jobs per day today so I don't have to wait until tomorrow until I am allowed to continue debugging this...

Reply by email

Bernd
to Bernd: 2012/9/23 Mattias Gaertner : No, it always starts with a freshly bootstrapped clean and…

2012/9/23 Bernd :

here is my Makefile:

What I am actually trying to do here is to make an empty skeleton Lazarus project with a Makefile that will allow automaticaly creating and uploading a source package to launchpad build servers so that everybody can convert his Lazarus project into an ubuntu debian package simply by

* putting just this one makefile into the project folder
* customizing the constants at the top of that file
* maybe a little tweaking of the clean/all/install targets

then for every release:
* increment the version number
* make ubuntu_src
* make ubuntu_upload

and then just wait until the .deb packages for x86 and amd64 are automatically built on their build farm and put into the ppa repository and users can simply apt-get install or upgrade them

Reply by email

Bernd
to Bernd

Success!

https://launchpadlibrarian.net/117069202/buildlog_ubuntu-precise-i386.laz-launchpad-example_1.0.7-ppa1_BUILDING.txt.gz

Build-Depends: fpc, lcl, lcl-utils, lazarus

I always thought that lazarus alone would pull in all required dependencies to use Lazarus and build LCL applications. Isn't this how it is supposed to be?

If anybody wants to experiment with this here is an empty skeleton containing only an empty Lazarus project and my makefile: https://launchpad.net/~prof7bit/+archive/lazarus-ppa-skeleton/+files/laz-launchpad-example_1.0.7.orig.tar.gz

customize the makefile, change email address, author name, package name, ppaname, lpiname, exename, use the email address that corresponds to your own gpg key and that is also associated with your launchpad account, if necessary tweak the 3 targets (clean, all, install) to fit your purpose and then

make ubuntu_src

and check that it ran without errors (this will create a DEBUILD directory with a bunch of files in it) and then if there was no error

make ubuntu_upload

This will ask for your gpg passphrase to sign the files and then upload it to your PPA and enqueue it for building on their build farm. Check your email for error messages and log files. Increment the version number for every new upload with changed sources or it will complain.

For local testing (until you know it works) you can also do
  make ubuntu_deb

This will perform all steps and build the .deb locally for debugging the build process.

I'm going to write a wiki page with instructions next week.

Reply by email

Vincent Snijders
to Bernd

2012/9/23 Bernd :

Show quoted text 12 lines
Success! https://launchpadlibrarian.net/117069202/buildlog_ubuntu-precise-i386.laz-launchpad-example_1.0.7-ppa1_BUILDING.txt.gz Build-Depends: fpc, lcl, lcl-utils, lazarus I always thought that lazarus alone would pull in all required dependencies to use Lazarus and build LCL applications. Isn't this how it is supposed to be?

You can run Lazarus without having all fpc units. That is why it is not required, just suggested, I guess.

Vincent

Reply by email