Skip to content

Commit

Permalink
dev: Update to Rust v1.69.0 (linkerd#2402)
Browse files Browse the repository at this point in the history
Update dev to v40
  • Loading branch information
olix0r authored Apr 25, 2023
1 parent 2a32127 commit c30d39f
Show file tree
Hide file tree
Showing 58 changed files with 107 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkerd2-proxy",
"image": "ghcr.io/linkerd/dev:v39",
"image": "ghcr.io/linkerd/dev:v40",
"customizations": {
"vscode": {
"extensions": [
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: linkerd/dev/actions/setup-tools@v39
- uses: linkerd/dev/actions/setup-tools@v40
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: just action-lint

devcontainer-versions:
runs-on: ubuntu-latest
steps:
- uses: linkerd/dev/actions/setup-tools@v39
- uses: linkerd/dev/actions/setup-tools@v40
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: just action-dev-check
3 changes: 2 additions & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
timeout-minutes: 20
continue-on-error: true
steps:
- run: rustup toolchain install --profile=minimal beta
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just toolchain=beta fetch
- run: just toolchain=beta build
3 changes: 2 additions & 1 deletion .github/workflows/check-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ jobs:
check-all:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just check --exclude=linkerd-meshtls-boring
6 changes: 4 additions & 2 deletions .github/workflows/check-each.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:
list-changed-crates:
timeout-minutes: 10
runs-on: ubuntu-latest
container: docker://ghcr.io/linkerd/dev:v39-rust
container: docker://ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- uses: tj-actions/changed-files@db5dd7c176cf59a19ef6561bf1936f059dee4b74
id: changed-files
with:
Expand All @@ -46,12 +47,13 @@ jobs:
needs: list-changed-crates
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
strategy:
matrix:
crate: ${{ fromJson(needs.list-changed-crates.outputs.crates) }}
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just check-crate ${{ matrix.crate }}

2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: docker://ghcr.io/linkerd/dev:v39-rust
image: docker://ghcr.io/linkerd/dev:v40-rust
options: --security-opt seccomp=unconfined # 🤷
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ jobs:
deprecated:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: RUSTFLAGS="-D deprecated" just check --exclude=linkerd-meshtls-boring

6 changes: 4 additions & 2 deletions .github/workflows/fuzzers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
list-changed:
timeout-minutes: 3
runs-on: ubuntu-latest
container: docker://rust:1.64.0-bullseye
container: docker://rust:1.69.0-bullseye
steps:
- run: apt update && apt install -y jo
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- uses: tj-actions/changed-files@db5dd7c176cf59a19ef6561bf1936f059dee4b74
id: changed-files
- name: list changed crates
Expand All @@ -47,14 +48,15 @@ jobs:
needs: [list-changed]
timeout-minutes: 40
runs-on: ubuntu-latest
container: docker://rust:1.64.0-bullseye
container: docker://rust:1.69.0-bullseye
strategy:
matrix:
dir: ${{ fromJson(needs.list-changed.outputs.dirs) }}
steps:
- run: rustup toolchain add nightly
- run: cargo install cargo-fuzz
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- working-directory: ${{matrix.dir}}
run: cargo +nightly fetch
- working-directory: ${{matrix.dir}}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: |
just test-crate linkerd-app --no-run \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: linkerd/dev/actions/setup-tools@v39
- uses: linkerd/dev/actions/setup-tools@v40

- name: Install linkerd CLI (edge)
id: linkerd
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,29 @@ jobs:
clippy:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just clippy

fmt:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just check-fmt

docs:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just doc

3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
timeout-minutes: 20
continue-on-error: true
steps:
- run: rustup toolchain install --profile=minimal nightly
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just toolchain=nightly fetch
- run: just toolchain=nightly profile=release build
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ jobs:
continue-on-error: ${{ !needs.meta.outputs.publish }}
runs-on: ubuntu-latest
timeout-minutes: 40
container: docker://ghcr.io/linkerd/dev:v39-rust-musl
container: docker://ghcr.io/linkerd/dev:v40-rust-musl
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just arch=${{ matrix.arch }} libc=${{ matrix.libc }} rustup
- run: just arch=${{ matrix.arch }} libc=${{ matrix.libc }} profile=release build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: linkerd/dev/actions/setup-tools@v39
- uses: linkerd/dev/actions/setup-tools@v40
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: just sh-lint
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ jobs:
meshtls:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just clippy-crate linkerd-meshtls --no-default-features --features=boring,rustls
- run: |
Expand All @@ -42,9 +43,10 @@ jobs:
unit:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: |
just test-build \
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ permissions:
jobs:
devcontainer:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v39-rust
container: ghcr.io/linkerd/dev:v40-rust
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: |
VERSION="$(cat rust-toolchain)"
if [ "$(cargo --version | cut -d' ' -f2)" != "$VERSION" ]; then
Expand All @@ -27,7 +28,7 @@ jobs:
workflows:
runs-on: ubuntu-latest
steps:
- uses: linkerd/dev/actions/setup-tools@v39
- uses: linkerd/dev/actions/setup-tools@v40
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This is intended **DEVELOPMENT ONLY**, i.e. so that proxy developers can
# easily test the proxy in the context of the larger `linkerd2` project.

ARG RUST_IMAGE=ghcr.io/linkerd/dev:v39-rust
ARG RUST_IMAGE=ghcr.io/linkerd/dev:v40-rust

# Use an arbitrary ~recent edge release image to get the proxy
# identity-initializing and linkerd-await wrappers.
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _features := if features == "all" {
"--no-default-features --features=" + features
} else { "" }

# For dev:v39
# For dev:v40
export CXX := 'clang++-14'

#
Expand Down
6 changes: 3 additions & 3 deletions linkerd/app/core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ fn set_env(name: &str, cmd: &mut Command) {
fn main() {
set_env(
"GIT_BRANCH",
Command::new("git").args(&["rev-parse", "--abbrev-ref", "HEAD"]),
Command::new("git").args(["rev-parse", "--abbrev-ref", "HEAD"]),
);
set_env(
"GIT_SHA",
Command::new("git").args(&["rev-parse", "--short", "HEAD"]),
Command::new("git").args(["rev-parse", "--short", "HEAD"]),
);
set_env(
"GIT_VERSION",
Command::new("git").args(&["describe", "--always", "HEAD"]),
Command::new("git").args(["describe", "--always", "HEAD"]),
);
set_env("RUST_VERSION", Command::new("rustc").arg("--version"));

Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/core/src/errors/respond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ where
message,
..
} = rescue.rescue(error)?;
let t = Self::grpc_trailers(grpc_status, &*message, *emit_headers);
let t = Self::grpc_trailers(grpc_status, &message, *emit_headers);
*trailers = Some(t);
Poll::Ready(None)
}
Expand Down
1 change: 1 addition & 0 deletions linkerd/app/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//! - Metric labeling
#![deny(rust_2018_idioms, clippy::disallowed_methods, clippy::disallowed_types)]
#![allow(opaque_hidden_inferred_bound)]
#![forbid(unsafe_code)]

use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/gateway/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl Gateway {
svc::Param::<Option<watch::Receiver<profiles::Profile>>>::param(&parent)
.ok_or(GatewayDomainInvalid)?;
let init =
mk_routes(&*profile.borrow_and_update()).ok_or(GatewayDomainInvalid)?;
mk_routes(&profile.borrow_and_update()).ok_or(GatewayDomainInvalid)?;
outbound::http::spawn_routes(profile, init, mk_routes)
};

Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/gateway/src/http/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ where
if let ::http::Version::HTTP_11 | ::http::Version::HTTP_10 = request.version() {
request.headers_mut().insert(
http::header::HOST,
http::header::HeaderValue::from_str(&*self.host)
http::header::HeaderValue::from_str(&self.host)
.expect("Host header value must be valid"),
);
}
Expand Down
4 changes: 1 addition & 3 deletions linkerd/app/gateway/src/http/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ async fn upgraded_request_remains_relative_form() {
inbound,
outbound,
config: crate::Config {
allow_discovery: std::iter::once("example.com".parse().unwrap())
.into_iter()
.collect(),
allow_discovery: std::iter::once("example.com".parse().unwrap()).collect(),
},
};

Expand Down
1 change: 1 addition & 0 deletions linkerd/app/gateway/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(rust_2018_idioms, clippy::disallowed_methods, clippy::disallowed_types)]
#![allow(opaque_hidden_inferred_bound)]
#![forbid(unsafe_code)]

use linkerd_app_core::{
Expand Down
1 change: 1 addition & 0 deletions linkerd/app/inbound/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! endpoints inbound to the local application.
#![deny(rust_2018_idioms, clippy::disallowed_methods, clippy::disallowed_types)]
#![allow(opaque_hidden_inferred_bound)]
#![forbid(unsafe_code)]

mod accept;
Expand Down
9 changes: 3 additions & 6 deletions linkerd/app/inbound/src/policy/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ impl<S> Store<S> {
) -> Self {
let opaque_default_rx = Self::spawn_default(Self::make_opaque(default.clone()));
let cache = {
let opaque_rxs = opaque_ports.iter().flat_map(|range| {
range
.clone()
.into_iter()
.map(|port| (port, opaque_default_rx.clone()))
});
let opaque_rxs = opaque_ports
.iter()
.flat_map(|range| range.clone().map(|port| (port, opaque_default_rx.clone())));
let rxs = ports.into_iter().map(|(p, s)| {
// When using a fixed policy, we don't need to watch for changes. It's
// safe to discard the sender, as the receiver will continue to let us
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/inbound/src/policy/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ where
let authorized = {
let p = policy.server.borrow();
tracing::trace!(policy = ?p, "Authorizing connection");
check_authorized(&*p, policy.dst, client, &tls)
check_authorized(&p, policy.dst, client, &tls)
};
match authorized {
Ok(permit) => {
Expand Down Expand Up @@ -157,7 +157,7 @@ where
tokio::select! {
res = &mut call => return res.map_err(Into::into),
_ = policy.changed() => {
if let Err(denied) = check_authorized(&*policy.server.borrow(), policy.dst, client, &tls) {
if let Err(denied) = check_authorized(&policy.server.borrow(), policy.dst, client, &tls) {
let meta = policy.meta();
tracing::info!(
server.group = %meta.group(),
Expand Down
1 change: 0 additions & 1 deletion linkerd/app/integration/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ impl Client {
}
}

#[track_caller]
pub async fn get(&self, path: &str) -> String {
let req = self.request_builder(path);
let res = self.request(req.method("GET")).await.expect("response");
Expand Down
Loading

0 comments on commit c30d39f

Please sign in to comment.