Warp to Galaxy internal rebrand

This commit is contained in:
2026-08-27 00:29:21 -05:00
parent d72874534d
commit a69b927cc3
108 changed files with 395 additions and 2098 deletions
+1 -25
View File
@@ -8,30 +8,11 @@ license.workspace = true
autobins = false
default-run = "warp-tui-oss"
# One binary per channel, mirroring the GUI app's `app/src/bin/*` layout. The
# OSS bin is the `default-run` so bare `cargo run -p warp_tui` builds without
# the internal `warp-channel-config` generator; `./script/run-tui` selects the
# local bin when the generator is available.
# The OSS binary is the only shipped TUI target.
[[bin]]
name = "warp-tui-oss"
path = "src/bin/oss.rs"
[[bin]]
name = "warp-tui"
path = "src/bin/local.rs"
[[bin]]
name = "warp-tui-dev"
path = "src/bin/dev.rs"
[[bin]]
name = "warp-tui-preview"
path = "src/bin/preview.rs"
[[bin]]
name = "warp-tui-stable"
path = "src/bin/stable.rs"
[dependencies]
anyhow.workspace = true
log.workspace = true
@@ -43,7 +24,6 @@ string-offset.workspace = true
sum_tree.workspace = true
vec1.workspace = true
warp = { workspace = true, features = ["tui"] }
warp_channel_config.workspace = true
warp_core.workspace = true
warp_editor.workspace = true
warp_terminal.workspace = true
@@ -64,8 +44,4 @@ name = "tui_input_demo"
required-features = []
[features]
# Declared so the `warp_channel_config::load_config!` macro's
# `cfg(feature = "release_bundle")` branch is a known cfg in this crate. Today it
# stays off and the local bin uses the runtime generator; wiring the embedded
# config path (a `build.rs`) is phase 2 of the channel setup.
release_bundle = ["warp/release_bundle"]
-85
View File
@@ -1,85 +0,0 @@
//! Build script for the `warp_tui` channel binaries.
//!
//! When the `release_bundle` feature is enabled and the internal
//! `warp-channel-config` generator is on PATH, this embeds each channel's config
//! JSON into `OUT_DIR` so the per-channel bins can `include_str!` it via
//! `warp_channel_config::load_config!`. Mirrors the equivalent logic in
//! `app/build.rs`. For non-bundled builds the config is loaded at runtime, so
//! there is nothing to embed.
//!
//! `std::process::Command` is fine in a build script (unlike the shipped binary,
//! where it could flash a console on Windows).
#![allow(clippy::disallowed_types)]
use std::path::Path;
use std::process::Command;
use std::{env, fs};
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS");
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS must be set");
generate_channel_config_if_needed(&target_os);
}
/// If the `release_bundle` feature is enabled and `warp-channel-config` is
/// available on PATH, invoke the config generator and write each channel's JSON
/// to `OUT_DIR` so it can be embedded via `include_str!` in the binary entry
/// points.
fn generate_channel_config_if_needed(target_os: &str) {
if env::var("CARGO_FEATURE_RELEASE_BUNDLE").is_err() {
// For non-bundled builds, config is loaded at runtime — nothing to embed.
return;
}
let config_bin = "warp-channel-config";
// If the generator is not on PATH we can't embed configs. This is expected
// for external contributors building Warp OSS.
if Command::new(config_bin)
.arg("--help")
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.status()
.is_err()
{
return;
}
// Only tracked for bundled builds, where they affect the embedded config.
println!("cargo:rerun-if-env-changed=WITH_LOCAL_SERVER");
println!("cargo:rerun-if-env-changed=WITH_LOCAL_SESSION_SHARING_SERVER");
println!("cargo:rerun-if-env-changed=WITH_SANDBOX_TELEMETRY");
println!("cargo:rerun-if-env-changed=SERVER_ROOT_URL");
println!("cargo:rerun-if-env-changed=WS_SERVER_URL");
let out_dir = env::var("OUT_DIR").expect("OUT_DIR must be set");
// Generate config for every internal channel the TUI ships; each binary's
// `include_str!` picks up its own file.
for channel in ["local", "dev", "stable", "preview"] {
let output = Command::new(config_bin)
.arg("--channel")
.arg(channel)
.arg("--target-family")
.arg("native")
.arg("--target-os")
.arg(target_os)
.output()
.unwrap_or_else(|err| {
panic!("Failed to execute config generator at '{config_bin}': {err}")
});
if !output.status.success() {
let stderr = String::from_utf8_lossy(&output.stderr);
panic!("Config generator failed for channel '{channel}':\n{stderr}");
}
let config_path = Path::new(&out_dir).join(format!("{channel}_config.json"));
fs::write(&config_path, &output.stdout).unwrap_or_else(|err| {
panic!("Failed to write config to {}: {err}", config_path.display())
});
}
}
-19
View File
@@ -1,19 +0,0 @@
//! Dev-channel `warp-tui` binary (internal nightly builds).
//!
//! Mirrors `app/src/bin/dev.rs`: loads the internal `dev` channel config and
//! layers the dev feature flags, then hands off to the shared TUI entry point.
use anyhow::Result;
use warp_core::channel::{Channel, ChannelState};
use warp_core::features;
fn main() -> Result<()> {
ChannelState::set(
ChannelState::new(Channel::Dev, warp_channel_config::load_config!("dev"))
.with_additional_features(features::DEBUG_FLAGS)
.with_additional_features(features::DOGFOOD_FLAGS)
.with_additional_features(features::PREVIEW_FLAGS),
);
warp_tui::run()
}
-23
View File
@@ -1,23 +0,0 @@
//! Local-channel `warp-tui` binary (internal dev builds).
//!
//! Mirrors `app/src/bin/local.rs`: loads the internal `local` channel config
//! (via the `warp-channel-config` generator) and layers the dev feature flags,
//! then hands off to the shared TUI entry point. Run it through
//! `./script/run-tui`, which installs the generator first; running it directly
//! without `warp-channel-config` on PATH will panic with install instructions.
use anyhow::Result;
use warp_core::channel::{Channel, ChannelState};
use warp_core::features;
fn main() -> Result<()> {
ChannelState::set(
ChannelState::new(Channel::Local, warp_channel_config::load_config!("local"))
.with_additional_features(features::DEBUG_FLAGS)
.with_additional_features(features::DOGFOOD_FLAGS)
.with_additional_features(features::PREVIEW_FLAGS)
.with_additional_features(features::LOCAL_FLAGS),
);
warp_tui::run()
}
+5 -6
View File
@@ -1,10 +1,9 @@
//! OSS-channel `warp-tui` binary and `default-run` target.
//!
//! This is what bare `cargo run -p warp_tui` builds, so it hand-builds a
//! production config and needs no internal `warp-channel-config` generator
//! (mirrors `app/src/bin/oss.rs`). It is a console application (no GUI window,
//! no app bundle), so unlike the GUI binaries it sets no `windows_subsystem`
//! attribute and embeds no `Info.plist`.
//! This is what bare `cargo run -p warp_tui` builds, so it hand-builds an
//! OSS production config (mirroring `app/src/bin/oss.rs`). It is a console
//! application (no GUI window, no app bundle), so unlike the GUI binaries it
//! sets no `windows_subsystem` attribute and embeds no `Info.plist`.
use anyhow::Result;
use warp_core::channel::{Channel, ChannelConfig, ChannelState, OzConfig, WarpServerConfig};
@@ -14,7 +13,7 @@ fn main() -> Result<()> {
let mut state = ChannelState::new(
Channel::Oss,
ChannelConfig {
app_id: AppId::new("dev", "warp", "WarpTui"),
app_id: AppId::new("com", "galaxy", "GalaxyOss"),
logfile_name: "warp-tui.log".into(),
server_config: WarpServerConfig::disabled(),
oz_config: OzConfig::production(),
-22
View File
@@ -1,22 +0,0 @@
//! Preview-channel `warp-tui` binary.
//!
//! Mirrors `app/src/bin/preview.rs`: loads the `preview` channel config and
//! enables the preview feature flags (plus forced login), then hands off to the
//! shared TUI entry point.
use anyhow::Result;
use warp_core::channel::{Channel, ChannelState};
use warp_core::features;
fn main() -> Result<()> {
ChannelState::set(
ChannelState::new(
Channel::Preview,
warp_channel_config::load_config!("preview"),
)
.with_additional_features(features::PREVIEW_FLAGS)
.with_additional_features(&[features::FeatureFlag::ForceLogin]),
);
warp_tui::run()
}
-16
View File
@@ -1,16 +0,0 @@
//! Stable-channel `warp-tui` binary.
//!
//! Mirrors `app/src/bin/stable.rs`: loads the `stable` channel config with no
//! additional feature flags, then hands off to the shared TUI entry point.
use anyhow::Result;
use warp_core::channel::{Channel, ChannelState};
fn main() -> Result<()> {
ChannelState::set(ChannelState::new(
Channel::Stable,
warp_channel_config::load_config!("stable"),
));
warp_tui::run()
}