Skip to content

Commit

Permalink
Revert "Support building with 1.57.0 compiler"
Browse files Browse the repository at this point in the history
This reverts the changes from 66e3293
to support the 1.57.0 compiler (leaving the rustdoc fixes).

Making the changes to support 1.57 felt disappointing to require for the
sake of Winit being able to better support Linux distro packaging. Even
with the changes we still wouldn't really support
1.57 without also upstreaming changes to `cargo ndk`.

The new plan is to bank on Winit bumping its own MSRV to at least
1.58 which seems more than reasonable considering that even 1.59
is already >6months old.

Ref: rust-windowing/winit#2453

This updates ci.yml to now build with 1.60, assuming that the above
PR will be accepted.
  • Loading branch information
rib committed Sep 1, 2022
1 parent 3a2fa5d commit b29162d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ jobs:
strategy:
fail-fast: false
matrix:
# We need to support the same compiler versions as Winit
rust_version: [1.57.0, stable]
# We need to support the same MSRV as Winit which we are currently
# assuming will be bumped to 1.60.0 soon:
# https://github.com/rust-windowing/winit/pull/2453
rust_version: [1.60.0, stable]
steps:
- uses: actions/checkout@v2

Expand Down
15 changes: 6 additions & 9 deletions android-activity/src/game_activity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,7 @@ impl AndroidAppInner {
} else {
-1
};
trace!(
"Calling ALooper_pollAll, timeout = {}",
timeout_milliseconds
);
trace!("Calling ALooper_pollAll, timeout = {timeout_milliseconds}");
let id = ALooper_pollAll(
timeout_milliseconds,
&mut fd,
Expand Down Expand Up @@ -265,9 +262,9 @@ impl AndroidAppInner {
_ => unreachable!(),
};

trace!("Read ID_MAIN command {} = {:?}", cmd_i, cmd);
trace!("Read ID_MAIN command {cmd_i} = {cmd:?}");

trace!("Calling android_app_pre_exec_cmd({})", cmd_i);
trace!("Calling android_app_pre_exec_cmd({cmd_i})");
ffi::android_app_pre_exec_cmd(native_app.as_ptr(), cmd_i);
match cmd {
MainEvent::ConfigChanged { .. } => {
Expand All @@ -294,19 +291,19 @@ impl AndroidAppInner {
trace!("Invoking callback for ID_MAIN command = {:?}", cmd);
callback(PollEvent::Main(cmd));

trace!("Calling android_app_post_exec_cmd({})", cmd_i);
trace!("Calling android_app_post_exec_cmd({cmd_i})");
ffi::android_app_post_exec_cmd(native_app.as_ptr(), cmd_i);
} else {
panic!("ALooper_pollAll returned ID_MAIN event with NULL android_poll_source!");
}
}
_ => {
error!("Ignoring spurious ALooper event source: id = {}, fd = {}, events = {:?}, data = {:?}", id, fd, events, source);
error!("Ignoring spurious ALooper event source: id = {id}, fd = {fd}, events = {events:?}, data = {source:?}");
}
}
}
_ => {
error!("Spurious ALooper_pollAll return value {} (ignored)", id);
error!("Spurious ALooper_pollAll return value {id} (ignored)");
}
}
}
Expand Down
17 changes: 7 additions & 10 deletions android-activity/src/native_activity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,14 @@ impl AndroidAppInner {
} else {
-1
};
trace!(
"Calling ALooper_pollAll, timeout = {}",
timeout_milliseconds
);
info!("Calling ALooper_pollAll, timeout = {timeout_milliseconds}");
let id = ALooper_pollAll(
timeout_milliseconds,
&mut fd,
&mut events,
&mut source as *mut *mut core::ffi::c_void,
);
trace!("pollAll id = {}", id);
info!("pollAll id = {id}");
match id {
ffi::ALOOPER_POLL_WAKE => {
trace!("ALooper_pollAll returned POLL_WAKE");
Expand Down Expand Up @@ -260,11 +257,11 @@ impl AndroidAppInner {
_ => unreachable!(),
};

trace!("Calling android_app_pre_exec_cmd({})", cmd_i);
trace!("Calling android_app_pre_exec_cmd({cmd_i})");
ffi::android_app_pre_exec_cmd(native_app.as_ptr(), cmd_i);

if let Some(cmd) = cmd {
trace!("Read ID_MAIN command {} = {:?}", cmd_i, cmd);
trace!("Read ID_MAIN command {cmd_i} = {cmd:?}");
match cmd {
MainEvent::ConfigChanged { .. } => {
self.config.replace(Configuration::clone_from_ptr(
Expand Down Expand Up @@ -293,7 +290,7 @@ impl AndroidAppInner {
callback(PollEvent::Main(cmd));
}

trace!("Calling android_app_post_exec_cmd({})", cmd_i);
trace!("Calling android_app_post_exec_cmd({cmd_i})");
ffi::android_app_post_exec_cmd(native_app.as_ptr(), cmd_i);
} else {
panic!("ALooper_pollAll returned ID_MAIN event with NULL android_poll_source!");
Expand All @@ -310,12 +307,12 @@ impl AndroidAppInner {
callback(PollEvent::Main(MainEvent::InputAvailable))
}
_ => {
error!("Ignoring spurious ALooper event source: id = {}, fd = {}, events = {:?}, data = {:?}", id, fd, events, source);
error!("Ignoring spurious ALooper event source: id = {id}, fd = {fd}, events = {events:?}, data = {source:?}");
}
}
}
_ => {
error!("Spurious ALooper_pollAll return value {} (ignored)", id);
error!("Spurious ALooper_pollAll return value {id} (ignored)");
}
}
}
Expand Down

0 comments on commit b29162d

Please sign in to comment.