DeadCodeProductions / dead

Other
50 stars 5 forks source link

How to use Docker to setup? #50

Open CodingTreeHole opened 1 year ago

CodingTreeHole commented 1 year ago

well,I tried to run ./build_docker.sh,and I failed.

Testing Coq... version 8.16.0--UNSUPPORTED
ERROR:Compcert requires a version of Coq between 8.12.0 and 8.15.2
....
==>ERROR:A failure occurred in build().
Aborting
->error making:compcert-git

I want to know how to fix it

CodingTreeHole commented 1 year ago
Cloning into 'CompCert'...
done.
==> Starting prepare()...
==> Starting pkgver()...
==> Updated version: compcert-git 3.11.r41.gabe1f24d-1
==> Sources are ready.
==> Making package: compcert-git 3.11.r41.gabe1f24d-1 (Thu Nov 10 16:00:33 2022)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Starting build()...
Testing assembler support for CFI directives... yes
Testing linker support for '-no-pie' / '-nopie' option... yes, '-no-pie'
Testing Coq... version 8.16.0 -- UNSUPPORTED
Error: CompCert requires a version of Coq between 8.12.0 and 8.15.2
Testing OCaml... version 4.14.0 -- good!
Testing OCaml native-code compiler... yes
Testing OCaml .opt compilers... yes
Testing Menhir... version 20220210 -- good!
Testing GNU make... version 4.3 (command 'make') -- good!
One or several required tools are missing or too old.  Aborting.
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: compcert-git
The command '/bin/sh -c yay -S --noconfirm --noprogressbar csmith                                        creduce-git                                        compcert-git' returned a non-zero code: 1
thetheodor commented 1 year ago

Hello, can you try this branch?

@Quarub would it make sense to upload a prebuilt docker image on dockerhub?

CodingTreeHole commented 1 year ago

Hello, can you try this branch?

@Quarub would it make sense to upload a prebuilt docker image on dockerhub?

I am honored to receive your prompt reply. I took your suggestion and tried the new branch. The good news is that the previous problem is solved, the bad news is that a new error is introduced:

Step 16/19 : RUN python3 -c 'from pathlib import Path; from dead_instrumenter import utils; utils.make_config(Path.home() / ".config/dead/instrumenter.json", True)'
 ---> Running in 5d7d154bcdfa
Cloning into 'dead_instrumenter'...
Note: switching to '4d0915d25efec3beecd83126f5bc0e4941693f92'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

-- The CXX compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/sbin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
  check_source_compiles: C: needs to be enabled before use.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
  /usr/lib64/cmake/llvm/FindFFI.cmake:44 (check_c_source_compiles)
  /usr/lib64/cmake/llvm/LLVMConfig.cmake:234 (find_package)
  CMakeLists.txt:4 (find_package)

-- Could NOT find FFI (missing: HAVE_FFI_CALL) 
CMake Error at /usr/share/cmake/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
  check_source_compiles: C: needs to be enabled before use.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
  /usr/lib64/cmake/llvm/FindTerminfo.cmake:21 (check_c_source_compiles)
  /usr/lib64/cmake/llvm/LLVMConfig.cmake:241 (find_package)
  CMakeLists.txt:4 (find_package)

-- Could NOT find Terminfo (missing: Terminfo_LINKABLE) 
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.13") 
-- Found LibXml2: /usr/lib/libxml2.so (found version "2.10.3") 
-- Found LLVM 14.0.6
-- Using LLVMConfig.cmake in /usr/lib64/cmake/llvm
CMake Error at /usr/share/cmake/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
  check_source_compiles: C: needs to be enabled before use.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
  /usr/lib64/cmake/llvm/FindFFI.cmake:44 (check_c_source_compiles)
  /usr/lib64/cmake/llvm/LLVMConfig.cmake:234 (find_package)
  /usr/lib64/cmake/clang/ClangConfig.cmake:9 (find_package)
  CMakeLists.txt:9 (find_package)

-- Could NOT find FFI (missing: HAVE_FFI_CALL) 
CMake Error at /usr/share/cmake/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
  check_source_compiles: C: needs to be enabled before use.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
  /usr/lib64/cmake/llvm/FindTerminfo.cmake:21 (check_c_source_compiles)
  /usr/lib64/cmake/llvm/LLVMConfig.cmake:241 (find_package)
  /usr/lib64/cmake/clang/ClangConfig.cmake:9 (find_package)
  CMakeLists.txt:9 (find_package)

-- Could NOT find Terminfo (missing: Terminfo_LINKABLE) 
CMake Error at CMakeLists.txt:14 (message):
  Found LLVM 14, but need LLVM 12

-- Using ClangConfig.cmake in /usr/lib64/cmake/clang
-- Configuring incomplete, errors occurred!
See also "/tmp/tmp1zb_72dg/dead_instrumenter/build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/dead/.local/lib/python3.10/site-packages/dead_instrumenter/utils.py", line 135, in make_config
    instrumenter = download_and_build(no_questions=no_questions)
  File "/home/dead/.local/lib/python3.10/site-packages/dead_instrumenter/utils.py", line 99, in download_and_build
    subprocess.run(shlex.split("cmake .."), check=True)
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '..']' returned non-zero exit status 1.
/home/dead/.config/dead/instrumenter.json does not exist
Downloanding and building dead-instrumenter
It will be installed under /home/dead/.local/bin
The command '/bin/sh -c python3 -c 'from pathlib import Path; from dead_instrumenter import utils; utils.make_config(Path.home() / ".config/dead/instrumenter.json", True)'' returned a non-zero code: 1

I use Ubuntu20.04 and Docker(Docker version 20.10.21, build baeda1f), I want to know how can I fix it.

Quarub commented 1 year ago

Hi @CodingTreeHole

~I updated the fix_docker branch. Could you try again?~ ~I was able to find a case for LLVM. Sadly, there seem to be some issue with finding cases for gcc. I'll investigate.~

Still buggy (20221114).

Quarub commented 1 year ago

Hi again @CodingTreeHole

we did some non-trivial changes and I missed some bugs which are not so easily fixed. At least not today.

I patched the building scripts for the v0.0.1 release in this branch. Can you try to run it?

Quarub commented 1 year ago

would it make sense to upload a prebuilt docker image on dockerhub?

@thetheodor Yes, let's make ccomp an optional dependency and then we should be fine in terms of licenses. Maybe we have to include some GPLs.

CodingTreeHole commented 1 year ago

Hi again @CodingTreeHole

we did some non-trivial changes and I missed some bugs which are not so easily fixed. At least not today.

I patched the building scripts for the v0.0.1 release in this branch. Can you try to run i

Thanks for your reply. I will try this new branch in January after finishing my current work😉

Quarub commented 1 year ago

@CodingTreeHole: Happy New Year! There's a new release with dependency updates and fixed issues, especially around the docker setup.

I hope the setup-experience is ok now. :D

(Edit: it's broken again)