Skip to content

Commit a3631a0

Browse files
committed
Build static binaries using ekidd/rust-musl-builder
1 parent 103f73c commit a3631a0

File tree

6 files changed

+92
-0
lines changed

6 files changed

+92
-0
lines changed

Cargo.lock

+57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

falconeri-worker/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ failure = "0.1.1"
99
falconeri_common = { path = "../falconeri_common" }
1010
glob = "0.2.11"
1111
log = "0.4.3"
12+
# Needed for ekidd/rust-musl-builder.
13+
openssl = "*"
14+
openssl-probe = "0.1.2"
1215
uuid = "0.6.5"

falconeri-worker/src/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ extern crate falconeri_common;
55
extern crate glob;
66
#[macro_use]
77
extern crate log;
8+
extern crate openssl;
9+
extern crate openssl_probe;
810
extern crate uuid;
911

1012
use failure::ResultExt;
@@ -14,6 +16,7 @@ use uuid::Uuid;
1416

1517
fn main() -> Result<()> {
1618
env_logger::init();
19+
openssl_probe::init_ssl_cert_env_vars();
1720

1821
// Parse our arguments (manually, so we don't need to drag in a ton of
1922
// libraries).

falconeri/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ env_logger = "0.5.10"
88
failure = "0.1.1"
99
falconeri_common = { path = "../falconeri_common" }
1010
log = "0.4.3"
11+
# Needed for ekidd/rust-musl-builder.
12+
openssl = "*"
13+
openssl-probe = "0.1.2"
1114
serde = "1.0"
1215
serde_derive = "1.0"
1316
serde_json = "1.0"

falconeri/src/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ extern crate failure;
44
extern crate falconeri_common;
55
#[macro_use]
66
extern crate log;
7+
extern crate openssl;
8+
extern crate openssl_probe;
79
extern crate serde;
810
#[macro_use]
911
extern crate serde_derive;
@@ -37,6 +39,7 @@ enum Opt {
3739

3840
fn main() -> Result<()> {
3941
env_logger::init();
42+
openssl_probe::init_ssl_cert_env_vars();
4043
let opt = Opt::from_args();
4144
debug!("Args: {:?}", opt);
4245

install-static

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#
3+
# Usage: ./install-static
4+
#
5+
# Build a static version of the `falconeri` tools and install it. Only works on
6+
# x86_64 systems. This assumes the current user has UID 1000. (We can remove
7+
# that restriction later by adding the source to the container and mounting
8+
# a volume on ./target, then using `docker cp` to copy out the binaries.)
9+
10+
# Standard paranoia.
11+
set -euo pipefail
12+
13+
# Build our binaries.
14+
docker run --rm -it \
15+
-v falconeri-cargo-git:/home/rust/.cargo/git \
16+
-v falconeri-cargo-registry:/home/rust/.cargo/registry \
17+
-v "$(pwd)":/home/rust/src \
18+
ekidd/rust-musl-builder \
19+
bash -c 'sudo chown -R rust:rust /home/rust/.cargo/git /home/rust/.cargo/registry && cargo build --all --release'
20+
21+
# Install our binaries.
22+
target_dir=./target/x86_64-unknown-linux-musl/release
23+
sudo cp "$target_dir/falconeri" "$target_dir/falconeri-worker" /usr/local/bin

0 commit comments

Comments
 (0)