Skip to content

Commit

Permalink
feat!: bump MSRV to 1.81 (#3033)
Browse files Browse the repository at this point in the history
## Description

Bumps the MSRV from `1.76` to `1.81`

Closes #3031

## Breaking Changes

- MSRV changed

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
  • Loading branch information
dignifiedquire authored Dec 12, 2024
1 parent cf0f8cc commit 6e009a8
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
MSRV: "1.76"
MSRV: "1.81"
SCCACHE_CACHE_SIZE: "10G"
IROH_FORCE_STAGING_RELAYS: "1"

Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-05-02
toolchain: nightly-2024-11-30
- name: Install sccache
uses: mozilla-actions/[email protected]

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-05-02
toolchain: nightly-2024-11-30
- name: Install sccache
uses: mozilla-actions/[email protected]

Expand Down Expand Up @@ -68,6 +68,6 @@ jobs:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
Documentation for this PR has been generated and is available at: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.PREVIEW_PATH }}/iroh/
Last updated: ${{ env.TIMESTAMP }}
edit-mode: replace
34 changes: 17 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
MSRV: "1.76"
MSRV: "1.81"
SCCACHE_CACHE_SIZE: "10G"
BIN_NAMES: "iroh-relay,iroh-dns-server"
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
Expand Down Expand Up @@ -138,19 +138,19 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

- name: Checkout specified commit
if: inputs.base_hash != ''
uses: actions/checkout@v4
with:
ref: ${{ inputs.base_hash }}
submodules: recursive

- name: Set build arch
run: |
echo "RELEASE_ARCH=${{ matrix.release-arch }}" >> $GITHUB_ENV
echo "RELEASE_OS=${{ matrix.release-os }}" >> $GITHUB_ENV
- name: Define hash
if: matrix.os == 'ubuntu-latest'
id: define_hash
Expand All @@ -160,7 +160,7 @@ jobs:
- name: Ensure musl support
if: ${{ contains(matrix.cargo_targets, '-musl') }}
run: sudo apt-get install musl-tools -y

- name: Install Rust
if: matrix.os != 'windows-latest'
uses: dtolnay/rust-toolchain@stable
Expand All @@ -173,7 +173,7 @@ jobs:
run: |
rustup toolchain install stable
rustup target add ${{ matrix.cargo_targets }}
- name: build release
if: matrix.os != 'windows-latest'
shell: bash
Expand All @@ -183,60 +183,60 @@ jobs:
export CC=aarch64-linux-gnu-gcc
fi
cargo build --profile optimized-release --all-features --target ${{ matrix.cargo_targets }}
- name: build release
if: matrix.os == 'windows-latest'
run: cargo build --profile optimized-release --all-features --target ${{ matrix.cargo_targets }}

- name: attach artifacts
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: iroh-${{env.RELEASE_OS }}-${{env.RELEASE_ARCH}}
path: target/${{ matrix.cargo_targets }}/optimized-release/iroh
compression-level: 0

- name: attach artifacts
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: iroh-windows-amd64.exe
path: target/${{ matrix.cargo_targets }}/optimized-release/iroh.exe
compression-level: 0

- name: Setup awscli on linux
if: matrix.name == 'ubuntu-latest'
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
- name: Setup awscli on linux
if: matrix.name == 'ubuntu-arm-latest'
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
- name: Setup awscli on mac
if: matrix.os == 'macos-latest'
run: |
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
- name: Set aws credentials
if: matrix.os != 'windows-latest'
run: |
echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV
echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV
- name: push release
if: matrix.os != 'windows-latest'
run: |
aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-relay s3://vorc/iroh-relay-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress
aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-dns-server s3://vorc/iroh-dns-server-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress
- name: push release latest
if: matrix.os != 'windows-latest' && (github.event.inputs.mark_latest == 'true' || github.event_name == 'push')
run: |
Expand Down Expand Up @@ -290,7 +290,7 @@ jobs:
path: iroh-*.tar.gz
compression-level: 0
retention-days: 1

- name: attach artifacts
uses: actions/upload-artifact@v4
if : matrix.os == 'windows-latest'
Expand All @@ -307,4 +307,4 @@ jobs:
with:
release_version: ${{ needs.build_release.outputs.release_version }}
base_hash: ${{ needs.build_release.outputs.base_hash }}
publish: true
publish: true
16 changes: 8 additions & 8 deletions .github/workflows/test_relay_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
concurrency:
group: relay-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
MSRV: "1.76"
MSRV: "1.81"
SCCACHE_CACHE_SIZE: "10G"
IROH_FORCE_STAGING_RELAYS: "1"

jobs:
build_relay_server:
runs-on: [self-hosted, linux, X64]
Expand All @@ -33,11 +33,11 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Install sccache
uses: mozilla-actions/[email protected]

- name: build release
run: |
cargo build --release --all-features --bin iroh-relay
- name: Setup awscli on linux
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Expand All @@ -48,16 +48,16 @@ jobs:
echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV
echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV
- name: push release
run: |
aws s3 cp ./target/release/iroh-relay s3://vorc/iroh-relay-linux-amd64-${GITHUB_SHA::7} --no-progress
- name: Set iroh-relay tag
id: set_tag
run: |
echo ::set-output name=tag::${GITHUB_SHA::7}
deploy_iroh-relay:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion iroh-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = ["n0 team"]
repository = "https://github.com/n0-computer/iroh"

# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.76"
rust-version = "1.81"

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion iroh-net-report/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/n0-computer/iroh"
keywords = ["networking"]

# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.76"
rust-version = "1.81"

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion iroh-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
authors = ["n0 team"]
repository = "https://github.com/n0-computer/iroh"
keywords = ["networking", "holepunching", "p2p"]
rust-version = "1.76"
rust-version = "1.81"

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion iroh-relay/src/protos/disco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// The 6 byte header of all discovery messages.
pub const MAGIC: &str = "TS💬"; // 6 bytes: 0x54 53 f0 9f 92 ac
pub(crate) const MAGIC_LEN: usize = MAGIC.as_bytes().len();
pub(crate) const MAGIC_LEN: usize = MAGIC.len();
pub(crate) const KEY_LEN: usize = 32;

const MESSAGE_HEADER_LEN: usize = MAGIC_LEN + KEY_LEN;
Expand Down
9 changes: 4 additions & 5 deletions iroh-relay/src/protos/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl Frame {
client_public_key: _,
message,
signature: _,
} => MAGIC.as_bytes().len() + PUBLIC_KEY_LENGTH + message.len() + Signature::BYTE_SIZE,
} => MAGIC.len() + PUBLIC_KEY_LENGTH + message.len() + Signature::BYTE_SIZE,
Frame::SendPacket { dst_key: _, packet } => PUBLIC_KEY_LENGTH + packet.len(),
Frame::RecvPacket {
src_key: _,
Expand Down Expand Up @@ -368,17 +368,16 @@ impl Frame {
let res = match frame_type {
FrameType::ClientInfo => {
ensure!(
content.len()
>= PUBLIC_KEY_LENGTH + Signature::BYTE_SIZE + MAGIC.as_bytes().len(),
content.len() >= PUBLIC_KEY_LENGTH + Signature::BYTE_SIZE + MAGIC.len(),
"invalid client info frame length: {}",
content.len()
);
ensure!(
&content[..MAGIC.as_bytes().len()] == MAGIC.as_bytes(),
&content[..MAGIC.len()] == MAGIC.as_bytes(),
"invalid client info frame magic"
);

let start = MAGIC.as_bytes().len();
let start = MAGIC.len();
let client_public_key =
PublicKey::try_from(&content[start..start + PUBLIC_KEY_LENGTH])?;
let start = start + PUBLIC_KEY_LENGTH;
Expand Down
2 changes: 1 addition & 1 deletion iroh-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/n0-computer/iroh"
publish = true

# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.76"
rust-version = "1.81"

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/n0-computer/iroh"
keywords = ["quic", "networking", "holepunching", "p2p"]

# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.76"
rust-version = "1.81"

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion iroh/src/disco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::key;
// TODO: custom magicn
/// The 6 byte header of all discovery messages.
pub const MAGIC: &str = "TS💬"; // 6 bytes: 0x54 53 f0 9f 92 ac
pub const MAGIC_LEN: usize = MAGIC.as_bytes().len();
pub const MAGIC_LEN: usize = MAGIC.len();

/// Current Version.
const V0: u8 = 0;
Expand Down

0 comments on commit 6e009a8

Please sign in to comment.