Skip to content
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
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: "clippy, rustfmt"
Expand All @@ -32,10 +32,10 @@ jobs:
name: Test
strategy:
matrix:
toolchain: [1.70.0, stable]
runs-on: ubuntu-22.04
toolchain: [1.85.0, stable]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
Expand All @@ -51,16 +51,16 @@ jobs:

deny-check:
name: cargo-deny
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2

publish-check:
name: Publish Check
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fetch
- name: cargo publish check
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Changed
- [PR#78](https://github.com/EmbarkStudios/cfg-expr/pull/78) updated the builtin target list to 1.86.0.
- [PR#78](https://github.com/EmbarkStudios/cfg-expr/pull/78) changed the MSRV to 1.85.0 and the edition to 2024.

## [0.18.0] - 2025-02-20
### Changed
- [PR#77](https://github.com/EmbarkStudios/cfg-expr/pull/77) updated the builtin target list to 1.84.1 and 1.85.0.
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ authors = [
"Embark <[email protected]>",
"Jake Shadle <[email protected]>",
]
edition = "2021"
edition = "2024"
license = "MIT OR Apache-2.0"
readme = "README.md"
rust-version = "1.70.0"
rust-version = "1.85.0"
documentation = "https://docs.rs/cfg-expr"
homepage = "https://github.com/EmbarkStudios/cfg-expr"
keywords = ["cargo", "rustc", "cfg"]
Expand All @@ -23,8 +23,8 @@ default = []
targets = ["target-lexicon"]

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

[dev-dependencies]
similar-asserts = "1.1"
similar-asserts = "1.7"
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.85.0] are supported.**
**A parser and evaluator for Rust `cfg()` expressions. Builtin targets as of [1.86.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.85.0-blue.svg)](https://forge.rust-lang.org/release/platform-support.html)
[![Rust Targets](https://img.shields.io/badge/Rust%20Targets-1.86.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.85.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.86.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.85.0]: (https://forge.rust-lang.org/release/platform-support.html)
[1.86.0]: (https://forge.rust-lang.org/release/platform-support.html)
9 changes: 3 additions & 6 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[graph]
all-features = true

[advisories]
vulnerability = "deny"
unmaintained = "deny"
notice = "deny"
ignore = [
]

Expand All @@ -13,9 +13,6 @@ unknown-registry = "deny"
unknown-git = "deny"

[licenses]
unlicensed = "deny"
allow-osi-fsf-free = "neither"
copyleft = "deny"
# We want really high confidence when inferring licenses from text
confidence-threshold = 0.93
allow = [
Expand Down
2 changes: 1 addition & 1 deletion examples/eval.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cfg_expr::{targets::get_builtin_target_by_triple, Expression, Predicate};
use cfg_expr::{Expression, Predicate, targets::get_builtin_target_by_triple};

fn main() {
let specific = Expression::parse(
Expand Down
10 changes: 6 additions & 4 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ impl TargetMatcher for target_lexicon::Triple {
#[allow(clippy::cognitive_complexity)]
#[allow(clippy::match_same_arms)]
fn matches(&self, tp: &TargetPredicate) -> bool {
use target_lexicon::*;
use TargetPredicate::{
Abi, Arch, Endian, Env, Family, HasAtomic, Os, Panic, PointerWidth, Vendor,
};
use target_lexicon::*;

const NUTTX: target_lexicon::Vendor =
target_lexicon::Vendor::Custom(target_lexicon::CustomVendor::Static("nuttx"));
Expand Down Expand Up @@ -143,6 +143,8 @@ impl TargetMatcher for target_lexicon::Triple {
Mips64Architecture::Mipsisa64r6 | Mips64Architecture::Mipsisa64r6el
)
)
} else if arch == &targ::Arch::amdgpu {
self.architecture == Architecture::AmdGcn
} else {
match arch.0.parse::<Architecture>() {
Ok(a) => match (self.architecture, a) {
Expand Down Expand Up @@ -263,9 +265,9 @@ impl TargetMatcher for target_lexicon::Triple {
Family(fam) => {
use OperatingSystem::{
Aix, AmdHsa, Bitrig, Cloudabi, Cuda, Darwin, Dragonfly, Emscripten, Espidf,
Freebsd, Fuchsia, Haiku, Hermit, Horizon, Hurd, Illumos, L4re, Linux, MacOSX,
Nebulet, Netbsd, None_, Openbsd, Redox, Solaris, TvOS, Uefi, Unknown, VisionOS,
VxWorks, Wasi, WasiP1, WasiP2, WatchOS, Windows, IOS,
Freebsd, Fuchsia, Haiku, Hermit, Horizon, Hurd, IOS, Illumos, L4re, Linux,
MacOSX, Nebulet, Netbsd, None_, Openbsd, Redox, Solaris, TvOS, Uefi, Unknown,
VisionOS, VxWorks, Wasi, WasiP1, WasiP2, WatchOS, Windows,
};

match self.operating_system {
Expand Down
4 changes: 2 additions & 2 deletions src/expr/parser.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{
error::{ParseError, Reason},
expr::{
lexer::{Lexer, Token},
ExprNode, Expression, Func, InnerPredicate,
lexer::{Lexer, Token},
},
};
use smallvec::SmallVec;
Expand Down Expand Up @@ -200,7 +200,7 @@ impl Expression {
"target_pointer_width",
"target_vendor",
]),
})
});
}
};

Expand Down
Loading