Skip to content

Modernize crate #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/bors.toml

This file was deleted.

62 changes: 27 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
on:
push:
branches: [ staging, trying, master ]
branches: [ master ]
pull_request:
merge_group:

name: Continuous integration

Expand All @@ -14,7 +15,7 @@ jobs:
matrix:
rust:
# MSRV
- 1.60.0
- "1.70.0"
- stable
os: [ubuntu-latest, macos-latest, windows-latest]
experimental: [false]
Expand All @@ -24,54 +25,45 @@ jobs:
experimental: true

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: llvm-tools-preview
- uses: actions/checkout@v4
- name: Setup Rust
shell: bash
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal
rustup default ${{ matrix.rust }}
rustup component add llvm-tools-preview clippy rustfmt
echo "::add-matcher::.github/workflows/rust.json"

- name: Clippy
run: cargo clippy -- -D warnings

- name: rustfmt
run: cargo fmt --all -- --check

- name: Build and install cargo-binutils
uses: actions-rs/cargo@v1
with:
command: install
args: --path . -f
run: cargo install --path . -f

- name: Run cargo-nm
uses: actions-rs/cargo@v1
with:
command: nm
args: --bin cargo-nm -- --undefined-only
run: cargo nm --bin cargo-nm -- --undefined-only

- name: Run cargo-objdump
uses: actions-rs/cargo@v1
with:
command: objdump
args: --bin cargo-objdump -- -h
run: cargo objdump --bin cargo-objdump -- -h

- name: Run cargo-objcopy (on Linux only)
if: matrix.os == 'ubuntu-latest'
uses: actions-rs/cargo@v1
with:
command: objcopy
args: --bin cargo-objdump -v -- -O binary objdump.bin
run: cargo objcopy --bin cargo-objdump -v -- -O binary objdump.bin

- name: Run cargo-size
uses: actions-rs/cargo@v1
with:
command: size
args: --bin cargo-size -v
run: cargo size --bin cargo-size -v

- name: Run cargo-strip (on Linux only)
if: matrix.os == 'ubuntu-latest'
uses: actions-rs/cargo@v1
with:
command: strip
args: --bin cargo-strip -v
run: cargo strip --bin cargo-strip -v

conclusion:
runs-on: ubuntu-latest
needs: ci
if: always()
steps:
- name: Result
run: exit 0
- name: Done
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
20 changes: 0 additions & 20 deletions .github/workflows/clippy.yml

This file was deleted.

23 changes: 9 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,15 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: ${{ matrix.target }}
override: true
- name: Setup Rust
shell: bash
run: |
rustup toolchain install stable --profile minimal
rustup default stable
echo "::add-matcher::.github/workflows/rust.json"
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.target }} --release
uses: Swatinem/rust-cache@v2
- run: cargo build --target ${{ matrix.target }} --release

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

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

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/rust.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"problemMatcher": [
{
"owner": "rust",
"pattern": [
{
"regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$",
"severity": 1,
"message": 4,
"code": 3
},
{
"regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$",
"file": 2,
"line": 3,
"column": 4
}
]
}
]
}
23 changes: 0 additions & 23 deletions .github/workflows/rustfmt.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

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

### Fixed

Expand Down
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
edition = "2018"
edition = "2021"
authors = [
"The Embedded WG Tools Team <[email protected]>",
"Jorge Aparicio <[email protected]>",
Expand All @@ -13,14 +13,15 @@ name = "cargo-binutils"
readme = "README.md"
repository = "https://github.com/rust-embedded/cargo-binutils/"
version = "0.3.6"
rust-version = "1.70.0"

[dependencies]
cargo_metadata = "0.15"
clap = "2.34"
cargo_metadata = "0.18.1"
clap = { version = "4.4.8", features = ["cargo", "wrap_help", "string"] }
regex = "1.5"
rustc-cfg = "0.5"
rustc-demangle = "0.1"
rustc_version = "0.4"
serde = "1.0"
toml = "0.5"
toml = "0.8.8"
anyhow = "1.0"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ linker = "rust-lld"

## Minimum Supported Rust Version (MSRV)

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

## License

Expand Down
Loading