Skip to content

Commit 19509f4

Browse files
authored
Merge pull request #132 from rust-embedded/modernize
Modernize crate
2 parents 7abd594 + 58811a6 commit 19509f4

File tree

12 files changed

+153
-207
lines changed

12 files changed

+153
-207
lines changed

.github/bors.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
on:
22
push:
3-
branches: [ staging, trying, master ]
3+
branches: [ master ]
44
pull_request:
5+
merge_group:
56

67
name: Continuous integration
78

@@ -14,7 +15,7 @@ jobs:
1415
matrix:
1516
rust:
1617
# MSRV
17-
- 1.60.0
18+
- "1.70.0"
1819
- stable
1920
os: [ubuntu-latest, macos-latest, windows-latest]
2021
experimental: [false]
@@ -24,54 +25,45 @@ jobs:
2425
experimental: true
2526

2627
steps:
27-
- uses: actions/checkout@v2
28-
- uses: actions-rs/toolchain@v1
29-
with:
30-
profile: minimal
31-
toolchain: ${{ matrix.rust }}
32-
override: true
33-
components: llvm-tools-preview
28+
- uses: actions/checkout@v4
29+
- name: Setup Rust
30+
shell: bash
31+
run: |
32+
rustup toolchain install ${{ matrix.rust }} --profile minimal
33+
rustup default ${{ matrix.rust }}
34+
rustup component add llvm-tools-preview clippy rustfmt
35+
echo "::add-matcher::.github/workflows/rust.json"
36+
37+
- name: Clippy
38+
run: cargo clippy -- -D warnings
39+
40+
- name: rustfmt
41+
run: cargo fmt --all -- --check
3442

3543
- name: Build and install cargo-binutils
36-
uses: actions-rs/cargo@v1
37-
with:
38-
command: install
39-
args: --path . -f
44+
run: cargo install --path . -f
4045

4146
- name: Run cargo-nm
42-
uses: actions-rs/cargo@v1
43-
with:
44-
command: nm
45-
args: --bin cargo-nm -- --undefined-only
47+
run: cargo nm --bin cargo-nm -- --undefined-only
4648

4749
- name: Run cargo-objdump
48-
uses: actions-rs/cargo@v1
49-
with:
50-
command: objdump
51-
args: --bin cargo-objdump -- -h
50+
run: cargo objdump --bin cargo-objdump -- -h
5251

5352
- name: Run cargo-objcopy (on Linux only)
5453
if: matrix.os == 'ubuntu-latest'
55-
uses: actions-rs/cargo@v1
56-
with:
57-
command: objcopy
58-
args: --bin cargo-objdump -v -- -O binary objdump.bin
54+
run: cargo objcopy --bin cargo-objdump -v -- -O binary objdump.bin
5955

6056
- name: Run cargo-size
61-
uses: actions-rs/cargo@v1
62-
with:
63-
command: size
64-
args: --bin cargo-size -v
57+
run: cargo size --bin cargo-size -v
6558

6659
- name: Run cargo-strip (on Linux only)
6760
if: matrix.os == 'ubuntu-latest'
68-
uses: actions-rs/cargo@v1
69-
with:
70-
command: strip
71-
args: --bin cargo-strip -v
61+
run: cargo strip --bin cargo-strip -v
62+
7263
conclusion:
7364
runs-on: ubuntu-latest
7465
needs: ci
66+
if: always()
7567
steps:
76-
- name: Result
77-
run: exit 0
68+
- name: Done
69+
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/clippy.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,15 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
steps:
2121
- uses: actions/checkout@v3
22-
- uses: actions-rs/toolchain@v1
23-
with:
24-
toolchain: stable
25-
profile: minimal
26-
target: ${{ matrix.target }}
27-
override: true
22+
- name: Setup Rust
23+
shell: bash
24+
run: |
25+
rustup toolchain install stable --profile minimal
26+
rustup default stable
27+
echo "::add-matcher::.github/workflows/rust.json"
2828
- name: Cache Dependencies
29-
uses: Swatinem/rust-cache@v1
30-
with:
31-
key: ${{ matrix.target }}
32-
- uses: actions-rs/cargo@v1
33-
with:
34-
command: build
35-
args: --target ${{ matrix.target }} --release
29+
uses: Swatinem/rust-cache@v2
30+
- run: cargo build --target ${{ matrix.target }} --release
3631

3732
- name: (Not Windows) Move executables and compress
3833
if: ${{ matrix.os != 'windows-latest' }}
@@ -73,7 +68,7 @@ jobs:
7368
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
7469

7570
- id: changelog-reader
76-
uses: mindsers/changelog-reader-action@v2.0.0
71+
uses: mindsers/changelog-reader-action@v2.2.2
7772
with:
7873
version: ${{ (github.ref_type == 'tag' && github.ref_name) || 'Unreleased' }}
7974

.github/workflows/rust.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "rust",
5+
"pattern": [
6+
{
7+
"regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$",
8+
"severity": 1,
9+
"message": 4,
10+
"code": 3
11+
},
12+
{
13+
"regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$",
14+
"file": 2,
15+
"line": 3,
16+
"column": 4
17+
}
18+
]
19+
}
20+
]
21+
}

.github/workflows/rustfmt.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Changed
1111

12-
- MSRV Changed to 1.60
13-
- Bump `rust-cfg` to 0.5 and `cargo_metadata` to 0.15
12+
- MSRV Changed to 1.70.0
13+
- Bump `rust-cfg` to 0.5, `cargo_metadata` to 0.18, `clap` to 4 and `toml` to 0.8
1414

1515
### Fixed
1616

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2018"
2+
edition = "2021"
33
authors = [
44
"The Embedded WG Tools Team <[email protected]>",
55
"Jorge Aparicio <[email protected]>",
@@ -13,14 +13,15 @@ name = "cargo-binutils"
1313
readme = "README.md"
1414
repository = "https://github.com/rust-embedded/cargo-binutils/"
1515
version = "0.3.6"
16+
rust-version = "1.70.0"
1617

1718
[dependencies]
18-
cargo_metadata = "0.15"
19-
clap = "2.34"
19+
cargo_metadata = "0.18.1"
20+
clap = { version = "4.4.8", features = ["cargo", "wrap_help", "string"] }
2021
regex = "1.5"
2122
rustc-cfg = "0.5"
2223
rustc-demangle = "0.1"
2324
rustc_version = "0.4"
2425
serde = "1.0"
25-
toml = "0.5"
26+
toml = "0.8.8"
2627
anyhow = "1.0"

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ linker = "rust-lld"
209209

210210
## Minimum Supported Rust Version (MSRV)
211211

212-
This crate is guaranteed to compile on stable Rust 1.60.0 and up. It *might*
213-
compile with older versions but that may change in any new patch release.
212+
This crate is guaranteed to compile on stable Rust 1.70.0 and up.
214213

215214
## License
216215

0 commit comments

Comments
 (0)