Skip to content
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

build test - ignore #3354

Closed
wants to merge 28 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ jobs:
run: cargo clippy -p test_window_long
- name: Clippy test_winrt
run: cargo clippy -p test_winrt
- name: Clippy tool_bindgen
run: cargo clippy -p tool_bindgen
- name: Clippy tool_bindings
run: cargo clippy -p tool_bindings
- name: Clippy tool_gnu
Expand All @@ -295,8 +297,6 @@ jobs:
run: cargo clippy -p windows-implement
- name: Clippy windows-interface
run: cargo clippy -p windows-interface
- name: Clippy windows-metadata
run: cargo clippy -p windows-metadata
- name: Clippy windows-registry
run: cargo clippy -p windows-registry
- name: Clippy windows-result
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
-p cppwinrt
-p windows-implement
-p windows-interface
-p windows-metadata
-p windows-registry
-p windows-result
-p windows-strings
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msrv-windows-bindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
strategy:
matrix:
rust: [1.70.0, stable, nightly]
rust: [1.74.0, stable, nightly]
runs-on:
- windows-latest
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msrv-windows-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
strategy:
matrix:
rust: [1.70.0, stable, nightly]
rust: [1.74.0, stable, nightly]
runs-on:
- windows-latest
- ubuntu-latest
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/msrv-windows-metadata.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/msrv-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
strategy:
matrix:
rust: [1.70.0, stable, nightly]
rust: [1.74.0, stable, nightly]
runs-on: windows-latest
steps:
- name: Checkout
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/no-default-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jobs:
run: cargo check -p windows-implement --no-default-features
- name: Check windows-interface
run: cargo check -p windows-interface --no-default-features
- name: Check windows-metadata
run: cargo check -p windows-metadata --no-default-features
- name: Check windows-registry
run: cargo check -p windows-registry --no-default-features
- name: Check windows-result
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/raw-dylib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ jobs:
run: cargo test -p test_window_long --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_winrt
run: cargo test -p test_winrt --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test tool_bindgen
run: cargo test -p tool_bindgen --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test tool_bindings
run: cargo test -p tool_bindings --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test tool_gnu
Expand All @@ -326,8 +328,6 @@ jobs:
run: cargo test -p windows-implement --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-interface
run: cargo test -p windows-interface --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-metadata
run: cargo test -p windows-metadata --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-registry
run: cargo test -p windows-registry --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-result
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ jobs:
run: cargo test -p test_window_long --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test test_winrt
run: cargo test -p test_winrt --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test tool_bindgen
run: cargo test -p tool_bindgen --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test tool_bindings
run: cargo test -p tool_bindings --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test tool_gnu
Expand All @@ -323,8 +325,6 @@ jobs:
run: cargo test -p windows-implement --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-interface
run: cargo test -p windows-interface --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-metadata
run: cargo test -p windows-metadata --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-registry
run: cargo test -p windows-registry --target ${{ matrix.target }} ${{ matrix.etc }}
- name: Test windows-result
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"crates/samples/windows/*",
"crates/samples/components/*",
"crates/targets/*",
"crates/tests/bindgen",
"crates/tests/misc/*",
"crates/tests/winrt/*",
"crates/tools/*",
Expand All @@ -24,7 +25,6 @@ cppwinrt = { path = "crates/libs/cppwinrt" }
windows = { path = "crates/libs/windows" }
windows-bindgen = { path = "crates/libs/bindgen" }
windows-core = { path = "crates/libs/core" }
windows-metadata = { path = "crates/libs/metadata" }
windows-registry = { path = "crates/libs/registry" }
windows-result = { path = "crates/libs/result" }
windows-strings = { path = "crates/libs/strings" }
Expand Down
21 changes: 2 additions & 19 deletions crates/libs/bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "windows-bindgen"
version = "0.58.0"
authors = ["Microsoft"]
edition = "2021"
rust-version = "1.70"
rust-version = "1.74"
license = "MIT OR Apache-2.0"
description = "Windows metadata compiler"
description = "Windows code generator"
repository = "https://github.com/microsoft/windows-rs"
readme = "readme.md"

Expand All @@ -16,21 +15,5 @@ workspace = true
default-target = "x86_64-pc-windows-msvc"
targets = []

[features]
default = ["metadata"]
metadata = []

[dependencies]
windows-metadata = { path = "../metadata", version = "0.58.0" }
rayon = "1.7"

[dependencies.proc-macro2]
version = "1.0"
features = ["span-locations"]

[dependencies.serde]
version = "1.0"
features = ["derive"]

[dependencies.serde_json]
version = "1.0"
43 changes: 0 additions & 43 deletions crates/libs/bindgen/src/args.rs

This file was deleted.

52 changes: 52 additions & 0 deletions crates/libs/bindgen/src/derive.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
use super::*;

pub struct Derive(HashMap<TypeName, Vec<String>>);

impl Derive {
pub fn new(reader: &Reader, types: &TypeMap, derive: &[&str]) -> Self {
let mut map = HashMap::new();

for derive in derive {
let Some((name, derive)) = derive.split_once('=') else {
panic!("`--derive` must be `<type name>=Comma,Separated,List");
};

let tn = get_type_name(reader, name);

if !types.contains_key(&tn) {
panic!("type not included: `{name}`");
}

let derive = derive
.split(',')
.filter(|&derive| (!derive.is_empty()))
.map(|derive| derive.to_string())
.collect();
map.insert(tn, derive);
}

Self(map)
}

pub fn get(&self, type_name: TypeName) -> impl Iterator<Item = String> + '_ {
self.0.get(&type_name).into_iter().flatten().cloned()
}
}

fn get_type_name(reader: &Reader, path: &str) -> TypeName {
if let Some((namespace, name)) = path.rsplit_once('.') {
if let Some((namespace, types)) = reader.get_key_value(namespace) {
if let Some((name, _)) = types.get_key_value(name) {
return TypeName(namespace, name);
}
}
} else {
for (namespace, types) in reader.iter() {
if let Some((name, _)) = types.get_key_value(path) {
return TypeName(namespace, name);
}
}
}

panic!("type not found: `{path}`");
}
30 changes: 30 additions & 0 deletions crates/libs/bindgen/src/derive_writer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use super::*;

pub struct DeriveWriter(BTreeSet<String>);

impl DeriveWriter {
pub fn new(writer: &Writer, type_name: TypeName) -> Self {
let mut derive = BTreeSet::new();
derive.extend(writer.config.derive.get(type_name));
Self(derive)
}

pub fn extend<I, S>(&mut self, iter: I)
where
I: IntoIterator<Item = S>,
S: AsRef<str> + ToString,
{
self.0.extend(iter.into_iter().map(|s| s.to_string()));
}
}

impl ToTokens for DeriveWriter {
fn to_tokens(&self, tokens: &mut TokenStream) {
if !self.0.is_empty() {
let derive = self.0.iter().map(|derive| to_ident(derive));
tokens.combine(quote! {
#[derive(#(#derive),*)]
})
}
}
}
35 changes: 0 additions & 35 deletions crates/libs/bindgen/src/error.rs

This file was deleted.

Loading