Skip to content

Commit 61eb780

Browse files
authored
cargo: Omit patch versions from Cargo.toml files (#1504)
There's no need for us to specify patch versions in Cargo.toml files, since we commit our Cargo.lock file. These versions mean that dependency changes touch unnecessary files, requiring "shotgun surgery" for routine dependency bumps (and also triggering CI workflows for these subcrates). Let's omit patch versions from Cargo.toml. This change adds a `check-all` workflow that runs a faster `check --workspace` when `Cargo.lock` changes. Signed-off-by: Oliver Gould <ver@buoyant.io>
1 parent 5c45609 commit 61eb780

File tree

46 files changed

+139
-99
lines changed

Some content is hidden

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

46 files changed

+139
-99
lines changed

.github/workflows/check-all.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Check all crates.
2+
#
3+
# This workflow checks that `Cargo.lock` is configured sufficiently so that each
4+
# crate can be compiled on its
5+
# own.
6+
name: check-all
7+
8+
permissions:
9+
contents: read
10+
11+
on:
12+
pull_request:
13+
paths:
14+
- Cargo.lock
15+
- .github/workflows/check-all.yml
16+
17+
env:
18+
CARGO_ACTION_FMT_VERSION: v0.1.3
19+
CARGO_INCREMENTAL: 0
20+
CARGO_NET_RETRY: 10
21+
RUST_BACKTRACE: short
22+
RUSTUP_MAX_RETRIES: 10
23+
24+
jobs:
25+
check-all:
26+
timeout-minutes: 20
27+
runs-on: ubuntu-latest
28+
container:
29+
image: docker://rust:1.56.1-buster
30+
steps:
31+
- run: |
32+
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
33+
chmod 755 /usr/local/bin/cargo-action-fmt
34+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
35+
- run: cargo fetch
36+
- run: |
37+
cargo check --frozen \
38+
--workspace \
39+
--all-targets \
40+
--exclude=linkerd-meshtls-boring \
41+
--message-format=json | cargo-action-fmt
42+

.github/workflows/check-each.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
outputs:
7878
crates: ${{ steps.list-changed.outputs.crates }}
7979

80-
check:
80+
check-each:
8181
needs: list-changed-crates
8282
timeout-minutes: 20
8383
runs-on: ubuntu-latest

linkerd/addr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ publish = false
99
[dependencies]
1010
http = "0.2"
1111
linkerd-dns-name = { path = "../dns/name" }
12-
thiserror = "1.0"
12+
thiserror = "1"

linkerd/addr/fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cargo-fuzz = true
1212
libfuzzer-sys = "0.4"
1313
linkerd-addr = { path = ".." }
1414
linkerd-tracing = { path = "../../tracing", features = ["ansi"] }
15-
tracing = "0.1.29"
15+
tracing = "0.1"
1616

1717
# Prevent this from interfering with workspaces
1818
[workspace]

linkerd/app/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ linkerd-app-inbound = { path = "./inbound" }
2323
linkerd-app-outbound = { path = "./outbound" }
2424
linkerd-error = { path = "../error" }
2525
linkerd-opencensus = { path = "../opencensus" }
26-
regex = "1.5.4"
27-
thiserror = "1.0"
26+
regex = "1"
27+
thiserror = "1"
2828
tokio = { version = "1", features = ["rt"] }
29-
tokio-stream = { version = "0.1.8", features = ["time", "sync"] }
29+
tokio-stream = { version = "0.1", features = ["time", "sync"] }
3030
tonic = { version = "0.6", default-features = false, features = ["prost"] }
3131
tower = "0.4"
32-
tracing = "0.1.30"
32+
tracing = "0.1"

linkerd/app/core/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ independently of the inbound and outbound proxy logic.
1414

1515
[dependencies]
1616
bytes = "1"
17-
drain = { version = "0.1.0", features = ["retain"] }
17+
drain = { version = "0.1", features = ["retain"] }
1818
http = "0.2"
1919
http-body = "0.4"
20-
hyper = { version = "0.14.17", features = ["http1", "http2"] }
20+
hyper = { version = "0.14", features = ["http1", "http2"] }
2121
futures = { version = "0.3", default-features = false }
2222
ipnet = "2.3"
2323
linkerd-addr = { path = "../../addr" }
@@ -57,13 +57,13 @@ linkerd-transport-header = { path = "../../transport-header" }
5757
linkerd-transport-metrics = { path = "../../transport-metrics" }
5858
linkerd-tls = { path = "../../tls" }
5959
linkerd-trace-context = { path = "../../trace-context" }
60-
regex = "1.5.4"
60+
regex = "1"
6161
serde_json = "1"
62-
thiserror = "1.0"
62+
thiserror = "1"
6363
tokio = { version = "1", features = ["macros", "sync", "parking_lot"] }
64-
tokio-stream = { version = "0.1.8", features = ["time"] }
64+
tokio-stream = { version = "0.1", features = ["time"] }
6565
tonic = { version = "0.6", default-features = false, features = ["prost"] }
66-
tracing = "0.1.30"
66+
tracing = "0.1"
6767
parking_lot = "0.12"
6868
pin-project = "1"
6969

linkerd/app/gateway/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ futures = { version = "0.3", default-features = false }
1212
linkerd-app-core = { path = "../core" }
1313
linkerd-app-inbound = { path = "../inbound" }
1414
linkerd-app-outbound = { path = "../outbound" }
15-
thiserror = "1.0"
15+
thiserror = "1"
1616
tokio = { version = "1", features = ["sync"] }
1717
tower = { version = "0.4", default-features = false }
18-
tracing = "0.1.30"
18+
tracing = "0.1"
1919

2020
[dev-dependencies]
2121
tokio = { version = "1", features = ["rt", "macros"] }

linkerd/app/inbound/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ linkerd-server-policy = { path = "../../server-policy" }
1919
linkerd-tonic-watch = { path = "../../tonic-watch" }
2020
linkerd2-proxy-api = { version = "0.3", features = ["client", "inbound"] }
2121
parking_lot = "0.12"
22-
thiserror = "1.0"
22+
thiserror = "1"
2323
tokio = { version = "1", features = ["sync"] }
2424
tonic = { version = "0.6", default-features = false }
2525
tower = { version = "0.4", features = ["util"] }
26-
tracing = "0.1.30"
26+
tracing = "0.1"
2727

2828
[target.'cfg(fuzzing)'.dependencies]
29-
hyper = { version = "0.14.17", features = ["http1", "http2"] }
29+
hyper = { version = "0.14", features = ["http1", "http2"] }
3030
linkerd-app-test = { path = "../test" }
3131
arbitrary = { version = "1", features = ["derive"] }
32-
libfuzzer-sys = { version = "0.4.2", features = ["arbitrary-derive"] }
32+
libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] }
3333

3434
[dev-dependencies]
35-
hyper = { version = "0.14.17", features = ["http1", "http2"] }
35+
hyper = { version = "0.14", features = ["http1", "http2"] }
3636
linkerd-app-test = { path = "../test" }
3737
linkerd-io = { path = "../../io", features = ["tokio-test"] }
3838
linkerd-meshtls = { path = "../../meshtls", features = ["rustls"] }

linkerd/app/inbound/fuzz/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ edition = "2021"
1010
cargo-fuzz = true
1111

1212
[target.'cfg(fuzzing)'.dependencies]
13-
arbitrary = { version = "1", features = ["derive"] }
14-
hyper = { version = "0.14.9", features = ["http1", "http2"] }
13+
arbitrary = { version = "1", features = ["derive"] }
14+
hyper = { version = "0.14", features = ["http1", "http2"] }
1515
http = "0.2"
16-
libfuzzer-sys = { version = "0.4.2", features = ["arbitrary-derive"] }
16+
libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] }
1717
linkerd-app-core = { path = "../../core" }
1818
linkerd-app-inbound = { path = ".." }
1919
linkerd-app-test = { path = "../../test" }
@@ -35,4 +35,4 @@ test = true
3535
doc = false
3636

3737
[patch.crates-io]
38-
webpki = { git = "https://github.com/linkerd/webpki", branch = "cert-dns-names-0.22"}
38+
webpki = { git = "https://github.com/linkerd/webpki", branch = "cert-dns-names-0.22" }

linkerd/app/integration/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ futures = { version = "0.3", default-features = false, features = ["executor"] }
2424
h2 = "0.3"
2525
http = "0.2"
2626
http-body = "0.4"
27-
hyper = { version = "0.14.17", features = ["http1", "http2", "stream", "client", "server"] }
27+
hyper = { version = "0.14", features = ["http1", "http2", "stream", "client", "server"] }
2828
linkerd-app = { path = "..", features = ["allow-loopback"] }
2929
linkerd-app-core = { path = "../core" }
3030
linkerd-metrics = { path = "../../metrics", features = ["test_util"] }
@@ -35,16 +35,16 @@ parking_lot = "0.12"
3535
regex = "1"
3636
socket2 = "0.4"
3737
tokio = { version = "1", features = ["io-util", "net", "rt", "macros"] }
38-
tokio-stream = { version = "0.1.8", features = ["sync"] }
39-
tokio-rustls = "0.23.2"
40-
rustls-pemfile = "0.3.0"
38+
tokio-stream = { version = "0.1", features = ["sync"] }
39+
tokio-rustls = "0.23"
40+
rustls-pemfile = "0.3"
4141
tower = { version = "0.4", default-features = false }
4242
tonic = { version = "0.6", default-features = false }
43-
tracing = "0.1.30"
43+
tracing = "0.1"
4444
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "std"] }
4545

4646
[dev-dependencies]
47-
flate2 = { version = "1.0.22", default-features = false, features = ["rust_backend"] }
47+
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
4848
# No code from this crate is actually used; only necessary to enable the Rustls
4949
# implementation.
5050
linkerd-meshtls = { path = "../../meshtls", features = ["rustls"] }

0 commit comments

Comments
 (0)