-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detailed installation instructions for Ubuntu #275
Open
bbresearcher
wants to merge
12
commits into
trailofbits:master
Choose a base branch
from
bbresearcher:bbresearcher-patch-ubuntu-installation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f24a7c8
chore: Add Ubuntu install instructions
bbresearcher 26f86c8
chore: Add Ubuntu install instructions
bbresearcher 82dacf2
chore: Add Ubuntu install instructions
bbresearcher 36e13fa
chore: Add Ubuntu install instructions
bbresearcher b7c46ca
chore: Move to docs directory and fix typos
bbresearcher c04a464
chore: removing instructions file from root directory
bbresearcher 3360689
chore: Update path to Ubuntu installation file to docs directory
bbresearcher e45f555
fix: accept suggested changes
bbresearcher 47121c1
fix: accept suggested changes
bbresearcher 285ced7
fix: accept suggested changes
bbresearcher eca8f1d
fix: move Ubuntu instructions to bottom of section
bbresearcher 520ba7a
fix: Removing prerequisites section
bbresearcher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Installing Siderophile on a fresh installation of Ubuntu | ||
This page documents the installation process of Siderophile on a fresh installation of Ubuntu. | ||
There are two methods to install (crates.io or Github) and both are documented below. | ||
## Prerequisites | ||
1. Install curl if its not installed : `sudo apt install curl` | ||
2. Install Rust; follow instructions at: [The Official Rust Documentation](https://doc.rust-lang.org/book/ch01-01-installation.html) | ||
3. Install a compiler linker like GCC or Clang: `sudo apt install build-essential` | ||
|
||
## Installing using crates.io | ||
1. Install Siderophile using the command : `cargo install siderophile` | ||
2. You may get an error while compiling openssl-sys : `error: failed to run custom build command for openssl-sys v0.9.102` | ||
3. You can fix the above error by installing the libssl-dev package : `sudo apt install pkg-config libssl-dev` | ||
4. Reload the profile : `. ~/.profile` | ||
5. Re-issue the cargo install command: `cargo install siderophile` | ||
6. You may get an error as below: | ||
``` | ||
error: No suitable version of LLVM was found system-wide or pointed | ||
to by LLVM_SYS_140_PREFIX. | ||
``` | ||
7. To fix this you can install the missing version, the version is the number in the error text above eg. 140 or perhaps 170. In the above isntance it will be: `sudo apt install llvm-14` | ||
8. You may get an error about missing library `Polly` as below | ||
``` | ||
error: could not find native static library `Polly`, perhaps an -L flag is missing? | ||
``` | ||
9. To fix this error you can install the missing package(once agian taking into account the correct version): `sudo apt install libpolly-14-dev` | ||
10. Once the installation is finished running the help command will confirm the installation has completed successfully | ||
``` | ||
siderophile --help | ||
siderophile 0.2.1 | ||
|
||
USAGE: | ||
siderophile [FLAGS] [OPTIONS] | ||
|
||
FLAGS: | ||
--include-tests Count unsafe usage in tests | ||
--no-mark-closures Do not mark closures | ||
-h, --help Prints help information | ||
-V, --version Prints version information | ||
|
||
OPTIONS: | ||
--crate-name <NAME> Crate name (deprecated) | ||
-p, --package <SPEC> Package to be used as the root of the tree | ||
--mark <TEXT> Mark bad functions with TEXT | ||
--threshold <BADNESS> Minimum badness required to mark a function [default: 0] | ||
``` | ||
|
||
|
||
|
||
## Installing by building from github | ||
1. Before cloning the siderophile repository we will need to install the git command using: `sudo apt install git` | ||
2. Check the installation by issuing the command : `git --version` it should return a value similar to below: | ||
``` | ||
git version 2.43.0 | ||
``` | ||
3. Create a new directory and change the working directory for the project eg. `mkdir siderophile_build && cd ./siderophile_build` | ||
4. Clone the repo and cd into the siderophile driectory : `git clone https://github.com/trailofbits/siderophile && cd ./siderophile` | ||
5. Use the cargo build command to build the project : `cargo build` | ||
6. You may get the following error while compiling openssl-sys : `error: failed to run custom build command for openssl-sys v0.9.99` | ||
7. You can fix the above error by installing the libssl-dev package : `sudo apt install pkg-config libssl-dev` | ||
8. Reload the profile : `. ~/.proofile` | ||
9. You may get an error as below: | ||
``` | ||
error: No suitable version of LLVM was found system-wide or pointed | ||
to by LLVM_SYS_170_PREFIX. | ||
``` | ||
10. There are two possible fixes, and you may need to action one or both | ||
- The first way to fix this is to install the missing version, the version is the number in the error text above eg. 140 or perhaps 170. In the above isntance it will be: `sudo apt install llvm-17` | ||
- Or you may need to set the library in the cargo build command by issuing the command : `LLVM_SYS_170_PREFIX=/usr/lib/llvm-17 cargo build` | ||
11. You may get an error about a missing library `Polly` as below | ||
``` | ||
error: could not find native static library `Polly`, perhaps an -L flag is missing? | ||
``` | ||
12. To fix this error you can install the missing package(once agian taking into account the correct version): `sudo apt install libpolly-17-dev` | ||
13. Reload the profile : `. ~/.profile` | ||
14 You may get an error about a missing linking library `cc` and the description lower down in the error text about `libzstd` missing as below | ||
``` | ||
error: linking with `cc` failed: exit status: 1 | ||
.... | ||
.... | ||
/usr/bin/ld: cannot find -lzstd: No such file or directory | ||
``` | ||
15. To fix this error you can install the missing package: `sudo apt install libzstd-dev` | ||
16. The compiler may show errors but it will compile | ||
17. Siderophile can then be installed using the command: `cargo install --path .` | ||
18. Running the help command will confirm the installation has completed successfully | ||
``` | ||
siderophile --help | ||
siderophile 0.2.1 | ||
|
||
USAGE: | ||
siderophile [FLAGS] [OPTIONS] | ||
|
||
FLAGS: | ||
--include-tests Count unsafe usage in tests | ||
--no-mark-closures Do not mark closures | ||
-h, --help Prints help information | ||
-V, --version Prints version information | ||
|
||
OPTIONS: | ||
--crate-name <NAME> Crate name (deprecated) | ||
-p, --package <SPEC> Package to be used as the root of the tree | ||
--mark <TEXT> Mark bad functions with TEXT | ||
--threshold <BADNESS> Minimum badness required to mark a function [default: 0] | ||
``` | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put this under a new
docs/
subdirectory? I think that'll help keep the project's root a little simpler.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the file to the new directory, and also updated the readme with the new path, I also used to opportunity to fix typos I found.
Thank you for considering the contribution.