home | tech | misc | code | bookmarks (broken) | contact | README


pkgsrc troubleshooting

ERROR: Circular dependency detected in net/tnftp

The entire error message is actually:

=> Full dependency ncurses>=5.4nb1: NOT found
=> Verifying reinstall for ../../devel/ncurses
=> Bootstrap dependency digest>=20010302: found digest-20080510
=> Bootstrap dependency tnftp-[0-9]*: NOT found
=> Verifying reinstall for ../../net/tnftp

This error is common in Linux. It actually means that you need to install the ncurses dev package for this distribution. Take a look at the pkgsrc bootstrap page for details.

Error Package fixesext was not found in pkg-config

Important

If you installed pkgsrc correctly, along with all its system dependencies (groff, ncurses-dev etc.), you shouldn't get this error. Check pkgsrc bootstrap page.

I got this problem when trying to install x11/Xfixes as a dependency to x11/qt4-tools, in Ubuntu GNU/Linux 9.04.

In Ubuntu (maybe other distro), the fixesext.pc file has another name. So, I had to create a symlink to it:

# cd /usr/lib/pkgconfig
# ln -s xfixes.pc fixesext.pc

Even making this change, pkgsrc's Xfixes/work/.tools's pkg-config doesn't seem to find this file. I didn't want to debug the problem. The mistake is probably mine... but as I couldn't wait, so I quickly (and "dirtly"!) patched the configure script, with this patch.

# cd /usr/pkgsrc/x11/Xfixes/work/libXfixes-2.0.1
# cp configure configure.orig
# patch -p0 < Xfixes-2.0.1-configure.diff

Now it is ok.

find_best:1: no such file or directory .. [resolve-dependencies]

I got this error:

=> Full dependency bootstrap-mk-files-[0-9]*: found bootstrap-mk-files-20090807nb2
find_best:1: no such file or directory: /usr/pkgsrc/bootstrap/work/sbin/pkg_info -K /var/db/pkg
ERROR: [resolve-dependencies] A package matching ``bootstrap-mk-files-[0-9]*'' should
ERROR:     be installed, but one cannot be found.  Perhaps there is a
ERROR:     stale work directory for ../../pkgtools/bootstrap-mk-files?
*** Error code 1

When bootstrapping pkgsrc on GNU/Linux. I first thought it would be recently introduced a bug in pkgsrc, since it didn't happened some months ago. After diving into the source code, I found this line in the mk/flavor/pkg/resolve-dependencies script:

${PKG_INFO} -E "$1" || ${TRUE}

${PKG_INFO} has the absolute path of the bootstrapped pkg_info utility, and its parameters. In a fine shell, this variable should expand fine, but it doesn't in zsh (check this section of the zsh manual) without a special flag.

So, even though bootstrap seems to work with your shell, /bin/sh and /bin/bash are the only to be guaranteed.

Package can't find correct libs and includes, although I set them correctly

If you are a package developer, and you made a package that uses configure scripts, maybe you are wondering why it can't find X11 headers and libraries (or any other), even though you set CONFIGURE_ARGS correctly to find them. This is because the wrappers can took arguments out in the sake of performance and correctness.

Instead of struggling with CONFIGURE_ARGS and related, see if you are not missing a buildlink3.mk include. In my case, it was lacking .include "../../graphics/Mesa/buildlink3.mk" to make it find X11 and OpenGL stuff.

Learn more on Joerg Sonnenberg paper about the wrapper framework.

Error ... libcairo.so.2: Undefined PLT symbol "pixman_image_composite32"

If you try to lauch a GTK application (or other that uses Cairo) and got an error like this:

** (evince:29445): WARNING **: Failed to create dbus proxy for org.gnome.SettingsDaemon: Could not get owner of name 'org.gnome.SettingsDaemon': no such name

** (evince:29445): WARNING **: Setting attribute metadata::evince::sidebar_visibility not supported /usr/pkg/lib/libcairo.so.2: Undefined PLT symbol "pixman_image_composite32" (symnum = 1778)

Or this:

/usr/pkg/lib/libcairo.so.2: Undefined PLT symbol "pixman_image_set_destroy_function" (symnum = 530)

It is probably because Cairo was built to use pkgsrc version of libpixman. It is probably installed in pkgsrc as a dependency, but the loader finds first finds the base version (in NetBSD) of libpixman, that is older than it should be. Just take base libpixman out of the way:

$ cd /usr/lib
$ for f in libpixman*; do
      echo $f
  done

Now the library loader will find libpixman from pkgsrc.

This thread of the pkgsrc discussion list was really useful to head me to the solution of this problem. Just look for the cited threads.

Error ERROR: error 65280 occurred while making...

This problem occurs probably because you are out of memory, according to this thread. Try to increase the memory of your system.

Error sh: Syntax error: expecting "in"

Mysteriously, you might face this error on the toolchain creation phase:

sh: Syntax error: expecting "in"
*** Error code 2

It is not clear why some people get this error. This bug report suggests it is an environment issue. Indeed, in my case, it was. I unset LD_LIBRARY_PATH, that I set manually before, restarted the build and it went on.

In my package, I'm using pkg-config but it can't find info of dependencies

Some packages need pkg-config to locate information about dependencies, like CFLAGS variable information, or linker informations.

In order to tell pkgsrc your package needs pkg-config, add this line to the Makefile:

USE_TOOLS+= pkg-config

But, it may not find your dependencies information. Why? After realizing there was still compiling errors in my package, I decided to check the work/.work.log file:

$ grep pkg-config work/.work.log
[*] /usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.tools/bin/pkg-config --cflags webkit-1.0
<.> PKG_CONFIG_LIBDIR=/usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/lib/pkgconfig:/usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/share/pkgconfig PKG_CONFIG_PATH= /usr/upkg/bin/pkg-config  --cflags webkit-1.0
[*] /usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.tools/bin/pkg-config --libs webkit-1.0
<.> PKG_CONFIG_LIBDIR=/usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/lib/pkgconfig:/usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/share/pkgconfig PKG_CONFIG_PATH= /usr/upkg/bin/pkg-config  --libs webkit-1.0

pkg-config is being called correctly, but pkgsrc overrides default paths that are searched by setting the PKG_CONFIG_LIBDIR variable. Let's see the contents of directories it points to:

$ ls /usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/lib/pkgconfig /usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/share/pkgconfig
gls: cannot access /usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/share/pkgconfig: No such file or directory
/usr/upkgsrc/pkgsrc.self/py-jswebkit/work/.buildlink/lib/pkgconfig:
python-2.7.pc@

We just find python-2.7.pc, but we needed more. In our case, we needed pkg-config file for py-webkit. So, pkgsrc makes pkg-config looks for its files in the tool set created by each package (in the work/.tools directory). What is the problem, then? Why the file we need is not inside one of these directories?

The problem here, is that I simply forget to add py-webkit as a dependency. It was installed, but we need to add a link to it in our Makefile in order to make pkgsrc create all the files we need to compile our package. In my case, I added to the Makefile:

.include "../../wip/py-webkit/buildlink3.mk"

Error with gcc2 not available when compiling cross/libtool-base

When following the HOWTO-use-crosscompile guide for pkgsrc, it is necessary to build cross/libtool manually after setting variables in /etc/mk.conf and before building packages. This can lead to errors like those:

# cd /usr/pkgsrc/cross/libtool-base
# make package
=> Bootstrap dependency digest>=20010302: found digest-20121220
===> Skipping vulnerability checks.
WARNING: No /sandbox/var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/sbin/pkg_admin -K /sandbox/var/db/pkg fetch-pkg-vulnerabilities'.
=> Checksum SHA1 OK for libtool-2.4.2.tar.gz
=> Checksum RMD160 OK for libtool-2.4.2.tar.gz
===> Installing dependencies for cross-libtool-base-earmv7hf-2.4.2nb2
=> Full dependency gcc2>=2.95.3nb7: NOT found
=> Verifying package-install for ../../lang/gcc2
=> Bootstrap dependency digest>=20010302: found digest-20121220
ERROR: This package is not available for these platforms: Darwin-*-* Interix-*-* *-*-x86_64 DragonFly-*-* NetBSD-[6789]*-*.
ERROR: This package has set PKG_SKIP_REASON:
ERROR: gcc2-2.95.3nb7 is not available for NetBSD-7.0-earmv7hf
*** Error code 1

I don't know exactly the reason, but I was trying to compile cross/libtool-base with cross compile for /etc/mk.conf parameters as written in HOWTO-use-crosscompile, but my pkgsrc directory it was already an existing installation for native packages under i386. Also, I was pointing my CROSS_DESTDIR variable to an NetBSD distribution compiled inside a sandbox, so the paths could be different (maybe?).

I deleted my old pkgsrc installation, a new one and built NetBSD again outside the sandbox and I was able to compile cross/libtool-base as told in HOWTO-use-crosscompile.

Error Exception: Failed to create virtualenv: /usr/pkgsrc/www/firefox/work/build/_virtualenv when building firefox

I got this error when trying to compiling firefox using bulkbuild. It is difficult to know why this happened, but I soon discovered that I was mixing packages compiled in different version of pkgsrc (the PACKAGES in /etc/mk.conf variable was pointing to a folder with junk data.

After I cleaned up my environment, the build worked fine.

To let it registered, I'll let the log below:

Creating Python environment
New python executable in /usr/pkgsrc/www/firefox/work/build/_virtualenv/bin/python2.7
Also creating executable in /usr/pkgsrc/www/firefox/work/build/_virtualenv/bin/python
Installing setuptools, pip, wheel...done.
platform netbsd7 is not supported

Error processing command. Ignoring because optional. (optional:setup.py:python/psutil:build_ext:--inplace)
Reexecuting in the virtualenv
Creating Python environment
Please use the *system* python to run this script
Traceback (most recent call last):
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/virtualenv/virtualenv.py", line 2325, in <module>
    main()
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/virtualenv/virtualenv.py", line 711, in main
    symlink=options.symlink and hasattr(os, 'symlink')) # MOZ: Make sure we don't use symlink when we don't have it
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/virtualenv/virtualenv.py", line 924, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/usr/pkgsrc/www/firefox/work/build/_virtualenv/lib/python2.7/posixpath.py", line 360, in abspath
    if not isabs(path):
  File "/usr/pkgsrc/www/firefox/work/build/_virtualenv/lib/python2.7/posixpath.py", line 54, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
Traceback (most recent call last):
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/configure.py", line 94, in <module>
    sys.exit(main(sys.argv))
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/configure.py", line 22, in main
    sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 231, in run
    self.include_file(path)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 222, in include_file
    exec_(code, self)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/util.py", line 58, in exec_
    exec(object, globals, locals)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/moz.configure", line 7, in <module>
    include('build/moz.configure/init.configure')
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 477, in include_impl
    self.include_file(what)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 222, in include_file
    exec_(code, self)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/util.py", line 58, in exec_
    exec(object, globals, locals)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/build/moz.configure/init.configure", line 174, in <module>
    @imports('distutils.sysconfig')
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 458, in decorator
    self._value_for(dummy)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 302, in _value_for
    return self._value_for_depends(obj)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/util.py", line 924, in method_call
    cache[args] = self.func(instance, *args)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 329, in _value_for_depends
    return func(*resolved_args)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/configure/__init__.py", line 773, in wrapped
    return new_func(*args, **kwargs)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/build/moz.configure/init.configure", line 227, in virtualenv_python
    manager.build(python)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/virtualenv.py", line 439, in build
    self.create(python)
  File "/usr/pkgsrc/www/firefox/work/firefox-50.0.2/python/mozbuild/mozbuild/virtualenv.py", line 203, in create
    'Failed to create virtualenv: %s' % self.virtualenv_root)
Exception: Failed to create virtualenv: /usr/pkgsrc/www/firefox/work/build/_virtualenv
*** Error code 1

Stop.
make[3]: stopped in /usr/pkgsrc/www/firefox
*** Error code 1

Stop.
make[2]: stopped in /usr/pkgsrc/www/firefox