CI: Enable clippy on Windows (#8240)

Release Notes:

- N/A
This commit is contained in:
白山風露 2024-02-24 09:23:42 +09:00 committed by GitHub
parent 885ae2d863
commit aef299be3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 53 additions and 44 deletions

View File

@ -150,10 +150,10 @@ jobs:
~/.cargo/git/db/ ~/.cargo/git/db/
target/ target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
# todo!(windows): Actually run clippy
#- name: cargo clippy - name: cargo clippy
# shell: bash -euxo pipefail {0} shell: bash -euxo pipefail {0}
# run: script/clippy run: script/clippy
- name: Build Zed - name: Build Zed
run: cargo build -p zed run: cargo build -p zed

34
Cargo.lock generated
View File

@ -1247,17 +1247,6 @@ dependencies = [
"rustc-demangle", "rustc-demangle",
] ]
[[package]]
name = "backtrace-on-stack-overflow"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fd2d70527f3737a1ad17355e260706c1badebabd1fa06a7a053407380df841b"
dependencies = [
"backtrace",
"libc",
"nix 0.23.2",
]
[[package]] [[package]]
name = "base16ct" name = "base16ct"
version = "0.1.1" version = "0.1.1"
@ -5552,15 +5541,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "memoffset"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
dependencies = [
"autocfg",
]
[[package]] [[package]]
name = "memoffset" name = "memoffset"
version = "0.7.1" version = "0.7.1"
@ -5899,19 +5879,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
[[package]]
name = "nix"
version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"
dependencies = [
"bitflags 1.3.2",
"cc",
"cfg-if 1.0.0",
"libc",
"memoffset 0.6.5",
]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.24.3" version = "0.24.3"
@ -9249,7 +9216,6 @@ name = "storybook"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"backtrace-on-stack-overflow",
"chrono", "chrono",
"clap 4.4.4", "clap 4.4.4",
"collab_ui", "collab_ui",

View File

@ -156,6 +156,39 @@ mod linux {
} }
} }
// todo!("windows")
#[cfg(target_os = "windows")]
mod windows {
use std::path::Path;
use cli::{CliRequest, CliResponse};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use crate::{Bundle, InfoPlist};
impl Bundle {
pub fn detect(_args_bundle_path: Option<&Path>) -> anyhow::Result<Self> {
unimplemented!()
}
pub fn plist(&self) -> &InfoPlist {
unimplemented!()
}
pub fn path(&self) -> &Path {
unimplemented!()
}
pub fn launch(&self) -> anyhow::Result<(IpcSender<CliRequest>, IpcReceiver<CliResponse>)> {
unimplemented!()
}
pub fn zed_version_string(&self) -> String {
unimplemented!()
}
}
}
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
mod mac_os { mod mac_os {
use anyhow::Context; use anyhow::Context;

View File

@ -12,6 +12,7 @@ use std::{
path::Path, path::Path,
sync::Arc, sync::Arc,
}; };
#[cfg(unix)]
use tokio::signal::unix::SignalKind; use tokio::signal::unix::SignalKind;
use tower_http::trace::{self, TraceLayer}; use tower_http::trace::{self, TraceLayer};
use tracing::Level; use tracing::Level;
@ -109,6 +110,7 @@ async fn main() -> Result<()> {
.on_response(trace::DefaultOnResponse::new().level(Level::INFO)), .on_response(trace::DefaultOnResponse::new().level(Level::INFO)),
); );
#[cfg(unix)]
axum::Server::from_tcp(listener)? axum::Server::from_tcp(listener)?
.serve(app.into_make_service_with_connect_info::<SocketAddr>()) .serve(app.into_make_service_with_connect_info::<SocketAddr>())
.with_graceful_shutdown(async move { .with_graceful_shutdown(async move {
@ -127,6 +129,10 @@ async fn main() -> Result<()> {
} }
}) })
.await?; .await?;
// todo!("windows")
#[cfg(windows)]
unimplemented!();
} }
_ => { _ => {
Err(anyhow!( Err(anyhow!(

View File

@ -1,5 +1,7 @@
// todo!(linux): remove // todo!(linux): remove
#![cfg_attr(target_os = "linux", allow(dead_code))] #![cfg_attr(target_os = "linux", allow(dead_code))]
// todo!("windows"): remove
#![cfg_attr(windows, allow(dead_code))]
mod app_menu; mod app_menu;
mod keystroke; mod keystroke;
@ -61,9 +63,10 @@ pub(crate) fn current_platform() -> Rc<dyn Platform> {
pub(crate) fn current_platform() -> Rc<dyn Platform> { pub(crate) fn current_platform() -> Rc<dyn Platform> {
Rc::new(LinuxPlatform::new()) Rc::new(LinuxPlatform::new())
} }
// todo!("windows")
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
pub(crate) fn current_platform() -> Rc<dyn Platform> { pub(crate) fn current_platform() -> Rc<dyn Platform> {
todo!("windows") unimplemented!()
} }
pub(crate) trait Platform: 'static { pub(crate) trait Platform: 'static {

View File

@ -126,8 +126,9 @@ impl Platform for TestPlatform {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
return Arc::new(crate::platform::mac::MacTextSystem::new()); return Arc::new(crate::platform::mac::MacTextSystem::new());
// todo!("windows")
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
todo!("windows") unimplemented!()
} }
fn run(&self, _on_finish_launching: Box<dyn FnOnce()>) { fn run(&self, _on_finish_launching: Box<dyn FnOnce()>) {

View File

@ -1,3 +1,6 @@
// todo!("windows"): remove
#![cfg_attr(windows, allow(dead_code))]
use crate::{ use crate::{
point, AtlasTextureId, AtlasTile, Bounds, ContentMask, Corners, Edges, EntityId, Hsla, Pixels, point, AtlasTextureId, AtlasTile, Bounds, ContentMask, Corners, Edges, EntityId, Hsla, Pixels,
Point, ScaledPixels, StackingOrder, Point, ScaledPixels, StackingOrder,

View File

@ -45,6 +45,7 @@ async fn test_block_via_smol(cx: &mut gpui::TestAppContext) {
task.await; task.await;
} }
#[cfg(not(windows))]
#[gpui::test] #[gpui::test]
async fn test_symlinks(cx: &mut gpui::TestAppContext) { async fn test_symlinks(cx: &mut gpui::TestAppContext) {
init_test(cx); init_test(cx);

View File

@ -11,8 +11,6 @@ path = "src/storybook.rs"
[dependencies] [dependencies]
anyhow.workspace = true anyhow.workspace = true
# TODO: Remove after diagnosing stack overflow.
backtrace-on-stack-overflow = "0.3.0"
chrono = "0.4" chrono = "0.4"
clap = { version = "4.4", features = ["derive", "string"] } clap = { version = "4.4", features = ["derive", "string"] }
collab_ui = { workspace = true, features = ["stories"] } collab_ui = { workspace = true, features = ["stories"] }

View File

@ -37,8 +37,6 @@ struct Args {
} }
fn main() { fn main() {
// unsafe { backtrace_on_stack_overflow::enable() };
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger"); SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
menu::init(); menu::init();