Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Require macOS 12 and SDK 26 (#65994)

Kirill Bulatovf14592c4a5bd
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 8ed5893b99e..1a39d412a93 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -21,4 +21,4 @@ rustflags = [
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[env]
-MACOSX_DEPLOYMENT_TARGET = "10.15.7"
+MACOSX_DEPLOYMENT_TARGET = "12.0"
diff --git a/.github/actionlint.yml b/.github/actionlint.yml
index fc1ba2c67ff..649c0f67cdb 100644
--- a/.github/actionlint.yml
+++ b/.github/actionlint.yml
@@ -32,6 +32,7 @@ self-hosted-runner:
- namespace-profile-8x32-ubuntu-2004-arm-m4
# Namespace mac
- namespace-profile-mac-large
+ - namespace-profile-mac-large-xcode26
- namespace-profile-mac-small
# Self Hosted Runners
- self-mini-macos
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 330025b34dd..93b51f1015e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -541,7 +541,7 @@ jobs:
- run_tests_mac
- clippy_mac
- check_scripts
- runs-on: namespace-profile-mac-large
+ runs-on: namespace-profile-mac-large-xcode26
env:
CARGO_INCREMENTAL: 0
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
@@ -604,7 +604,7 @@ jobs:
- run_tests_mac
- clippy_mac
- check_scripts
- runs-on: namespace-profile-mac-large
+ runs-on: namespace-profile-mac-large-xcode26
env:
CARGO_INCREMENTAL: 0
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml
index 1719f78d65f..b493de49dc9 100644
--- a/.github/workflows/release_nightly.yml
+++ b/.github/workflows/release_nightly.yml
@@ -264,7 +264,7 @@ jobs:
bundle_mac_aarch64:
needs:
- run_tests_linux
- runs-on: namespace-profile-mac-large
+ runs-on: namespace-profile-mac-large-xcode26
env:
CARGO_INCREMENTAL: 0
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
@@ -331,7 +331,7 @@ jobs:
bundle_mac_x86_64:
needs:
- run_tests_linux
- runs-on: namespace-profile-mac-large
+ runs-on: namespace-profile-mac-large-xcode26
env:
CARGO_INCREMENTAL: 0
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
diff --git a/.github/workflows/run_bundling.yml b/.github/workflows/run_bundling.yml
index 5f409261617..4750e647399 100644
--- a/.github/workflows/run_bundling.yml
+++ b/.github/workflows/run_bundling.yml
@@ -174,7 +174,7 @@ jobs:
if: |-
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
- runs-on: namespace-profile-mac-large
+ runs-on: namespace-profile-mac-large-xcode26
env:
CARGO_INCREMENTAL: 0
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
@@ -236,7 +236,7 @@ jobs:
if: |-
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
- runs-on: namespace-profile-mac-large
+ runs-on: namespace-profile-mac-large-xcode26
env:
CARGO_INCREMENTAL: 0
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
diff --git a/Cargo.lock b/Cargo.lock
index 5ad009b1e59..f1723ab985f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -7557,6 +7557,7 @@ dependencies = [
"objc2-core-video",
"objc2-foundation 0.3.2",
"objc2-screen-capture-kit",
+ "objc2-uniform-type-identifiers",
"objc2-user-notifications",
"parking_lot",
"raw-window-handle",
@@ -11639,6 +11640,7 @@ dependencies = [
"objc2 0.6.3",
"objc2-core-foundation",
"objc2-foundation 0.3.2",
+ "objc2-uniform-type-identifiers",
]
[[package]]
@@ -11931,6 +11933,16 @@ dependencies = [
"objc2-quartz-core 0.3.2",
]
+[[package]]
+name = "objc2-uniform-type-identifiers"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7902ac02859fc1f7045f8b598c63f1ae0cc7efeaa06a9bc9f3d9a3c955974fa4"
+dependencies = [
+ "objc2 0.6.3",
+ "objc2-foundation 0.3.2",
+]
+
[[package]]
name = "objc2-user-notifications"
version = "0.3.2"
diff --git a/Cargo.toml b/Cargo.toml
index 02cc09064f3..ab712b9220d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -808,6 +808,7 @@ objc2-screen-capture-kit = { version = "=0.3.2", default-features = false, featu
"SCStream",
"std"
] }
+objc2-uniform-type-identifiers = { version = "0.3", default-features = false, features = ["std", "UTCoreTypes", "UTType"] }
objc2-user-notifications = { version = "0.3", default-features = false, features = [
"std",
"block2",
diff --git a/crates/cli/build.rs b/crates/cli/build.rs
index 45c444d4973..71777191673 100644
--- a/crates/cli/build.rs
+++ b/crates/cli/build.rs
@@ -7,7 +7,7 @@ fn main() {
}
if cfg!(target_os = "macos") {
- println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15.7");
+ println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=12.0");
}
// Populate git sha environment variable if git is available
diff --git a/crates/gpui_apple/build.rs b/crates/gpui_apple/build.rs
index 530959482d1..a5fdda2d571 100644
--- a/crates/gpui_apple/build.rs
+++ b/crates/gpui_apple/build.rs
@@ -7,6 +7,8 @@ fn main() {
#[cfg(any(target_os = "macos", target_os = "ios"))]
mod apple_build {
+ #[cfg(not(feature = "runtime_shaders"))]
+ use std::ffi::OsString;
use std::{
env,
path::{Path, PathBuf},
@@ -126,6 +128,9 @@ mod apple_build {
fn compile_metal_shaders(header_path: &Path) {
use std::process::{self, Command};
+ println!("cargo:rerun-if-env-changed=SDKROOT");
+ println!("cargo:rerun-if-env-changed=DEVELOPER_DIR");
+
// Build scripts run on the host, so the target platform must come from
// Cargo's environment rather than `cfg!`. The target environment, not the
// target name, identifies simulators: `x86_64-apple-ios` has no `-sim` suffix.
@@ -134,7 +139,7 @@ mod apple_build {
let target_env = env::var("CARGO_CFG_TARGET_ENV")
.expect("Cargo sets CARGO_CFG_TARGET_ENV for build scripts");
let (sdk, minimum_version_argument) = match (target_os.as_str(), target_env.as_str()) {
- ("macos", _) => ("macosx", "-mmacosx-version-min=10.15.7"),
+ ("macos", _) => ("macosx", "-mmacosx-version-min=12.0"),
("ios", "sim") => ("iphonesimulator", "-mios-simulator-version-min=15.0"),
("ios", "") => ("iphoneos", "-mios-version-min=15.0"),
_ => {
@@ -145,6 +150,12 @@ mod apple_build {
}
};
+ let sdk = if target_os == "macos" {
+ env::var_os("SDKROOT").unwrap_or_else(|| OsString::from(sdk))
+ } else {
+ OsString::from(sdk)
+ };
+
let shader_path = "./src/shaders.metal";
let air_output_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("shaders.air");
let metallib_output_path =
@@ -159,9 +170,9 @@ mod apple_build {
std::fs::copy(shader_path, &staged_shader_path).unwrap();
let output = Command::new("xcrun")
+ .arg("-sdk")
+ .arg(&sdk)
.args([
- "-sdk",
- sdk,
"metal",
"-gline-tables-only",
minimum_version_argument,
@@ -183,7 +194,9 @@ mod apple_build {
}
let output = Command::new("xcrun")
- .args(["-sdk", sdk, "metallib"])
+ .arg("-sdk")
+ .arg(&sdk)
+ .arg("metallib")
.arg(&air_output_path)
.arg("-o")
.arg(metallib_output_path)
diff --git a/crates/gpui_macos/Cargo.toml b/crates/gpui_macos/Cargo.toml
index 85f6f15ed16..cf2f85f063f 100644
--- a/crates/gpui_macos/Cargo.toml
+++ b/crates/gpui_macos/Cargo.toml
@@ -42,12 +42,13 @@ image.workspace = true
itertools.workspace = true
log.workspace = true
objc2.workspace = true
-objc2-app-kit.workspace = true
+objc2-app-kit = { workspace = true, features = ["objc2-uniform-type-identifiers"] }
objc2-core-graphics = { workspace = true, features = ["CGColor", "objc2"] }
objc2-core-media = { workspace = true, optional = true }
objc2-core-video = { workspace = true, features = ["CVHostTime"] }
objc2-foundation.workspace = true
objc2-screen-capture-kit = { workspace = true, optional = true }
+objc2-uniform-type-identifiers.workspace = true
objc2-user-notifications.workspace = true
parking_lot.workspace = true
raw-window-handle.workspace = true
diff --git a/crates/gpui_macos/src/window.rs b/crates/gpui_macos/src/window.rs
index 0ef42cb538a..01807c773aa 100644
--- a/crates/gpui_macos/src/window.rs
+++ b/crates/gpui_macos/src/window.rs
@@ -27,7 +27,7 @@ use ctor::ctor;
use futures::channel::oneshot;
use gpui_util::ResultExt;
use objc2::{
- AnyThread, MainThreadMarker, class, msg_send,
+ AnyThread, MainThreadMarker, Message, class, msg_send,
rc::{Retained, autoreleasepool},
runtime::{AnyClass, AnyObject, AnyProtocol, Bool, ClassBuilder, ProtocolObject, Sel},
sel,
@@ -52,6 +52,7 @@ use objc2_foundation::{
NSArray, NSInteger, NSNotFound, NSOperatingSystemVersion, NSPoint, NSProcessInfo, NSRect,
NSSize, NSString, NSUInteger, NSURL,
};
+use objc2_uniform_type_identifiers::{UTType, UTTypeData, UTTypeFolder};
use parking_lot::Mutex;
use raw_window_handle as rwh;
use smallvec::SmallVec;
@@ -2264,25 +2265,27 @@ impl PlatformWindow for MacWindow {
// recommendation for large item counts), and by file *type* rather than
// `iconForFile:`, which can synchronously hit LaunchServices, network
// mounts, or iCloud for every selected path and beachball drag startup.
- // `iconForFileType:` is deprecated in favor of `iconForContentType:`,
- // but the replacement requires macOS 11 and we target 10.15.
- let file_type = if *is_directory {
- "public.folder".to_string()
- } else {
- path.extension()
- .and_then(|extension| extension.to_str())
- .map(|extension| extension.to_string())
- .unwrap_or_else(|| "public.data".to_string())
- };
+ let is_directory = *is_directory;
+ let extension = path
+ .extension()
+ .and_then(|extension| extension.to_str())
+ .map(String::from);
let provider = RcBlock::new(move || {
let component = NSDraggingImageComponent::draggingImageComponentWithKey(
NSDraggingImageComponentIconKey,
);
let workspace = NSWorkspace::sharedWorkspace();
- let file_type = NSString::from_str(&file_type);
- // TODO: Replace with `iconForContentType` once Zed no longer supports MacOS 10.15
- #[expect(deprecated, reason = "Support for MacOS 10.15")]
- let icon = workspace.iconForFileType(&file_type);
+ let content_type = if is_directory {
+ UTTypeFolder.retain()
+ } else {
+ extension
+ .as_ref()
+ .and_then(|extension| {
+ UTType::typeWithFilenameExtension(&NSString::from_str(extension))
+ })
+ .unwrap_or_else(|| UTTypeData.retain())
+ };
+ let icon = workspace.iconForContentType(&content_type);
component.setContents(Some(&icon));
// Component frames are relative to the item's dragging frame.
component.setFrame(NSRect::new(NSPoint::new(0., 0.), NSSize::new(32., 32.)));
diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml
index 01ffbe695b2..8c1922b1a5b 100644
--- a/crates/zed/Cargo.toml
+++ b/crates/zed/Cargo.toml
@@ -288,7 +288,7 @@ icon = ["resources/[email protected]", "resources/app-icon-dev.png"]
identifier = "dev.zed.Zed-Dev"
name = "Zed Dev"
category = "Developer Tool"
-osx_minimum_system_version = "10.15.7"
+osx_minimum_system_version = "12.0"
osx_info_plist_exts = ["resources/info/*"]
osx_url_schemes = ["zed"]
@@ -297,7 +297,7 @@ icon = ["resources/[email protected]", "resources/app-icon-nightly.png"]
identifier = "dev.zed.Zed-Nightly"
name = "Zed Nightly"
category = "Developer Tool"
-osx_minimum_system_version = "10.15.7"
+osx_minimum_system_version = "12.0"
osx_info_plist_exts = ["resources/info/*"]
osx_url_schemes = ["zed"]
@@ -306,7 +306,7 @@ icon = ["resources/[email protected]", "resources/app-icon-preview.png"]
identifier = "dev.zed.Zed-Preview"
name = "Zed Preview"
category = "Developer Tool"
-osx_minimum_system_version = "10.15.7"
+osx_minimum_system_version = "12.0"
osx_info_plist_exts = ["resources/info/*"]
osx_url_schemes = ["zed"]
@@ -315,7 +315,7 @@ icon = ["resources/[email protected]", "resources/app-icon.png"]
identifier = "dev.zed.Zed"
name = "Zed"
category = "Developer Tool"
-osx_minimum_system_version = "10.15.7"
+osx_minimum_system_version = "12.0"
osx_info_plist_exts = ["resources/info/*"]
osx_url_schemes = ["zed"]
diff --git a/crates/zed/build.rs b/crates/zed/build.rs
index 92407a37911..379ab9c2143 100644
--- a/crates/zed/build.rs
+++ b/crates/zed/build.rs
@@ -24,9 +24,8 @@ fn main() {
}
if cfg!(target_os = "macos") {
- println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15.7");
+ println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=12.0");
- // Weakly link ReplayKit to ensure Zed can be used on macOS 10.15+.
println!("cargo:rustc-link-arg=-Wl,-weak_framework,ReplayKit");
// Seems to be required to enable Swift concurrency
@@ -35,7 +34,6 @@ fn main() {
// Register exported Objective-C selectors, protocols, etc
println!("cargo:rustc-link-arg=-Wl,-ObjC");
- // weak link to support Catalina
println!("cargo:rustc-link-arg=-Wl,-weak_framework,ScreenCaptureKit");
}
diff --git a/docs/src/development/macos.md b/docs/src/development/macos.md
index 42f07aa4f2c..e3807ec89f6 100644
--- a/docs/src/development/macos.md
+++ b/docs/src/development/macos.md
@@ -36,6 +36,9 @@ Clone the [Zed repository](https://github.com/zed-industries/zed).
brew install cmake
```
+Release bundling with `script/bundle-mac` requires the macOS 26 SDK or newer, provided by Xcode 26 or newer.
+The bundled app requires macOS 12.0 (Monterey) or later.
+
## Building Zed from Source
Once you have the dependencies installed, you can build Zed using [Cargo](https://doc.rust-lang.org/cargo/).
diff --git a/docs/src/installation.md b/docs/src/installation.md
index 152ba85102b..ccd7f68d59b 100644
--- a/docs/src/installation.md
+++ b/docs/src/installation.md
@@ -67,19 +67,22 @@ If this script is insufficient for your use case, you run into problems running
### macOS
-Zed supports the following macOS releases:
-
-| Version | Codename | Apple Status | Zed Status |
-| ------------- | -------- | -------------- | ------------------- |
-| macOS 26.x | Tahoe | Supported | Supported |
-| macOS 15.x | Sequoia | Supported | Supported |
-| macOS 14.x | Sonoma | Supported | Supported |
-| macOS 13.x | Ventura | Supported | Supported |
-| macOS 12.x | Monterey | EOL 2024-09-16 | Supported |
-| macOS 11.x | Big Sur | EOL 2023-09-26 | Partially Supported |
-| macOS 10.15.x | Catalina | EOL 2022-09-12 | Partially Supported |
-
-The macOS releases labelled "Partially Supported" (Big Sur and Catalina) do not support screen sharing via Zed Collaboration. These features use the [LiveKit SDK](https://livekit.io) which relies upon [ScreenCaptureKit.framework](https://developer.apple.com/documentation/screencapturekit/) only available on macOS 12 (Monterey) and newer.
+Zed requires macOS 12.0 (Monterey) or later.
+
+| Version | Codename | Apple Status | Zed Status |
+| ------------------ | ----------- | -------------- | ------------------- |
+| macOS 27.x | Golden Gate | Supported | Supported |
+| macOS 26.x | Tahoe | Supported | Supported |
+| macOS 15.x | Sequoia | Supported | Supported |
+| macOS 14.x | Sonoma | EOL 2026-09-14 | Supported |
+| macOS 13.x | Ventura | EOL 2025-09-15 | Supported |
+| macOS 12.x (12.3+) | Monterey | EOL 2024-09-16 | Supported |
+| macOS 12.0–12.2 | Monterey | EOL 2024-09-16 | Partially Supported |
+
+The macOS releases labelled "Partially Supported" (Monterey 12.0–12.2) do not support screen sharing via Zed Collaboration.
+Screen sharing uses [ScreenCaptureKit.framework](https://developer.apple.com/documentation/screencapturekit/), which is available on macOS 12.3 and newer.
+
+Apple support status and EOL dates are from [endoflife.date](https://endoflife.date/macos).
#### Mac Hardware
diff --git a/docs/src/macos.md b/docs/src/macos.md
index 63cff6e9b3d..8cb60c22dee 100644
--- a/docs/src/macos.md
+++ b/docs/src/macos.md
@@ -35,7 +35,7 @@ To build Zed from source, see the [macOS development documentation](./developmen
## System Requirements
-- macOS 10.15.7 (Catalina) or later
+- macOS 12.0 (Monterey) or later
- Apple Silicon (M1/M2/M3/M4) or Intel processor
Zed uses Metal for GPU-accelerated rendering, which is available on all supported macOS versions.
diff --git a/docs/src/remote-development.md b/docs/src/remote-development.md
index a3e9420724c..1d6657e531e 100644
--- a/docs/src/remote-development.md
+++ b/docs/src/remote-development.md
@@ -35,7 +35,7 @@ For simple cases where you don't need any SSH arguments, you can run `zed ssh://
The remote machine must be able to run Zed's server. The following platforms should work, though note that we have not exhaustively tested every Linux distribution:
-- macOS Catalina or later (Intel or Apple Silicon)
+- macOS 12.0 (Monterey) or later (Intel or Apple Silicon)
- Linux (x86_64 or arm64, we do not yet support 32-bit platforms)
- Windows (x86_64 or arm64)
diff --git a/nix/build.nix b/nix/build.nix
index 02687cdd7b7..675fbda9a53 100644
--- a/nix/build.nix
+++ b/nix/build.nix
@@ -4,7 +4,7 @@
lib,
stdenv,
- apple-sdk_15,
+ apple-sdk_26,
darwin,
darwinMinVersionHook,
@@ -206,8 +206,8 @@ let
libxrandr
]
++ lib.optionals stdenv'.hostPlatform.isDarwin [
- apple-sdk_15
- (darwinMinVersionHook "10.15")
+ apple-sdk_26
+ (darwinMinVersionHook "12.0")
];
cargoExtraArgs = "-p zed -p cli --locked --features=gpui_platform/runtime_shaders";
diff --git a/script/bundle-mac b/script/bundle-mac
index e00632cc50f..6e1489f31a1 100755
--- a/script/bundle-mac
+++ b/script/bundle-mac
@@ -50,6 +50,21 @@ done
shift $((OPTIND-1))
+if [[ -z "${SDKROOT+x}" ]]; then
+ SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
+fi
+if [[ "$SDKROOT" != /* || ! -f "$SDKROOT/SDKSettings.plist" ]] ||
+ ! sdk_name=$(/usr/libexec/PlistBuddy -c 'Print :CanonicalName' "$SDKROOT/SDKSettings.plist" 2>/dev/null) ||
+ ! sdk_version=$(/usr/libexec/PlistBuddy -c 'Print :Version' "$SDKROOT/SDKSettings.plist" 2>/dev/null) ||
+ [[ ! "$sdk_name" =~ ^macosx[0-9]+(\.[0-9]+){0,2}$ ||
+ ! "$sdk_version" =~ ^[0-9]+(\.[0-9]+){0,2}$ ]] ||
+ (( 10#${sdk_version%%.*} < 26 )); then
+ echo "macOS SDK 26 or newer is required; set SDKROOT to a valid macOS SDK directory (selected: $SDKROOT)." >&2
+ exit 1
+fi
+export SDKROOT
+export MACOSX_DEPLOYMENT_TARGET=12.0
+echo "Using macOS SDK $sdk_version at $SDKROOT (deployment target 12.0)"
# Get release channel
pushd crates/zed
diff --git a/tooling/xtask/src/tasks/workflows/run_bundling.rs b/tooling/xtask/src/tasks/workflows/run_bundling.rs
index 3268bce6bdc..8e44eeb3622 100644
--- a/tooling/xtask/src/tasks/workflows/run_bundling.rs
+++ b/tooling/xtask/src/tasks/workflows/run_bundling.rs
@@ -93,7 +93,7 @@ pub(crate) fn bundle_mac(
NamedJob {
name: format!("bundle_mac_{arch}"),
job: bundle_job(deps)
- .runs_on(runners::MAC_DEFAULT)
+ .runs_on(runners::MAC_BUNDLER)
.envs(bundle_envs(platform))
.add_step(steps::checkout_repo())
.add_step(steps::cache_rust_dependencies_namespace())
diff --git a/tooling/xtask/src/tasks/workflows/runners.rs b/tooling/xtask/src/tasks/workflows/runners.rs
index 5785980572d..b565ea25263 100644
--- a/tooling/xtask/src/tasks/workflows/runners.rs
+++ b/tooling/xtask/src/tasks/workflows/runners.rs
@@ -14,6 +14,7 @@ pub const LINUX_ARM_BUNDLER: Runner = Runner("namespace-profile-8x32-ubuntu-2004
pub const LINUX_LARGE_RAM: Runner = Runner("namespace-profile-8x32-ubuntu-2404");
pub const MAC_DEFAULT: Runner = Runner("namespace-profile-mac-large");
+pub const MAC_BUNDLER: Runner = Runner("namespace-profile-mac-large-xcode26");
pub const MAC_SMALL: Runner = Runner("namespace-profile-mac-small");
pub const WINDOWS_DEFAULT: Runner = Runner("self-32vcpu-windows-2022");