Skip to content

Commit 126b514

Browse files
authored
Merge pull request #379 from rrybarczyk/use-workspaces
Use workspaces to separate crates
2 parents 63c1fa6 + 06091ce commit 126b514

File tree

76 files changed

+69
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+69
-57
lines changed

.travis.yml

+25-19
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,28 @@ before_install:
1111
- sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
1212

1313
script:
14-
- RUSTFLAGS="-C link-dead-code" cargo build --verbose
15-
- rm -f target/debug/lightning-* # Make sure we drop old test binaries
16-
- RUSTFLAGS="-C link-dead-code" cargo test --verbose
17-
- if [ "$(rustup show | grep default | grep 1.34.2)" != "" ]; then cd fuzz && cargo test --verbose && ./travis-fuzz.sh; fi
18-
- if [ "$(rustup show | grep default | grep stable)" != "" ]; then cd net-tokio && cargo build --verbose && cd ..; fi
19-
- if [ "$(rustup show | grep default | grep stable)" != "" ]; then
20-
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
21-
tar xzf master.tar.gz &&
22-
cd kcov-master &&
23-
mkdir build &&
24-
cd build &&
25-
cmake .. &&
26-
make &&
27-
make install DESTDIR=../../kcov-build &&
28-
cd ../.. &&
29-
rm -rf kcov-master &&
30-
for file in target/debug/lightning-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
31-
bash <(curl -s https://codecov.io/bash) &&
32-
echo "Uploaded code coverage"; fi
14+
# Build workspaces with Rust stable, beta, and 1.34.0
15+
- if [ "$(rustup show | grep default | grep 1.22.0)" == "" ]; then RUSTFLAGS="-C link-dead-code" cargo build --verbose; fi
16+
# Build lightning workspace with Rust 1.22.0
17+
- if [ "$(rustup show | grep default | grep 1.22.0)" != "" ]; then RUSTFLAGS="-C link-dead-code" cargo build --verbose -p lightning; fi
18+
- rm -f target/debug/lightning-* # Make sure we drop old test binaries
19+
# Test workspaces for Rust stable, beta, and 1.34.2
20+
- if [ "$(rustup show | grep default | grep 1.22.0)" == "" ]; then RUSTFLAGS="-C link-dead-code" cargo test --verbose; fi
21+
# Test lightning workspace for 1.22.0
22+
- if [ "$(rustup show | grep default | grep 1.22.0)" != "" ]; then RUSTFLAGS="-C link-dead-code" cargo test --verbose -p lightning; fi
23+
# Run lightning workspace fuzz tests for Rust 1.34.2
24+
- if [ "$(rustup show | grep default | grep 1.34.2)" != "" ]; then cd lightning/fuzz && cargo test --verbose && ./travis-fuzz.sh; fi
25+
- if [ "$(rustup show | grep default | grep stable)" != "" ]; then
26+
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
27+
tar xzf master.tar.gz &&
28+
cd kcov-master &&
29+
mkdir build &&
30+
cd build &&
31+
cmake .. &&
32+
make &&
33+
make install DESTDIR=../../kcov-build &&
34+
cd ../.. &&
35+
rm -rf kcov-master &&
36+
for file in target/debug/lightning-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
37+
bash <(curl -s https://codecov.io/bash) &&
38+
echo "Uploaded code coverage"; fi

Cargo.toml

+5-37
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,6 @@
1-
[package]
2-
name = "lightning"
3-
version = "0.0.9"
4-
authors = ["Matt Corallo"]
5-
license = "Apache-2.0"
6-
repository = "https://github.com/rust-bitcoin/rust-lightning/"
7-
description = """
8-
A Bitcoin Lightning library in Rust.
9-
Does most of the hard work, without implying a specific runtime, requiring clients implement basic network logic, chain interactions and disk storage.
10-
Still missing tons of error-handling. See GitHub issues for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to build a client around it to even try.
11-
"""
1+
[workspace]
122

13-
[features]
14-
# Supports tracking channels with a non-bitcoin chain hashes. Currently enables all kinds of fun DoS attacks.
15-
non_bitcoin_chain_hash_routing = []
16-
fuzztarget = ["secp256k1/fuzztarget", "bitcoin/fuzztarget", "bitcoin_hashes/fuzztarget"]
17-
# Unlog messages superior at targeted level.
18-
max_level_off = []
19-
max_level_error = []
20-
max_level_warn = []
21-
max_level_info = []
22-
max_level_debug = []
23-
24-
[dependencies]
25-
bitcoin = "0.20"
26-
bitcoin_hashes = "0.7"
27-
secp256k1 = "0.15"
28-
29-
[dev-dependencies.bitcoin]
30-
version = "0.20"
31-
features = ["bitcoinconsensus"]
32-
33-
[dev-dependencies]
34-
hex = "0.3"
35-
rand = "0.4"
36-
37-
[profile.dev]
38-
opt-level = 1
3+
members = [
4+
"lightning",
5+
"lightning-net-tokio",
6+
]

net-tokio/Cargo.toml renamed to lightning-net-tokio/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2
1111
[dependencies]
1212
bitcoin = "0.20"
1313
bitcoin_hashes = "0.7"
14-
lightning = { version = "0.0.9", path = "../" }
14+
lightning = { version = "0.0.9", path = "../lightning" }
1515
secp256k1 = "0.15"
1616
tokio-codec = "0.1"
1717
futures = "0.1"
File renamed without changes.

lightning/Cargo.toml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[package]
2+
name = "lightning"
3+
version = "0.0.9"
4+
authors = ["Matt Corallo"]
5+
license = "Apache-2.0"
6+
repository = "https://github.com/rust-bitcoin/rust-lightning/"
7+
description = """
8+
A Bitcoin Lightning library in Rust.
9+
Does most of the hard work, without implying a specific runtime, requiring clients implement basic network logic, chain interactions and disk storage.
10+
Still missing tons of error-handling. See GitHub issues for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to build a client around it to even try.
11+
"""
12+
13+
[features]
14+
# Supports tracking channels with a non-bitcoin chain hashes. Currently enables all kinds of fun DoS attacks.
15+
non_bitcoin_chain_hash_routing = []
16+
fuzztarget = ["secp256k1/fuzztarget", "bitcoin/fuzztarget", "bitcoin_hashes/fuzztarget"]
17+
# Unlog messages superior at targeted level.
18+
max_level_off = []
19+
max_level_error = []
20+
max_level_warn = []
21+
max_level_info = []
22+
max_level_debug = []
23+
24+
[dependencies]
25+
bitcoin = "0.20"
26+
bitcoin_hashes = "0.7"
27+
secp256k1 = "0.15"
28+
29+
[dev-dependencies.bitcoin]
30+
version = "0.20"
31+
features = ["bitcoinconsensus"]
32+
33+
[dev-dependencies]
34+
hex = "0.3"
35+
rand = "0.4"
36+
37+
[profile.dev]
38+
opt-level = 1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)