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

zmerp-staging #2625

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions alvr/graphics/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ impl StreamRenderer {
}
}

/// # Safety
/// `hardware_buffer` must be a valid pointer to a ANativeWindowBuffer.
pub unsafe fn render(&self, hardware_buffer: *mut c_void, view_params: [StreamViewParams; 2]) {
// if hardware_buffer is available copy stream to staging texture
if !hardware_buffer.is_null() {
Expand Down
5 changes: 3 additions & 2 deletions alvr/server_core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,9 @@ pub fn handshake_loop(ctx: Arc<ConnectionContext>, lifecycle_state: Arc<RwLock<L
}
};

if let WiredConnectionStatus::NotReady(m) = status {
dbg_connection!("handshake_loop: Wired connection not ready: {m}");
#[cfg_attr(not(debug_assertions), allow(unused_variables))]
if let WiredConnectionStatus::NotReady(s) = status {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make this an expect ig

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. All allows should be turned into expect actually.

dbg_connection!("handshake_loop: Wired connection not ready: {s}");
thread::sleep(RETRY_CONNECT_MIN_INTERVAL);
continue;
}
Expand Down
26 changes: 17 additions & 9 deletions alvr/xtask/src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ pub fn clippy_ci() {
let stream = Deserializer::from_slice(&out.stdout).into_iter::<Value>();

// https://doc.rust-lang.org/cargo/reference/external-tools.html#json-messages
for message in stream.filter_map(|msg| {
let msg = msg.unwrap();
let messages = stream
.filter_map(|msg| {
let msg = msg.unwrap();

if msg.get("reason")? == "compiler-message" {
msg.get("message").map(|x| x.to_owned())
} else {
None
}
}) {
let msg: CompilerMessage = json::from_value(message).unwrap();
if msg.get("reason")? == "compiler-message" {
msg.get("message").map(|x| x.to_owned())
} else {
None
}
})
.collect::<Vec<_>>();

for message in &messages {
let msg: CompilerMessage = json::from_value(message.clone()).unwrap();

if msg.message_type != "diagnostic" {
continue;
Expand Down Expand Up @@ -100,4 +104,8 @@ pub fn clippy_ci() {
if !out.status.success() {
panic!("ci clippy didn't exit with 0 code, propagating failure");
}

if !messages.is_empty() {
panic!("ci clippy produced warnings");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure there's also other compiler messages than diagnostics (you'd have to check the rustc docs tho), but we should only cause a ci failure when a diagnostic is actually emitted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and there's actually some, but they're not very frequent. Either way the diagnostic message filtering should be moved to the main filter (or a second stacked filter_map), as that'll fully ensure that causes no issues.

}