Repository navigation
mux: platform module + Linux CI (phase 1 of Windows/Linux support) #7346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
04288ba
f387bde
77fc94e
733a95e
d70223c
71e1415
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,14 +22,25 @@ permissions: | |
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ${{ vars.MACOS_RUNNER_15 || 'blacksmith-6vcpu-macos-15' }} | ||
| name: test (${{ matrix.os }}) | ||
| runs-on: ${{ matrix.os == 'macos' && (vars.MACOS_RUNNER_15 || 'blacksmith-6vcpu-macos-15') || 'ubuntu-latest' }} | ||
| timeout-minutes: 40 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos, linux] | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Init ghostty submodule | ||
| run: git submodule update --init --depth 1 ghostty | ||
|
|
||
| - name: Install Linux build dependencies | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang libclang-dev pkg-config | ||
|
|
||
| - name: Install zig | ||
| run: ./scripts/install-zig-ci.sh | ||
|
|
||
|
|
@@ -62,3 +73,36 @@ jobs: | |
| - name: Detach/reattach smoke test | ||
| working-directory: mux | ||
| run: python3 scripts/smoke-attach.py | ||
|
|
||
| windows-experimental: | ||
| name: windows experimental (x86_64-gnu) | ||
| runs-on: windows-latest | ||
| timeout-minutes: 40 | ||
| continue-on-error: true | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Init ghostty submodule | ||
| run: git submodule update --init --depth 1 ghostty | ||
|
|
||
| - name: Install zig | ||
| uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5 | ||
| with: | ||
| version: 0.15.2 | ||
|
|
||
| - name: Install Rust GNU target | ||
| shell: bash | ||
| run: | | ||
| rustup target add x86_64-pc-windows-gnu | ||
| echo "C:\\msys64\\mingw64\\bin" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Build libghostty-vt for Windows GNU | ||
| shell: bash | ||
| working-directory: ghostty | ||
| run: | | ||
| zig build -Demit-lib-vt=true -Demit-xcframework=false -Doptimize=ReleaseFast -Dtarget=x86_64-windows-gnu --prefix "$RUNNER_TEMP/ghostty-vt-win-gnu" | ||
| zig ar t "$RUNNER_TEMP/ghostty-vt-win-gnu/lib/ghostty-vt-static.lib" | head | ||
|
|
||
| - name: cargo build mux-tui for Windows GNU | ||
| working-directory: mux | ||
| run: cargo build -p mux-tui --target x86_64-pc-windows-gnu --locked | ||
|
Comment on lines
+99
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win Manual zig build step for The "Build libghostty-vt for Windows GNU" step builds into 🤖 Prompt for AI Agents |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,24 +32,33 @@ fn main() { | |||||||||||||||||||||||||||||||||||||
| // is an order of magnitude slower. | ||||||||||||||||||||||||||||||||||||||
| let zig = env::var("ZIG").unwrap_or_else(|_| "zig".to_string()); | ||||||||||||||||||||||||||||||||||||||
| let prefix = out_dir.join("ghostty-vt"); | ||||||||||||||||||||||||||||||||||||||
| let status = Command::new(&zig) | ||||||||||||||||||||||||||||||||||||||
| let target = env::var("TARGET").unwrap(); | ||||||||||||||||||||||||||||||||||||||
| let host = env::var("HOST").unwrap(); | ||||||||||||||||||||||||||||||||||||||
| let mut command = Command::new(&zig); | ||||||||||||||||||||||||||||||||||||||
| command | ||||||||||||||||||||||||||||||||||||||
| .current_dir(&ghostty_dir) | ||||||||||||||||||||||||||||||||||||||
| .arg("build") | ||||||||||||||||||||||||||||||||||||||
| .arg("-Demit-lib-vt=true") | ||||||||||||||||||||||||||||||||||||||
| .arg("-Demit-xcframework=false") | ||||||||||||||||||||||||||||||||||||||
| .arg("-Doptimize=ReleaseFast") | ||||||||||||||||||||||||||||||||||||||
| .arg("--prefix") | ||||||||||||||||||||||||||||||||||||||
| .arg(&prefix) | ||||||||||||||||||||||||||||||||||||||
| .status() | ||||||||||||||||||||||||||||||||||||||
| .unwrap_or_else(|e| { | ||||||||||||||||||||||||||||||||||||||
| panic!("failed to run `{zig} build` in {}: {e}", ghostty_dir.display()) | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
| .arg("-Doptimize=ReleaseFast"); | ||||||||||||||||||||||||||||||||||||||
| if target != host { | ||||||||||||||||||||||||||||||||||||||
| if let Some(zig_target) = zig_target_for_rust_target(&target) { | ||||||||||||||||||||||||||||||||||||||
| command.arg(format!("-Dtarget={zig_target}")); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+44
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Silent no-op when cross-compiling to an unmapped target. When 🛠️ Proposed fix if target != host {
- if let Some(zig_target) = zig_target_for_rust_target(&target) {
- command.arg(format!("-Dtarget={zig_target}"));
- }
+ match zig_target_for_rust_target(&target) {
+ Some(zig_target) => {
+ command.arg(format!("-Dtarget={zig_target}"));
+ }
+ None => {
+ panic!(
+ "cross-compiling to unsupported target {target} from host {host}: \
+ add a mapping in zig_target_for_rust_target"
+ );
+ }
+ }
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| let status = command.arg("--prefix").arg(&prefix).status().unwrap_or_else(|e| { | ||||||||||||||||||||||||||||||||||||||
| panic!("failed to run `{zig} build` in {}: {e}", ghostty_dir.display()) | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
| if !status.success() { | ||||||||||||||||||||||||||||||||||||||
| panic!("zig build of libghostty-vt failed with {status}"); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| println!("cargo:rustc-link-search=native={}", prefix.join("lib").display()); | ||||||||||||||||||||||||||||||||||||||
| println!("cargo:rustc-link-lib=static=ghostty-vt"); | ||||||||||||||||||||||||||||||||||||||
| if target.contains("windows") { | ||||||||||||||||||||||||||||||||||||||
| println!("cargo:rustc-link-lib=static=ghostty-vt-static"); | ||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||
| println!("cargo:rustc-link-lib=static=ghostty-vt"); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // Generate bindings from the public C header. | ||||||||||||||||||||||||||||||||||||||
| let include_dir = ghostty_dir.join("include"); | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -66,3 +75,12 @@ fn main() { | |||||||||||||||||||||||||||||||||||||
| .expect("bindgen failed for ghostty/vt.h"); | ||||||||||||||||||||||||||||||||||||||
| bindings.write_to_file(out_dir.join("bindings.rs")).expect("failed to write bindings.rs"); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| fn zig_target_for_rust_target(target: &str) -> Option<&'static str> { | ||||||||||||||||||||||||||||||||||||||
| match target { | ||||||||||||||||||||||||||||||||||||||
| "x86_64-pc-windows-gnu" => Some("x86_64-windows-gnu"), | ||||||||||||||||||||||||||||||||||||||
| "x86_64-pc-windows-msvc" => Some("x86_64-windows-msvc"), | ||||||||||||||||||||||||||||||||||||||
| "aarch64-pc-windows-msvc" => Some("aarch64-windows-msvc"), | ||||||||||||||||||||||||||||||||||||||
| _ => None, | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win
Set
persist-credentials: falseon checkout steps.Static analysis flags both checkout steps for credential persistence (artipacked). The checked-out git credentials remain on disk for the rest of the job unless explicitly disabled, which is unnecessary here since no step needs to push/authenticate as the checkout token.
🔒 Proposed fix
Apply to both the
testjob (line 33) andwindows-experimentaljob (line 83).Also applies to: 83-83
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 33-33: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools