trailofbits / multiplier

Code auditing productivity multiplier.
Apache License 2.0
437 stars 27 forks source link

Multiplier setup failure #571

Open PrachiP29 opened 2 months ago

PrachiP29 commented 2 months ago

I'm unable to set up Multiplier in Ubuntu. I tried setting up Multiplier in Ubuntu WSL but faced multiple issue. Following are the issues being faced:

  1. While installing the software mentioned under the prerequisite section, for each of the specific version, I'm getting "Unable to locate package" error.
  2. For python, the required version should be 3.12+ and while running the suggested command "sudo apt install python3.12-dev", I'm getting the error E: Unable to locate package python3.12-dev E: Couldn't find any package by glob 'python3.12-dev'
  3. Following the setup steps mentioned for Linux, on the command "sudo apt install build-essential ninja-build cmake graphviz xdot", one of the packages don't work.
  4. The version for clang in my machine is - "Ubuntu clang version 14.0.0-1ubuntu1.1". So, as per the steps, I tried the "sudo apt-get install clang-18", the command resulted in- "Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package clang-18" This similar error is being encountered when trying to upgrade the CMake version from current 3.22 to the desired 3.30+.
  5. Also, during the execution of steps to set up the environment, getting the error - cannot create directory ‘name’: Permission denied. After running the command as root user, I'm getting another error which is due to incompatibility of python version.
pgoodman commented 2 months ago

For python, the required version should be 3.12+ and while running the suggested command "sudo apt install python3.12-dev", I'm getting the error E: Unable to locate package python3.12-dev

So technically I think you can use pretty much any Python 3.x I think :-P My goal in stating a minimum of 3.12 is to get access to the sub-interpreters feature, which multiplier doesn't use, but which I want to use in downstream tools and didn't want to have to deal with Python ABI incompatibilities in the future. So you can try to let it just use whatever python 3 you have. Let me know how that goes.

Following the setup steps mentioned for Linux, on the command "sudo apt install build-essential ninja-build cmake graphviz xdot", one of the packages don't work.

You can skip graphviz and xdot. Do the others not work?

E: Unable to locate package clang-18"

Did you try the following? Note that in the documentation I accidentally had a variable ${LLVM_VER} instead of 18 in llvm-toolchain-$(lsb_release -cs)-18.

sudo apt install lsb_release

curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key | \
  gpg --dearmor - | \
  sudo tee /etc/apt/trusted.gpg.d/llvm.gpg

sudo apt-add-repository "deb https://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main"

sudo apt install clang-18

This similar error is being encountered when trying to upgrade the CMake version from current 3.22 to the desired 3.30+.

I find using the shell script installer from https://cmake.org/download/ to be easiest.

Also, during the execution of steps to set up the environment, getting the error - cannot create directory ‘name’: Permission denied. After running the command as root user, I'm getting another error which is due to incompatibility of python version.

I am not sure what is going on here.

By the way, have you tried using a pre-built release? You will need python 3.12 if you want to use the Python API embedded in the pre-built release. Then you can set up a virtual environment in which import multiplier works as follows:

$ python3.12 -m venv /path/multiplier/release
$ source /path/multiplier/release/bin/activate
(multiplier) $
PrachiP29 commented 2 months ago

After the execution of steps you mentioned, I'm still facing issues. Can you please share the step-by-step document that I should refer to? I'm currently referring to https://github.com/trailofbits/multiplier/blob/main/docs/BUILD.md

Did you try the following? Note that in the documentation I accidentally had a variable ${LLVM_VER} instead of 18 in llvm-toolchain-$(lsb_release -cs)-18.

sudo apt install lsb_release

curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key | \
  gpg --dearmor - | \
  sudo tee /etc/apt/trusted.gpg.d/llvm.gpg

sudo apt-add-repository "deb https://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main"

sudo apt install clang-18

Also, in the document I'm referring to, I can't find reference to the line that you mentioned in- "I accidentally had a variable ${LLVM_VER} instead of 18 in llvm-toolchain-$(lsb_release -cs)-18". The stated variable ${LLVM_VER} is not present and the command you shared here is same in the document I'm referring to. Can you please clarify?

pgoodman commented 2 months ago
Also, in the document I'm referring to, I can't find reference to the line that you mentioned in- "I accidentally had a variable ${LLVM_VER} instead of 18 in llvm-toolchain-$(lsb_release -cs)-18". The stated variable ${LLVM_VER} is not present and the command you shared here is same in the document I'm referring to. Can you please clarify?

The previous version of BUILD.md used ${LLVM_VER}. While going over your issue yesterday, I updated it.

After the execution of steps you mentioned, I'm still facing issues. Can you please share the step-by-step document that I should refer to?

What specific issues? Can you share a log of everything you've done, and the terminal output?

PrachiP29 commented 2 months ago

From the steps mentioned in BUILD.md, I've executed the below commands- sudo apt update Err:1 https://apt.kitware.com/ubuntu jammy InRelease Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. Fetched 3375 kB in 9s (368 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 15 packages can be upgraded. Run 'apt list --upgradable' to see them. W: Failed to fetch https://apt.kitware.com/ubuntu/dists/jammy/InRelease Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. W: Some index files failed to download. They have been ignored, or old ones used instead. sudo apt install build-essential ninja-build cmake graphviz xdot Err:1 https://apt.kitware.com/ubuntu jammy InRelease Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. Fetched 3375 kB in 9s (368 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 15 packages can be upgraded. Run 'apt list --upgradable' to see them. W: Failed to fetch https://apt.kitware.com/ubuntu/dists/jammy/InRelease Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. W: Some index files failed to download. They have been ignored, or old ones used instead. **sudo apt install lsb_release

curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key | \ gpg --dearmor - | \ sudo tee /etc/apt/trusted.gpg.d/llvm.gpg

sudo apt-add-repository "deb https://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main"

sudo apt install clang-18 in a sequence, on the execution of sudo apt install lsb_release**, getting the below error L https://apt.llvm.org/llvm-snapshot.gpg.key | \ gpg --dearmor - | \ sudo tee /etc/apt/trusted.gpg.d/llvm.gpg

sudo apt-add-repository "deb https://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main"

sudo apt install clang-18[sudo] password for prachi_p: Sorry, try again. [sudo] password for prachi_p: Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package lsb_release

pgoodman commented 2 months ago

It seems like your kitware (cmake) certificate is not valid or that there are issues with it. I recommend googling or asking chatgpt how to make it trust an untrusted certificate, or failing that, remove that certificate and any source lists / repositories associated with it. I'm not certain on precisely how to do this so you'll have to figure it out.

It may be that you already have lsb_release, you can test this out by trying to execute it as a command at the command-line. Really, though, you are using jammy, so just replace every instance of $(lsb_release -cs) with jammy and then ignore the installation of lsb_release.