epylint in emacs using virtualenv - buildout

Can't get epylint working. I'm using buildout to generate epylint script. But then I run it from command line it doesn't output anything.
> epylint models.py
> echo $?
0
While if pylint is installed to system (emerge pylint) everything works, except system level linter does not see eggs installed by buildout. Here is my buildout part for eplint:
[epylint]
recipe = zc.recipe.egg
eggs =
${buildout:eggs}
pylint
extra-paths = ${buildout:extra-paths}
entry-points = epylint=pylint.epylint:Run
Would like to get suggestions how I could pin point issue.

This seems to be due to missing pylint script, which epylint calls internally.
This buildout config works for me:
[epylint]
recipe = zc.recipe.egg
eggs = pylint
entry-points = epylint=pylint.epylint:Run
[pylint]
recipe = zc.recipe.egg
eggs = pylint
entry-points = pylint=pylint.lint:Run
arguments = sys.argv[1:]
I needed two parts because pylint.lint:Run and pylint.epylint:Run process command line arguments in different ways.

Related

`Missing or wrong version of dependency` after recompiling nqp

I am trying to learn myself how to debug rakudo and nqp. So this is my first attempt:
cd $HOME/debug
git clone https://github.com/rakudo/rakudo.git
cd rakudo
perl Configure.pl --gen-moar --gen-nqp --backends=moar
make
make install # installs into ./install/bin
export PATH=${PWD}/install/bin:$PATH
export PATH=${PWD}/install/share/perl6/site/bin:$PATH
# Testing executable:
perl6 --version
# This is Rakudo version 2018.12-256-g9517c3779 built on MoarVM version 2018.12-36-g34fac5f4e
# implementing Perl 6.d.
#
# Now modifying an nqp file:
cd nqp
# Change a file: E.g. : vim src/HLL/Compiler.nqp
# I added a line after line 293 in src/HLL/Compiler.nqp:
# nqp::say("*** Debugging message: HLL::Compiler::command_eval() ***");
# and save it
make
make install
# Testing perl6 again..
perl6 --version
The last command now gives the following exception:
Unhandled exception: Missing or wrong version of dependency 'gen/moar/stage2/NQPHLL.nqp' (from 'src/Perl6/Pod.nqp')
at <unknown>:1 (/home/hakon/debug/rakudo/install/share/nqp/lib/Perl6/Pod.moarvm:<dependencies+deserialize>)
from src/vm/moar/ModuleLoader.nqp:47 (/home/hakon/debug/rakudo/install/share/nqp/lib/ModuleLoader.moarvm:)
from src/vm/moar/ModuleLoader.nqp:40 (/home/hakon/debug/rakudo/install/share/nqp/lib/ModuleLoader.moarvm:load_module)
from <unknown>:1 (/home/hakon/debug/rakudo/install/share/nqp/lib/Perl6/Actions.moarvm:<dependencies+deserialize>)
from src/vm/moar/ModuleLoader.nqp:47 (/home/hakon/debug/rakudo/install/share/nqp/lib/ModuleLoader.moarvm:)
from src/vm/moar/ModuleLoader.nqp:40 (/home/hakon/debug/rakudo/install/share/nqp/lib/ModuleLoader.moarvm:load_module)
from <unknown>:1 (/home/hakon/debug/rakudo/install/share/nqp/lib/Perl6/Grammar.moarvm:<dependencies+deserialize>)
from src/vm/moar/ModuleLoader.nqp:47 (/home/hakon/debug/rakudo/install/share/nqp/lib/ModuleLoader.moarvm:)
from src/vm/moar/ModuleLoader.nqp:40 (/home/hakon/debug/rakudo/install/share/nqp/lib/ModuleLoader.moarvm:load_module)
from <unknown>:1 (/home/hakon/debug/rakudo/install/share/perl6/runtime/perl6.moarvm:<dependencies+deserialize>)
h
So I thought, maybe I need to run make on rakudo also:
cd ..
make
but here make fails with:
/home/hakon/perlbrew/perls/perl-5.29.3/bin/perl5.29.3 tools/build/check-nqp-version.pl /home/hakon/debug/rakudo/install/bin/nqp-m
/home/hakon/debug/rakudo/install/bin/nqp-m tools/build/gen-cat.nqp moar src/vm/moar/ModuleLoaderVMConfig.nqp src/Perl6/ModuleLoader.nqp > gen/moar/ModuleLoader.nqp
/home/hakon/debug/rakudo/install/bin/nqp-m --module-path=blib --target=mbc --output=blib/Perl6/ModuleLoader.moarvm \
gen/moar/ModuleLoader.nqp
*** Debugging message: HLL::Compiler::command_eval() ***
Confused at line 2, near "*** Debugg"
at gen/moar/stage2/NQPHLL.nqp:811 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:panic)
from gen/moar/stage2/NQP.nqp:921 (/home/hakon/debug/rakudo/install/share/nqp/lib/nqp.moarvm:comp_unit)
from gen/moar/stage2/NQP.nqp:782 (/home/hakon/debug/rakudo/install/share/nqp/lib/nqp.moarvm:TOP)
from gen/moar/stage2/QRegex.nqp:2300 (/home/hakon/debug/rakudo/install/share/nqp/lib/QRegex.moarvm:parse)
from gen/moar/stage2/NQPHLL.nqp:2031 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:parse)
from gen/moar/stage2/NQPHLL.nqp:1951 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:execute_stage)
from gen/moar/stage2/NQPHLL.nqp:1984 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:run)
from gen/moar/stage2/NQPHLL.nqp:1976 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:)
from gen/moar/stage2/NQPHLL.nqp:1971 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:compile)
from gen/moar/stage2/NQPHLL.nqp:1666 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:eval)
from gen/moar/stage2/NQPHLL.nqp:1889 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
from gen/moar/stage2/NQPHLL.nqp:1849 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
from gen/moar/stage2/NQPHLL.nqp:1773 (/home/hakon/debug/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_line)
from gen/moar/stage2/NQP.nqp:4135 (/home/hakon/debug/rakudo/install/share/nqp/lib/nqp.moarvm:MAIN)
from gen/moar/stage2/NQP.nqp:1 (/home/hakon/debug/rakudo/install/share/nqp/lib/nqp.moarvm:<mainline>)
from <unknown>:1 (/home/hakon/debug/rakudo/install/share/nqp/lib/nqp.moarvm:<main>)
from <unknown>:1 (/home/hakon/debug/rakudo/install/share/nqp/lib/nqp.moarvm:<entry>)
make: *** [Makefile:457: blib/Perl6/ModuleLoader.moarvm] Error 1
A Rakudo build is statically "linked" against libraries in the NQP build used to produce it, and therefore Rakudo will need to be rebuilt after modifying NQP. Hashing is used to ensure that the wrong version of a dependency is never used; if this situation was not detected, there's a high chance of extremely strange failure modes.
The second failure is because the Rakudo build uses some NQP scripts to preprocess some source files, which are then fed to the NQP of Perl 6 compiler. It uses > to redirect the output into a file. Therefore, your debug output will be redirected into that file, and then - since it is not valid source code - cause a build error. The solution is to always produce debug output on stderr instead, for example using note.

Build chromium for raspberrypi2 on wayland with yocto project brings error related to egl.pc and wayland-egl.pc

I have completed building qt5 on raspberrypi2 by following the instruction here: http://www.embarcados.com.br/raspberry-pi-2-qt5-yocto-parte-1/
My next goal is to build chromium with wayland and egl. I have added one more layer from "https://github.com/OSSystems/meta-browser".
Actually, I could successfully build chromium with x11 but still failing with wayland. The things I did for wayland is to add "wayland" with DISTRO_FEATURES_append = " wayland" and remove x11 with DISTRO_FEATURES_remove = " x11".
However, this yields errors and the error messages mentions that missing "egl.pc" and "wayland-egl.pc". Should I add some more components in "DEPENDS" section which will be pre built and create those two package config files in addition to those components in chromium.inc? The build configurations and error messages shown are below.
Build Configuration:
BB_VERSION = "1.26.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "raspberrypi2"
DISTRO = "poky"
DISTRO_VERSION = "1.8"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard vfpv4 cortexa7"
TARGET_FPU = "vfp-vfpv4-neon"
meta-embarcados
meta-rpi = "fido:dfb2e27bf26b109fc6ccb3bc91924fb3bb24f655"
meta-qt5 = "fido:fc026381545650e10fdd488d5b2a3b2d78f87793"
meta-raspberrypi = "fido:b896a7da70dd7a16ba7ffd664f7747cb37e1d142"
meta-oe
meta-ruby
meta-gnome = "fido:10d3c8f85280a0bf867a8e4f84bcda81c290d28e"
meta
meta-yocto = "fido:cd2c9acdbd75c83790e8144d2a834f5b5de35df0"
meta-browser = "master:ca96f4326345dcd779fc539877a04f069f431749"
NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_configure (log file is located at /home/paul/yocto/build-browser-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/40.0.2214.91-r0/temp/log.do_configure.13805)
ERROR: Logfile of failure stored in: /home/paul/yocto/build-browser-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/40.0.2214.91-r0/temp/log.do_configure.13805
Updating projects from gyp files...
Package xcb-shm was not found in the pkg-config search path.
Perhaps you should add the directory containing xcb-shm.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcb-shm', required by 'cairo', not found
gyp: Call to 'pkg-config --cflags pangocairo pangoft2' returned exit status 1.
Requested 'egl >= 9.1.3' but version of egl is 0.0
Package wayland-egl was not found in the pkg-config search path.
Perhaps you should add the directory containingwayland-egl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'wayland-egl' found
gyp: Call to 'pkg-config --cflags "egl >= 9.1.3" "wayland-client >= 1.4.0" >>
Thank you very much for your help.
I found that I should have not done DISTRO_FEATURES_remove = " x11". However, I`m still attempting to launch chromium based on wayland compositor.

custom compile an egg and install console scripts

I'm trying to get the following buildout working. The buildout is meant to be self contained so I don't want to install any system packages
[s3ql]
recipe = zc.recipe.egg:scripts
eggs =
${s3ql-build:egg}
[s3ql-build]
recipe = zc.recipe.egg:custom
egg = s3ql
find-links =
https://bitbucket.org/nikratio/s3ql/downloads/s3ql-1.18.1.tar.bz2#egg=s3ql-1.18.1
http://security.ubuntu.com/ubuntu/pool/universe/s/s3ql/s3ql_1.16.orig.tar.bz2#egg=s3ql
https://github.com/wilkinson/s3ql/archive/master.zip#egg=s3ql
https://github.com/rogerbinns/apsw/releases/download/3.8.4.3-r1/apsw-3.8.4.3-r1.zip
include-dirs =
${liblzma:location}/include
${sqlite:location}/include
library-dirs =
${liblzma:location}/lib
${sqlite:location}/lib
rpath =
${liblzma:location}/lib
${sqlite:location}/lib
[liblzma]
recipe = zc.recipe.cmmi
url = http://tukaani.org/xz/xz-5.0.5.tar.gz
[pysqlite]
recipe = zc.recipe.egg:custom
egg = pysqlite
include-dirs = ${sqlite:location}/include
library-dirs = ${sqlite:location}/lib
rpath = ${sqlite:location}/lib
[sqlite]
recipe = zc.recipe.cmmi
url = http://www.sqlite.org/2014/sqlite-autoconf-3080403.tar.gz
and I get the following
Updating liblzma.
Updating sqlite.
Updating s3ql-build.
Installing s3ql.
Getting distribution for 'pyliblzma>=0.5.3'.
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
In file included from src/liblzma.c:1:0:
src/liblzma.h:24:18: fatal error: lzma.h: No such file or directory
compilation terminated.
error: Setup script exited with error:
command 'gcc' failed with exit status 1
An error occurred when trying to install pyliblzma 0.5.3. Look above this message for any errors that were output by easy_install.
While:
Installing s3ql.
Getting distribution for 'pyliblzma>=0.5.3'.
Error: Couldn't install: pyliblzma 0.5.3
It seems like it tries to compile it again.
You need to install liblzma-dev on your OS.
gottfried#dell-xt2:~/virtualenvs/liblzma$ sudo apt-get install liblzma-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
liblzma-doc
The following NEW packages will be installed:
liblzma-dev
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
Need to get 159 kB of archives.
After this operation, 645 kB of additional disk space will be used.
Get:1 http://de.archive.ubuntu.com/ubuntu/ saucy/main liblzma-dev amd64 5.1.1alpha+20120614-2ubuntu1 [159 kB]
Fetched 159 kB in 1s (111 kB/s)
Selecting previously unselected package liblzma-dev:amd64.
(Reading database ... 272326 files and directories currently installed.)
Unpacking liblzma-dev:amd64 (from .../liblzma-dev_5.1.1alpha+20120614-2ubuntu1_amd64.deb) ...
Setting up liblzma-dev:amd64 (5.1.1alpha+20120614-2ubuntu1) ...
gottfried#dell-xt2:~/virtualenvs/liblzma$ bin/easy_install pyliblzma
Searching for pyliblzma
Reading https://pypi.python.org/simple/pyliblzma/
Best match: pyliblzma 0.5.3
Downloading https://pypi.python.org/packages/source/p/pyliblzma/pyliblzma-0.5.3.tar.bz2#md5=500f61116ee1ab4063b49c121786863a
Processing pyliblzma-0.5.3.tar.bz2
Writing /tmp/easy_install-kAg4nj/pyliblzma-0.5.3/setup.cfg
Running pyliblzma-0.5.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kAg4nj/pyliblzma-0.5.3/egg-dist-tmp-TmcZm_
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
zip_safe flag not set; analyzing archive contents...
Adding pyliblzma 0.5.3 to easy-install.pth file
Installed /home/gottfried/virtualenvs/liblzma/lib/python2.7/site-packages/pyliblzma-0.5.3-py2.7-linux-x86_64.egg
Processing dependencies for pyliblzma
Finished processing dependencies for pyliblzma
ok, I figured it out. Yes using a combination of zc.recipe.egg:scripts and zc.recipe.egg:custom is the right approach. But it's confusing as zc.recipe.egg:custom doesn't build the dependencies so it appears like it wasn't picking up the built s3ql.
Here is the solution that built for me.
[s3ql]
recipe = zc.recipe.egg:scripts
eggs =
${pyliblzma:egg}
${llfuse:egg}
${apsw:egg}
${s3ql-build:egg}
[s3ql-build]
recipe = zc.recipe.egg:custom
egg = s3ql
find-links =
https://bitbucket.org/nikratio/s3ql/downloads/s3ql-1.18.1.tar.bz2#egg=s3ql-1.18.1
# need this patch to build on osx
# https://bitbucket.org/nikratio/s3ql/commits/39352e8e4cb48521dd9ff589e93fc2e4ae390f9d/raw/
include-dirs =
${liblzma:location}/include
${sqlite:location}/include
library-dirs =
${liblzma:location}/lib
${sqlite:location}/lib
rpath =
${liblzma:location}/lib
${sqlite:location}/lib
[pyliblzma]
recipe = zc.recipe.egg:custom
egg = pyliblzma
include-dirs = ${liblzma:location}/include
library-dirs = ${liblzma:location}/lib
rpath = ${liblzma:location}/lib
[llfuse]
recipe = zc.recipe.egg:custom
egg = llfuse
# NOTE: requires apt-get install libfuse-dev pkg-config libattr1-dev
# fuse has to go into the kernal so we can't compile it into the buildout
[apsw]
recipe = zc.recipe.egg:custom
egg = apsw
find-links =
https://github.com/rogerbinns/apsw/releases/download/3.8.4.3-r1/apsw-3.8.4.3-r1.zip
# includes, libraries etc is ignored by apsw setup.py
environment = apsw-env
[apsw-env]
CPPFLAGS= -I${sqlite:location}/include -I${liblzma:location}/lib
LDFLAGS= -L${sqlite:location}/lib -Wl,-rpath=${sqlite:location}/lib -L${liblzma:location}/include -Wl,-rpath=${liblzma:location}/lib
PKG_CONFIG_PATH=${sqlite:location}/lib/pkgconfig:${liblzma:location}/lib/pkgconfig
[liblzma]
recipe = zc.recipe.cmmi
url = http://tukaani.org/xz/xz-5.0.5.tar.gz
[sqlite]
recipe = zc.recipe.cmmi
url = http://www.sqlite.org/2014/sqlite-autoconf-3080403.tar.gz

"Requires" entry in .spec file does not work

I was writing an .spec file for a rpm package and I'm having an issue.
I need to install that package with a specific version of another package.
Let's take a python package example. So, I write it:
Requires : bash, grep, python >= 2.6.7-4b
But, the package is installed even if the python package is in the 2.6.6 version.
If I remove python package, the system shows me that my package needs python 2.6.7.
Is there something wrong?
Output from rpm -q --provides python:
Distutils
python(abi) = 2.6
python-abi = 2.6
python-ctypes = 1.0.1
python-hashlib = 20081120
python-sqlite = 2.3.2
python-uuid = 1.31
python-x86_64 = 2.6.6-52.el6
python2 = 2.6.6
python = 2.6.6-52.el6
python(x86-64) = 2.6.6-52.el6
Output from rpm -qpR $yourpackage.rpm:
/bin/sh
python >= 2.6.7-4b
bash
grep
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
The ''Requires:'' tag is ignored unless you add ''Autoreq: no'' as well.
Newer versions of rpmbuild calculate the requirements automatically and ignore ''Requires:'' unless the feature is turned off.
I have run into this issue multiple times and it is worth noting that you should at first run rpmbuild without ''Autoreq: no'', note the autodetected dependencies, and add them to the ''Required:'' tag before the final run with ''Autoreq: no''.
Is also worth noting that the automatic detection of dependencies is a little buggy and has some issues with comments.
I packaged a perl script with a comment containing " ... then use a module ... " a while ago.
Autoreq detected that as being perl module "perl a" and added it to the dependencies making my rpm useless.

Cmake with bitbake recipe

I am trying to build an yocto image with my own package. I have OpenCV code on github which uses cmake.
I trying to write a recipe for it and facing lot of errors. Can any one give some hints on what functions or parameters to include in my recipe. My recipe looks as following
DESCRIPTION = "cameracapture application"
SECTION = "examples"
LICENSE = "CLOSED"
PR = "r0"
DEPENDS += "opencv"
SRC_URI = "git://https://github.com/zafrullahsyed/cameracapture.git;protocol=https;tag=v0.1"
EXTRA_OECMAKE=""
do_configure() {
cmake ../
}
inherit pkgconfig cmake
I followed these tutorials to write my recipe with cmake but in vain:
Bitbake Player recipe
Cmake-Bitbake-QT
The correct way of writing own recipes with cmake as follows:
DESCRIPTION = "cameracapture application"
SECTION = "examples"
LICENSE = "CLOSED"
PR = "r0"
DEPENDS = "opencv"
SRC_URI = "git://github.com/zafrullahsyed/cameracapture.git;protocol=https;tag=v0.1"
S = "${WORKDIR}/git"
inherit pkgconfig cmake
do_install() {
install -d ${D}${bindir}
install -m 0755 cameracapture ${D}${bindir}
}
Previously I didn't add do_install that's the reason yocto downloads the recipe but unable to include it Image.
If the CMakeLists.txt uses the install command then bitbake will do the install for you and you won't need to define you own do_install.
install(TARGETS cameracapture DESTINATION bin)
add the source directory in your recipe.
example
S = "${WORKDIR}/cameracapture
S is the source code path where your CMakeList.txt.
any how your are inheriting the cmake bbclass in your recipe, so it will take care of all configure , compile and install functionalities.
after doing this you can remove you do_configure function in the above recipe also.
you can add your make options if any to the below macro (as you kept empty).
example
EXTRA_OECMAKE = "all"