Skip to content

Commit 33e0d62

Browse files
committed
chore(ci): point project to oops-rs and add Swift sandbox flag
Switch repository/homepage references from the old owner to the oops-rs org across Cargo.toml files and the install script/README. Add Homebrew install instructions to README. Enhance grapha-swift build script: read CARGO_MANIFEST_DIR from env, expose GRAPHA_SWIFT_BUILD_DISABLE_SANDBOX to rerun builds and optionally pass --disable-sandbox to swift build, and add a helper to parse the env var. Update install.sh default release repo to oops-rs/grapha.
1 parent 882eea8 commit 33e0d62

7 files changed

Lines changed: 41 additions & 13 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ Benchmarked on a production iOS app (1,991 Swift files, ~300K lines):
4141

4242
## Install
4343

44+
```bash
45+
brew tap oops-rs/tap
46+
brew install grapha
47+
```
48+
4449
```bash
4550
cargo install grapha
4651
```

grapha-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.1.1"
44
edition = "2024"
55
description = "Shared graph types and extraction traits for Grapha"
66
license = "MIT"
7-
repository = "https://github.com/WendellXY/grapha"
8-
homepage = "https://github.com/WendellXY/grapha"
7+
repository = "https://github.com/oops-rs/grapha"
8+
homepage = "https://github.com/oops-rs/grapha"
99
readme = "../README.md"
1010
keywords = ["code-intelligence", "graph", "analysis", "swift", "rust"]
1111
categories = ["development-tools", "parser-implementations"]

grapha-rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ edition = "2024"
55
publish = false
66
description = "Rust extractor for Grapha based on tree-sitter"
77
license = "MIT"
8-
repository = "https://github.com/WendellXY/grapha"
9-
homepage = "https://github.com/WendellXY/grapha"
8+
repository = "https://github.com/oops-rs/grapha"
9+
homepage = "https://github.com/oops-rs/grapha"
1010
readme = "../README.md"
1111
keywords = ["code-intelligence", "graph", "analysis", "rust", "tree-sitter"]
1212
categories = ["development-tools", "parser-implementations"]

grapha-swift/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.1.1"
44
edition = "2024"
55
description = "Swift extraction waterfall for Grapha using index store, SwiftSyntax, and tree-sitter"
66
license = "MIT"
7-
repository = "https://github.com/WendellXY/grapha"
8-
homepage = "https://github.com/WendellXY/grapha"
7+
repository = "https://github.com/oops-rs/grapha"
8+
homepage = "https://github.com/oops-rs/grapha"
99
readme = "../README.md"
1010
keywords = ["code-intelligence", "graph", "analysis", "swift", "tree-sitter"]
1111
categories = ["development-tools", "parser-implementations"]

grapha-swift/build.rs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ use build_support::{
88
PreBuildDecision, parse_bridge_mode, post_build_decision, pre_build_decision,
99
};
1010

11+
const DISABLE_SWIFT_SANDBOX_ENV: &str = "GRAPHA_SWIFT_BUILD_DISABLE_SANDBOX";
12+
1113
fn main() {
1214
println!("cargo::rustc-check-cfg=cfg(no_swift_bridge)");
1315
println!("cargo:rerun-if-env-changed={BRIDGE_MODE_ENV}");
16+
println!("cargo:rerun-if-env-changed={DISABLE_SWIFT_SANDBOX_ENV}");
1417

1518
let mode = parse_bridge_mode(std::env::var(BRIDGE_MODE_ENV).ok().as_deref())
1619
.unwrap_or_else(|err| panic!("{err}"));
@@ -24,7 +27,9 @@ fn main() {
2427
return;
2528
}
2629

27-
let bridge_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("swift-bridge");
30+
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR")
31+
.expect("Cargo should always provide CARGO_MANIFEST_DIR to build scripts");
32+
let bridge_dir = Path::new(&manifest_dir).join("swift-bridge");
2833
let package_manifest = bridge_dir.join("Package.swift");
2934
match pre_build_decision(mode, package_manifest.exists()) {
3035
PreBuildDecision::Skip(message) => {
@@ -35,8 +40,15 @@ fn main() {
3540
PreBuildDecision::Panic(message) => panic!("{message}"),
3641
}
3742

38-
let status = Command::new("swift")
39-
.args(["build", "-c", "release"])
43+
let mut swift_build = Command::new("swift");
44+
swift_build.arg("build");
45+
46+
if disable_swift_sandbox() {
47+
swift_build.arg("--disable-sandbox");
48+
}
49+
50+
let status = swift_build
51+
.args(["-c", "release"])
4052
.current_dir(&bridge_dir)
4153
.status();
4254

@@ -68,3 +80,14 @@ fn disable_bridge(message: &str) {
6880
println!("cargo:warning=Swift bridge mode: {message}");
6981
println!("cargo:rustc-cfg=no_swift_bridge");
7082
}
83+
84+
fn disable_swift_sandbox() -> bool {
85+
matches!(
86+
std::env::var(DISABLE_SWIFT_SANDBOX_ENV)
87+
.ok()
88+
.as_deref()
89+
.map(str::to_ascii_lowercase)
90+
.as_deref(),
91+
Some("1" | "true" | "yes" | "on")
92+
)
93+
}

grapha/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.1.1"
44
edition = "2024"
55
description = "Blazingly fast code intelligence CLI and MCP server for Swift and Rust"
66
license = "MIT"
7-
repository = "https://github.com/WendellXY/grapha"
8-
homepage = "https://github.com/WendellXY/grapha"
7+
repository = "https://github.com/oops-rs/grapha"
8+
homepage = "https://github.com/oops-rs/grapha"
99
readme = "../README.md"
1010
keywords = ["code-intelligence", "mcp", "analysis", "swift", "rust"]
1111
categories = ["command-line-utilities", "development-tools"]

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Usage:
99
install.sh [--version <tag>] [--install-dir <dir>] [--repo <owner/name>]
1010
1111
Environment:
12-
GRAPHA_RELEASE_REPO GitHub repository to download from (default: wenext-limited/grapha)
12+
GRAPHA_RELEASE_REPO GitHub repository to download from (default: oops-rs/grapha)
1313
GRAPHA_INSTALL_DIR Install destination (default: $HOME/.local/bin)
1414
1515
Notes:
@@ -51,7 +51,7 @@ fetch_latest_tag() {
5151
| awk -F'"' '/"tag_name":/ { print $4; exit }'
5252
}
5353

54-
repo="${GRAPHA_RELEASE_REPO:-wenext-limited/grapha}"
54+
repo="${GRAPHA_RELEASE_REPO:-oops-rs/grapha}"
5555
install_dir="${GRAPHA_INSTALL_DIR:-$HOME/.local/bin}"
5656
version=""
5757

0 commit comments

Comments
 (0)