Skip to content

Commit

Permalink
Update target list to 1.81.0 (#74)
Browse files Browse the repository at this point in the history
* Ignore new unstable key

* Update and pin target-lexicon

* Update target list to 1.81.0

* Update lint list

* Update CHANGELOG
  • Loading branch information
Jake-Shadle authored Sep 5, 2024
1 parent 4735a0b commit 2de737a
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ rustflags = [
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
"-Wclippy::mem_forget",
"-Wclippy::mismatched_target_os",
"-Wclippy::missing_enforced_import_renames",
"-Wclippy::mut_mut",
"-Wclippy::mutex_integer",
Expand Down Expand Up @@ -72,6 +71,7 @@ rustflags = [
"-Wclippy::useless_transmute",
"-Wclippy::verbose_file_reads",
"-Wclippy::zero_sized_map_values",
"-Wunexpected_cfgs",
"-Wfuture_incompatible",
"-Wnonstandard_style",
"-Wrust_2018_idioms",
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Changed
- [PR#74](https://github.com/EmbarkStudios/cfg-expr/pull/74) updated the builtin target list to 1.81.0.

## [0.16.0] - 2024-07-29
### Changed
- [PR#70](https://github.com/EmbarkStudios/cfg-expr/pull/70) updated the builtin target list to 1.78.0. Thanks [@sunshowers](https://github.com/sunshowers)!
- [PR#70](https://github.com/EmbarkStudios/cfg-expr/pull/70) updated the builtin target list to 1.80.0. Thanks [@sunshowers](https://github.com/sunshowers)!

## [0.15.8] - 2024-04-10
### Changed
Expand Down
231 changes: 231 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ targets = ["target-lexicon"]

[dependencies]
smallvec = "1.8"
target-lexicon = { version = "0.12.15", optional = true }
target-lexicon = { version = "=0.12.16", optional = true }

[dev-dependencies]
similar-asserts = "1.1"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

# `⚙️ cfg-expr`

**A parser and evaluator for Rust `cfg()` expressions. Builtin targets as of [1.80.0] are supported.**
**A parser and evaluator for Rust `cfg()` expressions. Builtin targets as of [1.81.0] are supported.**

[![Build Status](https://github.com/EmbarkStudios/cfg-expr/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/cfg-expr/actions?workflow=CI)
[![Crates.io](https://img.shields.io/crates/v/cfg-expr.svg)](https://crates.io/crates/cfg-expr)
[![Docs](https://docs.rs/cfg-expr/badge.svg)](https://docs.rs/cfg-expr)
[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust%20MSRV-1.70.0-blue?color=fc8d62&logo=rust)](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html)
[![Rust Targets](https://img.shields.io/badge/Rust%20Targets-1.80.0-blue.svg)](https://forge.rust-lang.org/release/platform-support.html)
[![Rust Targets](https://img.shields.io/badge/Rust%20Targets-1.81.0-blue.svg)](https://forge.rust-lang.org/release/platform-support.html)
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
[![Embark](https://img.shields.io/badge/embark-open%20source-blueviolet.svg)](https://embark.dev)
</div>
Expand All @@ -24,7 +24,7 @@

`cfg-expr` is a crate that can be used to parse and evaluate Rust `cfg()` expressions, both as declarable in Rust code itself, as well in cargo manifests' `[target.'cfg()'.dependencies]` sections.

It contains a list of all builtin targets known to rustc as of [1.80.0] that can be used to determine if a particular cfg expression is satisfiable.
It contains a list of all builtin targets known to rustc as of [1.81.0] that can be used to determine if a particular cfg expression is satisfiable.

```rust
use cfg_expr::{targets::get_builtin_target_by_triple, Expression, Predicate};
Expand Down Expand Up @@ -110,4 +110,4 @@ at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

[1.80.0]: (https://forge.rust-lang.org/release/platform-support.html)
[1.81.0]: (https://forge.rust-lang.org/release/platform-support.html)
7 changes: 5 additions & 2 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ impl TargetMatcher for target_lexicon::Triple {
Environment::LinuxKernel => env == &targ::Env::gnu,
_ => env.0.is_empty(),
},
OperatingSystem::WasiP1 => env.0.is_empty(),
OperatingSystem::WasiP1 => env == &targ::Env::p1,
OperatingSystem::WasiP2 => env == &targ::Env::p2,
OperatingSystem::Wasi => env.0.is_empty() || env == &targ::Env::p1,
_ => {
if env.0.is_empty() {
matches!(
Expand Down Expand Up @@ -367,7 +368,9 @@ impl TargetMatcher for target_lexicon::Triple {
if self.vendor == v {
true
} else if let target_lexicon::Vendor::Custom(custom) = &self.vendor {
custom.as_str() == "esp" && v == target_lexicon::Vendor::Espressif
matches!(custom.as_str(), "esp" | "esp32" | "esp32s2" | "esp32s3")
&& (v == target_lexicon::Vendor::Espressif
|| v == target_lexicon::Vendor::Unknown)
} else {
false
}
Expand Down
Loading

0 comments on commit 2de737a

Please sign in to comment.