Skip to content

correctly take unstable-features #128

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 4 commits into from
Jan 23, 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
9 changes: 1 addition & 8 deletions .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = [
"ci (1.46.0, ubuntu-latest, false)",
"ci (1.46.0, macos-latest, false)",
"ci (1.46.0, windows-latest, false)",
"ci (stable, ubuntu-latest, false)",
"ci (stable, macos-latest, false)",
"ci (stable, windows-latest, false)",
]
status = ["conclusion"]
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
strategy:
fail-fast: false
matrix:
rust:
rust:
# MSRV
- 1.46.0
- 1.60.0
- stable
os: [ubuntu-latest, macos-latest, windows-latest]
experimental: [false]
Expand Down Expand Up @@ -69,3 +69,9 @@ jobs:
with:
command: strip
args: --bin cargo-strip -v
conclusion:
runs-on: ubuntu-latest
needs: ci
steps:
- name: Result
run: exit 0
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Changed

- MSRV Changed to 1.60
- Bump `rust-cfg` to 0.5 and `cargo_metadata` to 0.15

### Fixed

- Fixed incorrect parsing of `-Z` flags causing them to not be considered (#128)

## [v0.3.6] - 2022-06-20

### Added
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ repository = "https://github.com/rust-embedded/cargo-binutils/"
version = "0.3.6"

[dependencies]
cargo_metadata = "0.14"
clap = "2.33"
regex = "1.5.5"
rustc-cfg = "0.4"
cargo_metadata = "0.15"
clap = "2.34"
regex = "1.5"
rustc-cfg = "0.5"
rustc-demangle = "0.1"
rustc_version = "0.4"
serde = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ linker = "rust-lld"

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.46.0 and up. It *might*
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.

## License
Expand Down
24 changes: 12 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Context {
}

fn from_target_name(target_name: &str) -> Result<Self> {
let cfg = Cfg::of(target_name).map_err(|e| e.compat())?;
let cfg = Cfg::of(target_name)?;

Ok(Context {
cfg,
Expand Down Expand Up @@ -324,7 +324,7 @@ pub fn run(tool: Tool, matches: ArgMatches) -> Result<i32> {
if arch_name == "thumb" {
// `-arch-name=thumb` doesn't produce the right output so instead we pass
// `-triple=$target`, which contains more information about the target
lltool.args(&["--triple", &ctxt.target]);
lltool.args(["--triple", &ctxt.target]);
} else {
lltool.args(&[format!("--arch-name={}", arch_name)]);
}
Expand Down Expand Up @@ -391,7 +391,7 @@ pub fn run(tool: Tool, matches: ArgMatches) -> Result<i32> {
Tool::Size => postprocess::size(&output.stdout),
};

stdout.write_all(&*processed_output)?;
stdout.write_all(&processed_output)?;

if output.status.success() {
Ok(0)
Expand Down Expand Up @@ -474,19 +474,19 @@ fn cargo_build_args<'a>(matches: &'a ArgMatches<'a>, cargo: &mut Command) -> (Bu
}

let build_type = if matches.is_present("lib") {
cargo.args(&["--lib"]);
cargo.args(["--lib"]);
BuildType::Lib
} else if let Some(bin_name) = matches.value_of("bin") {
cargo.args(&["--bin", bin_name]);
cargo.args(["--bin", bin_name]);
BuildType::Bin(bin_name)
} else if let Some(example_name) = matches.value_of("example") {
cargo.args(&["--example", example_name]);
cargo.args(["--example", example_name]);
BuildType::Example(example_name)
} else if let Some(test_name) = matches.value_of("test") {
cargo.args(&["--test", test_name]);
cargo.args(["--test", test_name]);
BuildType::Test(test_name)
} else if let Some(bench_name) = matches.value_of("bench") {
cargo.args(&["--bench", bench_name]);
cargo.args(["--bench", bench_name]);
BuildType::Bench(bench_name)
} else {
BuildType::Any
Expand All @@ -503,7 +503,7 @@ fn cargo_build_args<'a>(matches: &'a ArgMatches<'a>, cargo: &mut Command) -> (Bu

if let Some(features) = matches.values_of("features") {
for feature in features {
cargo.args(&["--features", feature]);
cargo.args(["--features", feature]);
}
}
if matches.is_present("no-default-features") {
Expand All @@ -516,7 +516,7 @@ fn cargo_build_args<'a>(matches: &'a ArgMatches<'a>, cargo: &mut Command) -> (Bu
// NOTE we do *not* use `project.target()` here because Cargo will figure things out on
// its own (i.e. it will search and parse .cargo/config, etc.)
if let Some(target) = matches.value_of("target") {
cargo.args(&["--target", target]);
cargo.args(["--target", target]);
}

let verbose = matches.occurrences_of("verbose");
Expand All @@ -541,9 +541,9 @@ fn cargo_build_args<'a>(matches: &'a ArgMatches<'a>, cargo: &mut Command) -> (Bu
cargo.arg("--offline");
}

if let Some(unstable_features) = matches.values_of("Z") {
if let Some(unstable_features) = matches.values_of("unstable-features") {
for unstable_feature in unstable_features {
cargo.args(&["-Z", unstable_feature]);
cargo.args(["-Z", unstable_feature]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use anyhow::Result;

use crate::rustc::rustlib;

#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Tool {
Ar,
Cov,
Expand Down