jerryscript-project / js-remote-test

This repository is includes the automatic test results of iotjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependencies are not properly installed on Ubuntu 14.04 with install-deps.sh

glistening opened this issue · comments

When I clone latest version of js-remote-test, and follow the guide in README.md on Ubuntu 14.04 LTS, I got following error:

$ python driver.py --device=artik053 --app=iotjs --buildtype=debug
Traceback (most recent call last):
  File "driver.py", line 17, in <module>
    import API
  File "/home/brian/iotjs/js-remote-test/API/__init__.py", line 16, in <module>
    import device
  File "/home/brian/iotjs/js-remote-test/API/device/__init__.py", line 15, in <module>
    import artik053
  File "/home/brian/iotjs/js-remote-test/API/device/artik053.py", line 16, in <module>
    import connection
  File "/home/brian/iotjs/js-remote-test/API/device/connection/__init__.py", line 15, in <module>
    import serialcom
  File "/home/brian/iotjs/js-remote-test/API/device/connection/serialcom.py", line 15, in <module>
    import serial
ImportError: No module named serial

It seems sudo pip install schedule paramiko pyserial xmodem pyrebase is done well.

So I tried on another Ubuntu 14.04 LTS in VirtualBox. It is closer to clean Ubuntu 14.04 LTS.
It shows different error in installing pip.

$ bash install-deps.sh 
...
Setting up linux-libc-dev-armhf-cross (3.13.0-12.32cross1.104) ...
Setting up libc6-dev-armhf-cross (2.19-0ubuntu2cross1.104) ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
sudo: pip: command not found

$ pip
The program 'pip' is currently not installed. You can install it by typing:
sudo apt-get install python-pip

$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-pip : Depends: python-setuptools (>= 0.6c1) but it is not going to be installed
              Recommends: python-dev-all (>= 2.6) but it is not installable
E: Unable to correct problems, you have held broken packages.

What is the error when you try to install python-dev-all? Why is it not installable?

@LaszloLango On my Ubuntu 14.04 system,

$ sudo apt-get install python-dev-all
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-dev-all is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-dev-all' has no installation candidate

@LaszloLango On my Ubuntu 14.04 system, python-pip is already installed.

$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pip is already the newest version.
The following packages were automatically installed and are no longer required:
  libxdelta2 xdelta
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.

On my another Ubuntu 14.04 in VirtualBox shows similar error that you referred. I will try the command.

@LaszloLango I succeed in installing python-pip on Ubuntu 14.04 using the command in your reference link. But it shows another error:

$ sudo apt-get install python-pkg-resources=3.3-1ubuntu1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  python-distribute python-distribute-doc
The following packages will be DOWNGRADED:
  python-pkg-resources
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 21 not upgraded.
Need to get 61.9 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://kr.archive.ubuntu.com/ubuntu/ trusty/main python-pkg-resources all 3.3-1ubuntu1 [61.9 kB]
Fetched 61.9 kB in 0s (301 kB/s)              
dpkg: warning: downgrading python-pkg-resources from 3.3-1ubuntu2 to 3.3-1ubuntu1
(Reading database ... 182120 files and directories currently installed.)
Preparing to unpack .../python-pkg-resources_3.3-1ubuntu1_all.deb ...
Unpacking python-pkg-resources (3.3-1ubuntu1) over (3.3-1ubuntu2) ...
Setting up python-pkg-resources (3.3-1ubuntu1) ...
brian@white:~/js-remote-test$ sudo apt-get install python-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python-setuptools
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
Need to get 230 kB of archives.
After this operation, 830 kB of additional disk space will be used.
Get:1 http://kr.archive.ubuntu.com/ubuntu/ trusty/main python-setuptools all 3.3-1ubuntu1 [230 kB]
Fetched 230 kB in 2s (81.9 kB/s)            
Selecting previously unselected package python-setuptools.
(Reading database ... 182120 files and directories currently installed.)
Preparing to unpack .../python-setuptools_3.3-1ubuntu1_all.deb ...
Unpacking python-setuptools (3.3-1ubuntu1) ...
Setting up python-setuptools (3.3-1ubuntu1) ...
brian@white:~/js-remote-test$ bash install-deps.sh 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
autoconf is already the newest version.
autoconf2.13 is already the newest version.
bison is already the newest version.
flex is already the newest version.
gperf is already the newest version.
libtool is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libncurses5-dev' instead of 'libncurses-dev'
cmake is already the newest version.
libncurses5-dev is already the newest version.
libusb-1.0-0-dev is already the newest version.
genromfs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libsgutils2-dev is already the newest version.
gcc-arm-none-eabi is already the newest version.
minicom is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
pkg-config is already the newest version.
pkg-config set to manually installed.
libssl-dev is already the newest version.
libssl-dev set to manually installed.
The following extra packages will be installed:
  python-colorama python-distlib python-html5lib
Suggested packages:
  python-genshi
Recommended packages:
  python-dev-all
The following NEW packages will be installed:
  python-colorama python-distlib python-html5lib python-pip
0 upgraded, 4 newly installed, 0 to remove and 21 not upgraded.
Need to get 312 kB of archives.
After this operation, 1,682 kB of additional disk space will be used.
Get:1 http://kr.archive.ubuntu.com/ubuntu/ trusty/universe python-colorama all 0.2.5-0.1ubuntu1 [18.3 kB]
Get:2 http://kr.archive.ubuntu.com/ubuntu/ trusty/universe python-distlib all 0.1.8-1 [113 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu/ trusty/main python-html5lib all 0.999-2 [83.2 kB]
Get:4 http://kr.archive.ubuntu.com/ubuntu/ trusty/universe python-pip all 1.5.4-1 [97.7 kB]
Fetched 312 kB in 1s (312 kB/s)  
Selecting previously unselected package python-colorama.
(Reading database ... 182213 files and directories currently installed.)
Preparing to unpack .../python-colorama_0.2.5-0.1ubuntu1_all.deb ...
Unpacking python-colorama (0.2.5-0.1ubuntu1) ...
Selecting previously unselected package python-distlib.
Preparing to unpack .../python-distlib_0.1.8-1_all.deb ...
Unpacking python-distlib (0.1.8-1) ...
Selecting previously unselected package python-html5lib.
Preparing to unpack .../python-html5lib_0.999-2_all.deb ...
Unpacking python-html5lib (0.999-2) ...
Selecting previously unselected package python-pip.
Preparing to unpack .../python-pip_1.5.4-1_all.deb ...
Unpacking python-pip (1.5.4-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up python-colorama (0.2.5-0.1ubuntu1) ...
Setting up python-distlib (0.1.8-1) ...
Setting up python-html5lib (0.999-2) ...
Setting up python-pip (1.5.4-1) ...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gcc-arm-linux-gnueabihf is already the newest version.
binutils-arm-linux-gnueabi is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
Downloading/unpacking schedule
  Downloading schedule-0.4.3-py2.py3-none-any.whl
Downloading/unpacking paramiko
  Downloading paramiko-2.3.1-py2.py3-none-any.whl (182kB): 182kB downloaded
Requirement already satisfied (use --upgrade to upgrade): pyserial in /usr/lib/python2.7/dist-packages
Downloading/unpacking xmodem
  Downloading xmodem-0.4.5.tar.gz
  Running setup.py (path:/tmp/pip_build_root/xmodem/setup.py) egg_info for package xmodem
    
Downloading/unpacking pyrebase
  Downloading Pyrebase-3.0.27.tar.gz
  Running setup.py (path:/tmp/pip_build_root/pyrebase/setup.py) egg_info for package pyrebase
    
Downloading/unpacking pyasn1>=0.1.7 (from paramiko)
  Downloading pyasn1-0.3.7-py2.py3-none-any.whl (63kB): 63kB downloaded
Downloading/unpacking bcrypt>=3.1.3 (from paramiko)
  Downloading bcrypt-3.1.4.tar.gz (42kB): 42kB downloaded
  Running setup.py (path:/tmp/pip_build_root/bcrypt/setup.py) egg_info for package bcrypt
    
    warning: no previously-included files found matching 'requirements.txt'
    warning: no previously-included files found matching 'tasks.py'
    warning: no previously-included files found matching '.travis.yml'
    warning: no previously-included files found matching 'wheel-scripts'
    warning: no previously-included files found matching 'Jenkinsfile'
    warning: no previously-included files found matching '.jenkins'
    warning: no previously-included files matching '*' found under directory '.jenkins'
    warning: no previously-included files matching '*' found under directory 'wheel-scripts'
    no previously-included directories found matching '.travis'
Downloading/unpacking pynacl>=1.0.1 (from paramiko)
  Downloading PyNaCl-1.2.0.tar.gz (3.3MB): 3.3MB downloaded
  Running setup.py (path:/tmp/pip_build_root/pynacl/setup.py) egg_info for package pynacl
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/pynacl/setup.py", line 248, in <module>
        "Programming Language :: Python :: 3.6",
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 239, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggs
        replace_conflicting=True
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 620, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 858, in best_match
        return self.obtain(req, installer) # try and download/install
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870, in obtain
        return installer(requirement)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 314, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 616, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 646, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1028, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'i686-linux-gnu-gcc' failed with exit status 1
    Complete output from command python setup.py egg_info:
    Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory

 #include <Python.h>

                    ^

compilation terminated.

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/pynacl/setup.py", line 248, in <module>

    "Programming Language :: Python :: 3.6",

  File "/usr/lib/python2.7/distutils/core.py", line 111, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 239, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggs

    replace_conflicting=True

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 620, in resolve

    dist = best[req.key] = env.best_match(req, ws, installer)

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 858, in best_match

    return self.obtain(req, installer) # try and download/install

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870, in obtain

    return installer(requirement)

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 314, in fetch_build_egg

    return cmd.easy_install(req)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 616, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 646, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1028, in run_setup

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'i686-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pynacl
Storing debug log for failure in /home/brian/.pip/pip.log
brian@white:~/js-remote-test$ python driver.py --device=artik053 --app=iotjs --buildtype=debug
Traceback (most recent call last):
  File "driver.py", line 17, in <module>
    import API
  File "/home/brian/js-remote-test/API/__init__.py", line 16, in <module>
    import device
  File "/home/brian/js-remote-test/API/device/__init__.py", line 15, in <module>
    import artik053
  File "/home/brian/js-remote-test/API/device/artik053.py", line 16, in <module>
    import connection
  File "/home/brian/js-remote-test/API/device/connection/__init__.py", line 15, in <module>
    import serialcom
  File "/home/brian/js-remote-test/API/device/connection/serialcom.py", line 17, in <module>
    import xmodem
ImportError: No module named xmodem

It seems that we need several workaround solutions for getting ready for running js-remote-test on Ubuntu 14.04. However, it is not high priority. I would like to focus on measuring both of binary size and runtime memory. I will try to run on ubuntu 16.04 in VirtualBox. I am not sure I can run js-remote-test on virtualbox. But I think I can get binary size on virtualbox Ubuntu 16.04 instance.

You can use docker.

sudo docker pull iotjs/js_remote_test:0.1
sudo docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb iotjs/js_remote_test:0.1

In docker container,

cd js-remote-test 
git pull (optional)
python driver.py --device artik053 --app iotjs --port /dev/ttyUSB1 (check your port path)

@hs0225 I succeed to run on my Ubuntu 14.04 using your docker solution. Thank you. Why don't you introduce this solution in README.md?

@hs0225 docker solution worked on my Ubuntu 14.04 LTS. But it does not work on my Ubuntu 16.04.

$ sudo docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb iotjs/js_remote_test:0.1
panic: standard_init_linux.go:178: exec user process caused "exec format error" [recovered]
	panic: standard_init_linux.go:178: exec user process caused "exec format error"

goroutine 1 [running, locked to thread]:
panic(0x835c0c0, 0x975b1c40)
	/usr/lib/go-1.6/src/runtime/panic.go:481 +0x326
github.com/opencontainers/runc/vendor/github.com/urfave/cli.HandleAction.func1(0x975bb968)
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/vendor/github.com/urfave/cli/app.go:478 +0x2c1
panic(0x835c0c0, 0x975b1c40)
	/usr/lib/go-1.6/src/runtime/panic.go:443 +0x3fd
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0x975bb5f0, 0x974d2638, 0x975bb678)
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0xfd
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0x97500720, 0x86b3dc58, 0x975b1c40)
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x474
main.glob.func8(0x975421e0, 0x0, 0x0)
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/main_unix.go:26 +0x57
reflect.Value.call(0x8302400, 0x842f600, 0x13, 0x838d5b8, 0x4, 0x975bb928, 0x1, 0x1, 0x0, 0x0, ...)
	/usr/lib/go-1.6/src/reflect/value.go:435 +0xeeb
reflect.Value.Call(0x8302400, 0x842f600, 0x13, 0x975bb928, 0x1, 0x1, 0x0, 0x0, 0x0)
	/usr/lib/go-1.6/src/reflect/value.go:303 +0x8c
github.com/opencontainers/runc/vendor/github.com/urfave/cli.HandleAction(0x8302400, 0x842f600, 0x975421e0, 0x0, 0x0)
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/vendor/github.com/urfave/cli/app.go:487 +0x25f
github.com/opencontainers/runc/vendor/github.com/urfave/cli.Command.Run(0x838fac8, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x840dfa0, 0x51, 0x0, ...)
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/vendor/github.com/urfave/cli/command.go:191 +0xda7
github.com/opencontainers/runc/vendor/github.com/urfave/cli.(*App).Run(0x97534240, 0x974c4070, 0x2, 0x2, 0x0, 0x0)
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/vendor/github.com/urfave/cli/app.go:240 +0x92b
main.main()
	/build/runc-jpw_eJ/runc-1.0.0~rc2+docker1.12.6/_build/src/github.com/opencontainers/runc/main.go:137 +0xaf3

I would like to close this issue by updating guide and script. We have a lot of higher priority jobs.