Skip to content

Commit 4d3c8b0

Browse files
authored
Release prep (#72)
* Fix newer warnings Update version numbers and changelogs for release. Add github actions for building rust code. * Sync version numbers
1 parent 3a25213 commit 4d3c8b0

10 files changed

Lines changed: 77 additions & 16 deletions

File tree

.github/workflows/rust.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- "etw/rust/**"
8+
pull_request:
9+
branches: [ "main" ]
10+
paths:
11+
- "etw/rust/**"
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
CARGO_INCREMENTAL: 0
16+
RUST_BACKTRACE: short
17+
18+
defaults:
19+
run:
20+
working-directory: ./etw/rust
21+
22+
jobs:
23+
windows-buildtest:
24+
runs-on: windows-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Setup Cache
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.cargo/bin/
32+
~/.cargo/registry/index/
33+
~/.cargo/registry/cache/
34+
~/.cargo/git/db/
35+
target/
36+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
37+
- name: Build
38+
run: cargo build --verbose
39+
- name: Run tests
40+
run: cargo test --verbose

etw/rust/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
[workspace]
2+
resolver = "2"
3+
24
members = [
35
"tracelogging",
46
"tracelogging_dynamic",

etw/rust/tracelogging/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tracelogging"
3-
version = "1.2.2"
3+
version = "1.2.3"
44
edition = "2021"
55
authors = ["Microsoft"]
66
license = "MIT"
@@ -30,7 +30,7 @@ kernel_mode = []
3030
macros = ["dep:tracelogging_macros"]
3131

3232
[dependencies]
33-
tracelogging_macros = { optional = true, version = "= 1.2.0", path = "../tracelogging_macros" }
33+
tracelogging_macros = { optional = true, version = "= 1.2.3", path = "../tracelogging_macros" }
3434

3535
[dev-dependencies]
3636
windows = ">= 0.39"

etw/rust/tracelogging/src/changelog.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
#[allow(unused_imports)]
44
use crate::*; // For docs
55

6+
/// # v1.2.3 (2025-03-02)
7+
/// - Fix newer warnings about unsafe code
8+
/// - Update `tracelongging-macros` dependency to 1.2.1
9+
pub mod v1_2_3 {}
10+
611
/// # v1.2.2 (2024-05-20)
712
/// - tracelogging crate supports use in kernel mode via feature
813
/// `kernel_mode`.

etw/rust/tracelogging/src/native.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl ProviderContext {
175175
}
176176
#[cfg(all(windows, feature = "etw"))]
177177
{
178-
result = /* unsafe */ { &mut *self.cell.get() }.register(
178+
result = unsafe { &mut *self.cell.get() }.register(
179179
_provider_id,
180180
_callback_fn,
181181
_callback_context);
@@ -422,14 +422,16 @@ impl ProviderContextInner {
422422
filter_data: usize,
423423
outer_context: usize,
424424
) {
425-
(*(outer_context as *mut Self)).outer_callback_impl(
426-
source_id,
427-
event_control_code,
428-
level,
429-
match_any_keyword,
430-
match_all_keyword,
431-
filter_data,
432-
);
425+
unsafe {
426+
(*(outer_context as *mut Self)).outer_callback_impl(
427+
source_id,
428+
event_control_code,
429+
level,
430+
match_any_keyword,
431+
match_all_keyword,
432+
filter_data,
433+
);
434+
}
433435
}
434436
}
435437

etw/rust/tracelogging_dynamic/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tracelogging_dynamic"
3-
version = "1.2.2"
3+
version = "1.2.3"
44
edition = "2021"
55
authors = ["Microsoft"]
66
license = "MIT"
@@ -28,4 +28,4 @@ default = ["etw"]
2828
etw = ["tracelogging/etw"] # Logging is enabled if windows && etw.
2929

3030
[dependencies]
31-
tracelogging = { default-features = false, version = "= 1.2.2", path = "../tracelogging" }
31+
tracelogging = { default-features = false, version = "= 1.2.3", path = "../tracelogging" }

etw/rust/tracelogging_dynamic/src/changelog.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
#[allow(unused_imports)]
44
use crate::*; // For docs
55

6+
/// # v1.2.3 (2025-03-02)
7+
/// - Fix newer warnings about unsafe code
8+
/// - Update `tracelongging` dependency to 1.2.3
9+
pub mod v1_2_3 {}
10+
611
/// # v1.2.2 (2024-05-20)
712
/// - tracelogging crate supports use in kernel mode via feature
813
/// `kernel_mode`.

etw/rust/tracelogging_dynamic/src/provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ impl Provider {
329329
/// provider is dropped. (This is implied by the rules for `Pin` but repeated here
330330
/// for clarity.)
331331
pub unsafe fn register(self: Pin<&Self>) -> u32 {
332-
let result = self
332+
let result = unsafe { self
333333
.context
334-
.register(&self.id, self.callback_fn, self.callback_context);
334+
.register(&self.id, self.callback_fn, self.callback_context) };
335335
if result == 0 {
336336
self.context.set_information(
337337
2, // EventProviderSetTraits

etw/rust/tracelogging_macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tracelogging_macros"
3-
version = "1.2.0"
3+
version = "1.2.3"
44
edition = "2021"
55
authors = ["Microsoft"]
66
license = "MIT"

etw/rust/tracelogging_macros/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
#![allow(clippy::needless_return)]
55

66
//! Implements the macros that are exported by the tracelogging crate.
7+
//!
8+
//! # Changelog
9+
//!
10+
//! ## v1.2.3 (2025-03-02)
11+
//! - Fix `repr_packed_without_abi` warning.
12+
//!
13+
//! ## v1.2.0 (2023-05-23)
714
815
extern crate proc_macro;
916
use proc_macro::{Span, TokenStream};

0 commit comments

Comments
 (0)