niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
475 stars 76 forks source link

Issueas building the project #1

Closed juan-morales closed 5 years ago

juan-morales commented 5 years ago

Hello Niklas, I was trying to build the project but I got several error messages. After repeating the command again and again, finally I gont to the instance where the same error appearded.

Can you help me out with this? ( I already have PASCAL code to contribute to the repo, but cannot build it)

Errors (command runs are separate by the equal sign) :

usuario@usuario ~/proyectos/speed-comparison $ sudo make
[sudo] password for usuario: 
docker build -t="niklas-heer/speed-comparison" .
Sending build context to Docker daemon 1.644 MB
Step 1/26 : FROM niklasheer/arch-python:latest
latest: Pulling from niklasheer/arch-python
50dcfd569c3f: Pull complete 
2d3381b27f03: Pull complete 
04d3640b9047: Pull complete 
a2f2c28a83e2: Pull complete 
5b88467a0180: Pull complete 
f1798deb4541: Pull complete 
058ed4a28d08: Pull complete 
66e31026a20f: Pull complete 
bfb67539c170: Pull complete 
f06059aacc41: Pull complete 
Digest: sha256:570512b45e9fbca8cee1b4e000f876c95f721a35a94fc68f8787033de4c04dd9
Status: Downloaded newer image for niklasheer/arch-python:latest
 ---> 103d46c29e03
Step 2/26 : USER user
 ---> Running in 5473894b6032
 ---> 53356112c8bb
Removing intermediate container 5473894b6032
Step 3/26 : RUN gpg --recv-keys --keyserver hkp://pgp.mit.edu EF5430F071E1B235 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu C2BF0BC433CFC8B3 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu 702353E0F7E48EDB
 ---> Running in ec358ee84825
gpg: directory '/home/user/.gnupg' created
gpg: keybox '/home/user/.gnupg/pubring.kbx' created
gpg: keyserver receive failed: No data
The command '/bin/sh -c gpg --recv-keys --keyserver hkp://pgp.mit.edu EF5430F071E1B235 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu C2BF0BC433CFC8B3 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu 702353E0F7E48EDB' returned a non-zero code: 2
Makefile:4: recipe for target 'build' failed
make: *** [build] Error 2

===============================

usuario@usuario ~/proyectos/speed-comparison $ make
docker build -t="niklas-heer/speed-comparison" .
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.27/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=niklas-heer%2Fspeed-comparison&ulimits=null: dial unix /var/run/docker.sock: connect: permission denied
Makefile:4: recipe for target 'build' failed
make: *** [build] Error 1

===============================

~/proyectos/speed-comparison $ sudo make
docker build -t="niklas-heer/speed-comparison" .
Sending build context to Docker daemon 1.644 MB
Step 1/26 : FROM niklasheer/arch-python:latest
 ---> 103d46c29e03
Step 2/26 : USER user
 ---> Using cache
 ---> 53356112c8bb
Step 3/26 : RUN gpg --recv-keys --keyserver hkp://pgp.mit.edu EF5430F071E1B235 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu C2BF0BC433CFC8B3 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu 702353E0F7E48EDB
 ---> Running in 907e80a90bb9
gpg: directory '/home/user/.gnupg' created
gpg: keybox '/home/user/.gnupg/pubring.kbx' created
gpg: /home/user/.gnupg/trustdb.gpg: trustdb created
gpg: key EF5430F071E1B235: public key "Swift 4.x Release Signing Key <swift-infrastructure@swift.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: keyserver receive failed: No data
The command '/bin/sh -c gpg --recv-keys --keyserver hkp://pgp.mit.edu EF5430F071E1B235 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu C2BF0BC433CFC8B3 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu 702353E0F7E48EDB' returned a non-zero code: 2
Makefile:4: recipe for target 'build' failed
make: *** [build] Error 2

===============================

usuario@usuario ~/proyectos/speed-comparison $ sudo make
docker build -t="niklas-heer/speed-comparison" .
Sending build context to Docker daemon 1.644 MB
Step 1/26 : FROM niklasheer/arch-python:latest
 ---> 103d46c29e03
Step 2/26 : USER user
 ---> Using cache
 ---> 53356112c8bb
Step 3/26 : RUN gpg --recv-keys --keyserver hkp://pgp.mit.edu EF5430F071E1B235 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu C2BF0BC433CFC8B3 &&     gpg --recv-keys --keyserver hkp://pgp.mit.edu 702353E0F7E48EDB
 ---> Running in 61ef4593ba0f
gpg: directory '/home/user/.gnupg' created
gpg: keybox '/home/user/.gnupg/pubring.kbx' created
gpg: /home/user/.gnupg/trustdb.gpg: trustdb created
gpg: key EF5430F071E1B235: public key "Swift 4.x Release Signing Key <swift-infrastructure@swift.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key C2BF0BC433CFC8B3: 3 signatures not checked due to missing keys
gpg: key C2BF0BC433CFC8B3: public key "Ferenc Kovacs <tyrael@php.net>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key 702353E0F7E48EDB: 152 signatures not checked due to missing keys
gpg: key 702353E0F7E48EDB: public key "Thomas Dickey <dickey@invisible-island.net>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
 ---> c98d372b5be2
Removing intermediate container 61ef4593ba0f
Step 4/26 : RUN yay --noconfirm -S php56
 ---> Running in 4c7e0f50618d
==> Resolving Dependencies
map[libnsl:{}]
**Could not find all Deps
The command '/bin/sh -c yay --noconfirm -S php56' returned a non-zero code: 1
Makefile:4: recipe for target 'build' failed
make: *** [build] Error 1** <------------ I ended up here
juan-morales commented 5 years ago

forgot to say I am running Linux Mint 64bits

juan-morales commented 5 years ago

Finally, I ended Up using this Dockerfile


FROM niklasheer/arch-python:latest

# Switch user to be able to use yay
USER user

# Get the keys
RUN gpg --recv-keys --keyserver hkp://pgp.mit.edu EF5430F071E1B235 && \
    gpg --recv-keys --keyserver hkp://pgp.mit.edu C2BF0BC433CFC8B3 && \
    gpg --recv-keys --keyserver hkp://pgp.mit.edu 702353E0F7E48EDB

# Install packages from the AUR (changed php56 for php5.6)
RUN yay --noconfirm -S php5.6
# RUN yay --noconfirm -S swift-bin # doesn't work atm due to faulty icu55 package

# Switch back
USER root

# Programming languages (check the -Syyin pypy and --force in nodejs)
RUN pacman --noconfirm -Syy pypy
RUN pacman --noconfirm -S ruby
RUN pacman --noconfirm -S php
RUN pacman --noconfirm -S rust
RUN pacman --noconfirm -S go
RUN pacman --noconfirm -S --force nodejs
RUN pacman --noconfirm -S lua
RUN pacman --noconfirm -S julia
RUN pacman --noconfirm -S nim
RUN pacman --noconfirm -S crystal
RUN pacman --noconfirm -S kotlin

# Install R
RUN pacman --noconfirm -S r

# Install libc6 (new one)
RUN pacman --noconfirm -S glibc

# Install R packages
RUN R -e "install.packages('ggplot2', repos='http://cran.rstudio.com/')"

COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt

# Fix the problem with open_basedir restriction while running php56 (changed the php.ini file path)
RUN sed -i '/open_basedir/d' /etc/php/php.ini

ADD . /usr/src/app
WORKDIR /usr/src/app
ENV PYTHONPATH /usr/src/app

COPY ./comparison.py /
CMD ["/comparison.py"]

I left some notes in the comments inside the code.

I could make the project succesfully. Now I am having problems executing it. as there are some errors in the comparison.py script. I am debuging it too.

niklas-heer commented 5 years ago

Thank you for your comments. I haven't run it in a while, but arch is a moving target so sometimes it can just break.

Could you run it successfully in the meantime?