Can’t build a Lazarus project: lazbuild tries to write to a nonexistent home directory

Asked by Pavel Řezníček

My dear developer friends,

I’m new to Launchpad an I’m trying to publish my small project written in FreePascal/Lazarus IDE via a Ubuntu PPA.

I use the LazPackager tool, formerly called LazDebian. Had to tweak it a bit to meet today’s standards. Got to the point where the source package uploads OK but the builds still fail.

Here is an example of a failed build log:
https://launchpadlibrarian.net/391574430/buildlog_ubuntu-bionic-amd64.wimeed_0.1.0.5-1_BUILDING.txt.gz

The critical part seems to be this:

dpkg-buildpackage
-----------------

dpkg-buildpackage: info: source package wimeed
dpkg-buildpackage: info: source version 0.1.0.5-1
dpkg-buildpackage: info: source distribution bionic
 dpkg-source --before-build wimeed-0.1.0.5
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean
dh clean
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
rm -f -r lib
rm -f lib *.res wimeed
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_clean
 debian/rules build
dh build
   dh_update_autotools_config
   debian/rules override_dh_auto_build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
lazbuild WIMEEd.lpi
CopySecondaryConfigFile /etc/lazarus/environmentoptions.xml -> /sbuild-nonexistent/.lazarus/environmentoptions.xml
WARNING: unable to create primary config directory "/sbuild-nonexistent/.lazarus"
Error: (lazarus) invalid Lazarus directory "": directory lcl not found
Error: (lazarus) Building failed: WIMEEd.lpi
debian/rules:10: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
debian/rules:17: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 20181003-2110

Finished
--------

E: Build failure (dpkg-buildpackage died)

It seems that lazbuild tries to find the home directory of the user that the build process is running under and doesn’t find it and in result it tries to write to a nonexistent directory. Is there a way how I could work around this? Or are there any fixes to the lazbuild binary and the Lazarus Ubuntu package that could be made?

Should I report a bug?

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Best Manfred Hampl (m-hampl) said :
#1

Maybe adding options to the lazbuild command helps
http://manpages.ubuntu.com/manpages/bionic/en/man1/lazbuild-1.8.2.1.html
--pcp=<path>, --primary-config-path=<path>
--scp=<path>, --secondary-config-path=<path>

see also as an example https://lists.debian.org/debian-hams/2015/07/msg00014.html
...
lazbuild ... --pcp=/tmp/.lazarus ...
...

Revision history for this message
Pavel Řezníček (cigydd) said :
#2

Thanks, seems like a solution. Will report in several hours as the build completes.

Revision history for this message
Pavel Řezníček (cigydd) said :
#3

Thanks Manfred Hampl, that solved my question.