A utopian CI setup part one: General build fixes (#60)

This commit is contained in:
Miles Wirht
2026-06-14 21:58:12 -04:00
committed by GitHub
parent 676d5897ae
commit 64318f59f3
9 changed files with 52 additions and 31 deletions
+12 -5
View File
@@ -3,17 +3,24 @@
rustflags = ["-C", "symbol-mangling-version=v0", "--cfg", "tokio_unstable"]
[alias]
xtask = "run --package xtask --"
perf-test = ["test", "--profile", "release-fast", "--lib", "--bins", "--tests", "--all-features", "--config", "target.'cfg(true)'.runner='cargo run -p perf --release'", "--config", "target.'cfg(true)'.rustflags=[\"--cfg\", \"perf_enabled\"]"]
# Keep similar flags here to share some ccache
perf-compare = ["run", "--profile", "release-fast", "-p", "perf", "--config", "target.'cfg(true)'.rustflags=[\"--cfg\", \"perf_enabled\"]", "--", "compare"]
lint = "clippy --workspace --all-targets -- -D warnings"
check-all = "check --workspace --all-targets"
test-all = "test --workspace --no-fail-fast"
test-doc = "test --workspace --doc"
build-all = "build --workspace --all-targets"
ci-fmt = "fmt --all -- --check"
[profile.ci]
inherits = "dev"
debug = "limited"
incremental = false
[target.'cfg(target_os = "windows")']
rustflags = [
"--cfg",
"windows_slim_errors", # This cfg will reduce the size of `windows::core::Error` from 16 bytes to 4 bytes
"-C",
"target-feature=+crt-static", # This fixes the linking issue when compiling livekit on Windows
"target-feature=+crt-static", # This fixes the linking issue when compiling livekit on Windows
]
# We need lld to link libwebrtc.a successfully on aarch64-linux
+2 -2
View File
@@ -12,8 +12,8 @@ mod example_prelude;
use example_prelude::init_example;
use gpui::colors::Colors;
use gpui::{
App, Bounds, Context, Div, Hsla, Render, Rgba, Window, WindowBounds, WindowOptions, div,
prelude::*, px, size,
Bounds, Context, Div, Hsla, Render, Rgba, Window, WindowBounds, WindowOptions, div, prelude::*,
px, size,
};
// Helper: Colored block for visualization
+1 -1
View File
@@ -43,7 +43,7 @@ use crate::{App, Entity, EntityId, Window, lerp::Lerp, linear};
/// ```
#[derive(Clone)]
pub struct Transition<T: Lerp + Clone + PartialEq + 'static> {
/// The amount of time for which this transtion should run.
/// The amount of time for which this transition should run.
duration_secs: f32,
/// A function that takes a delta between 0 and 1 and returns a new delta
+1
View File
@@ -3,6 +3,7 @@ name = "gpui_shared_string"
version = "0.1.0"
publish.workspace = true
edition.workspace = true
license.workspace = true
[lib]
path = "gpui_shared_string.rs"
+1 -1
View File
@@ -10,7 +10,7 @@ autoexamples = false
workspace = true
[features]
default = ["multithreaded"]
default = []
multithreaded = ["dep:wasm_thread"]
[lib]
+18 -11
View File
@@ -11,16 +11,23 @@ use web_time::Instant;
#[cfg(feature = "multithreaded")]
const MIN_BACKGROUND_THREADS: usize = 2;
#[cfg(feature = "multithreaded")]
fn shared_memory_supported() -> bool {
let global = js_sys::global();
let has_shared_array_buffer =
js_sys::Reflect::has(&global, &JsValue::from_str("SharedArrayBuffer")).unwrap_or(false);
let has_atomics = js_sys::Reflect::has(&global, &JsValue::from_str("Atomics")).unwrap_or(false);
let memory = js_sys::WebAssembly::Memory::from(wasm_bindgen::memory());
let buffer = memory.buffer();
let is_shared_buffer = buffer.is_instance_of::<js_sys::SharedArrayBuffer>();
has_shared_array_buffer && has_atomics && is_shared_buffer
#[cfg(feature = "multithreaded")]
{
let global = js_sys::global();
let has_shared_array_buffer =
js_sys::Reflect::has(&global, &JsValue::from_str("SharedArrayBuffer")).unwrap_or(false);
let has_atomics =
js_sys::Reflect::has(&global, &JsValue::from_str("Atomics")).unwrap_or(false);
let memory = js_sys::WebAssembly::Memory::from(wasm_bindgen::memory());
let buffer = memory.buffer();
let is_shared_buffer = buffer.is_instance_of::<js_sys::SharedArrayBuffer>();
has_shared_array_buffer && has_atomics && is_shared_buffer
}
#[cfg(not(feature = "multithreaded"))]
{
false
}
}
enum MainThreadItem {
@@ -138,7 +145,7 @@ unsafe impl Send for WebDispatcher {}
unsafe impl Sync for WebDispatcher {}
impl WebDispatcher {
pub fn new(browser_window: web_sys::Window, allow_threads: bool) -> Self {
pub fn new(browser_window: web_sys::Window, _allow_threads: bool) -> Self {
#[cfg(feature = "multithreaded")]
let (background_sender, background_receiver) = PriorityQueueReceiver::new();
#[cfg(not(feature = "multithreaded"))]
@@ -147,7 +154,7 @@ impl WebDispatcher {
let main_thread_mailbox = Arc::new(MainThreadMailbox::new());
#[cfg(feature = "multithreaded")]
let supports_threads = allow_threads && shared_memory_supported();
let supports_threads = _allow_threads && shared_memory_supported();
#[cfg(not(feature = "multithreaded"))]
let supports_threads = false;
+1 -1
View File
@@ -66,7 +66,7 @@ pub(crate) struct DirectXRenderer {
width: u32,
height: u32,
/// Whether we want to skip drwaing due to device lost events.
/// Whether we want to skip drawing due to device lost events.
///
/// In that case we want to discard the first frame that we draw as we got reset in the middle of a frame
/// meaning we lost all the allocated gpu textures and scene resources.
+1 -1
View File
@@ -938,7 +938,7 @@ impl WindowsWindowInner {
unsafe { GetWindowRect(handle, &mut rect) }.log_err();
// right and bottom bounds of RECT are exclusive, thus `-1`
let right = rect.right - rect.left - 1;
// the bounds include the padding frames, so accomodate for both of them
// the bounds include the padding frames, so accommodate for both of them
if right - 2 * frame_x <= cursor_point.x {
HTTOPRIGHT
} else {
+15 -9
View File
@@ -3,15 +3,6 @@ ignore-files = true
ignore-hidden = false
extend-exclude = [
".git/",
# Windows likes its abbreviations.
"crates/gpui/src/platform/windows/directx_renderer.rs",
"crates/gpui/src/platform/windows/events.rs",
"crates/gpui/src/platform/windows/direct_write.rs",
"crates/gpui/src/platform/windows/window.rs",
# macOS APIs
"crates/gpui/src/platform/mac/dispatcher.rs",
]
[default]
@@ -22,3 +13,18 @@ extend-ignore-re = [
"typ",
]
check-filename = true
[default.extend-words]
# Screen capture library (zed-scap)
scap = "scap"
# Win32 FORMATETC struct field: Pointer to DVTARGETDEVICE
ptd = "ptd"
# Part of mach_timebase_info_data_t (numerator)
numer = "numer"
# AMD GPU Services library
AGS = "AGS"
ags = "ags"
# Win32 TrackMouseEvent flags (e.g., TME_LEAVE)
TME = "TME"
# Level of Detail (DirectX/Graphics)
LOD = "LOD"