mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
refactor(build): rename core binary to openhuman-core and update workflows
- Changed the default binary name from "openhuman" to "openhuman-core" in Cargo.toml and related scripts. - Updated build and test workflows to reference the new binary name, ensuring consistency across the project. - Adjusted paths and executable checks in the codebase to accommodate the renamed binary, improving clarity and maintainability.
This commit is contained in:
@@ -70,13 +70,13 @@ jobs:
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Build sidecar core binary
|
||||
run: cargo build --manifest-path Cargo.toml --release --target x86_64-unknown-linux-gnu --bin openhuman
|
||||
run: cargo build --manifest-path Cargo.toml --release --target x86_64-unknown-linux-gnu --bin openhuman-core
|
||||
|
||||
- name: Stage sidecar for Tauri bundler
|
||||
run: |
|
||||
mkdir -p app/src-tauri/binaries
|
||||
cp target/x86_64-unknown-linux-gnu/release/openhuman app/src-tauri/binaries/openhuman-x86_64-unknown-linux-gnu
|
||||
chmod +x app/src-tauri/binaries/openhuman-x86_64-unknown-linux-gnu
|
||||
cp target/x86_64-unknown-linux-gnu/release/openhuman-core app/src-tauri/binaries/openhuman-core-x86_64-unknown-linux-gnu
|
||||
chmod +x app/src-tauri/binaries/openhuman-core-x86_64-unknown-linux-gnu
|
||||
|
||||
- name: Build Tauri app
|
||||
working-directory: app
|
||||
|
||||
@@ -351,7 +351,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SIDE_CAR_BASE="$(node -e "const fs=require('fs');const c=JSON.parse(fs.readFileSync('app/src-tauri/tauri.conf.json','utf8'));const b=(c.bundle&&Array.isArray(c.bundle.externalBin)&&c.bundle.externalBin[0])||'binaries/openhuman';process.stdout.write(String(b).split('/').pop());")"
|
||||
SIDE_CAR_BASE="$(node -e "const fs=require('fs');const c=JSON.parse(fs.readFileSync('app/src-tauri/tauri.conf.json','utf8'));const b=(c.bundle&&Array.isArray(c.bundle.externalBin)&&c.bundle.externalBin[0])||'binaries/openhuman-core';process.stdout.write(String(b).split('/').pop());")"
|
||||
CORE_BIN_NAME="${SIDE_CAR_BASE}"
|
||||
|
||||
echo "core_dir=$CORE_DIR" >> "$GITHUB_OUTPUT"
|
||||
@@ -522,13 +522,22 @@ jobs:
|
||||
rm -f "$CERT_FILE"
|
||||
echo "Signing identity imported into $KEYCHAIN"
|
||||
|
||||
echo "=== Re-signing binaries inside the .app with hardened runtime ==="
|
||||
echo "=== Fixing executable name and signing ==="
|
||||
|
||||
# Tauri/Cargo may produce the binary as lowercase "openhuman" but
|
||||
# Info.plist sets CFBundleExecutable to "OpenHuman". codesign
|
||||
# verification fails when these don't match. Rename to match plist.
|
||||
EXPECTED_EXE="$(defaults read "$APP_PATH/Contents/Info.plist" CFBundleExecutable 2>/dev/null || echo "OpenHuman")"
|
||||
ACTUAL_EXE="$(ls "$APP_PATH/Contents/MacOS/" | head -1)"
|
||||
|
||||
# The .app contains only the main Tauri binary (openhuman) — no
|
||||
# separate sidecar. Just sign the whole bundle with hardened runtime.
|
||||
echo "Bundle contents:"
|
||||
ls -la "$APP_PATH/Contents/MacOS/"
|
||||
|
||||
if [ "$ACTUAL_EXE" != "$EXPECTED_EXE" ]; then
|
||||
echo "Fixing executable name: $ACTUAL_EXE -> $EXPECTED_EXE"
|
||||
mv "$APP_PATH/Contents/MacOS/$ACTUAL_EXE" "$APP_PATH/Contents/MacOS/$EXPECTED_EXE"
|
||||
fi
|
||||
|
||||
echo "Signing .app bundle with hardened runtime..."
|
||||
codesign --force --options runtime \
|
||||
--entitlements "$ENTITLEMENTS" \
|
||||
|
||||
@@ -102,13 +102,13 @@ jobs:
|
||||
run: cargo test -p openhuman
|
||||
|
||||
- name: Build sidecar core binary
|
||||
run: cargo build --manifest-path Cargo.toml --release --target x86_64-unknown-linux-gnu --bin openhuman
|
||||
run: cargo build --manifest-path Cargo.toml --release --target x86_64-unknown-linux-gnu --bin openhuman-core
|
||||
|
||||
- name: Stage sidecar for Tauri shell tests
|
||||
run: |
|
||||
mkdir -p app/src-tauri/binaries
|
||||
cp target/x86_64-unknown-linux-gnu/release/openhuman app/src-tauri/binaries/openhuman-x86_64-unknown-linux-gnu
|
||||
chmod +x app/src-tauri/binaries/openhuman-x86_64-unknown-linux-gnu
|
||||
cp target/x86_64-unknown-linux-gnu/release/openhuman-core app/src-tauri/binaries/openhuman-core-x86_64-unknown-linux-gnu
|
||||
chmod +x app/src-tauri/binaries/openhuman-core-x86_64-unknown-linux-gnu
|
||||
|
||||
- name: Test Tauri shell (OpenHuman)
|
||||
run: cargo test --manifest-path app/src-tauri/Cargo.toml
|
||||
|
||||
+5
-1
@@ -3,7 +3,11 @@ name = "openhuman"
|
||||
version = "0.49.17"
|
||||
edition = "2021"
|
||||
description = "OpenHuman core business logic and RPC server"
|
||||
autobins = true
|
||||
autobins = false
|
||||
|
||||
[[bin]]
|
||||
name = "openhuman-core"
|
||||
path = "src/main.rs"
|
||||
|
||||
[lib]
|
||||
name = "openhuman_core"
|
||||
|
||||
@@ -258,9 +258,9 @@ pub fn default_core_bin() -> Option<PathBuf> {
|
||||
continue;
|
||||
};
|
||||
#[cfg(windows)]
|
||||
let matches = file_name.starts_with("openhuman-") && file_name.ends_with(".exe");
|
||||
let matches = file_name.starts_with("openhuman-core-") && file_name.ends_with(".exe");
|
||||
#[cfg(not(windows))]
|
||||
let matches = file_name.starts_with("openhuman-");
|
||||
let matches = file_name.starts_with("openhuman-core-");
|
||||
if matches {
|
||||
return Some(path);
|
||||
}
|
||||
@@ -274,25 +274,25 @@ pub fn default_core_bin() -> Option<PathBuf> {
|
||||
let exe_dir = exe.parent()?;
|
||||
|
||||
#[cfg(windows)]
|
||||
let standalone = exe_dir.join("openhuman.exe");
|
||||
let standalone = exe_dir.join("openhuman-core.exe");
|
||||
#[cfg(not(windows))]
|
||||
let standalone = exe_dir.join("openhuman");
|
||||
let standalone = exe_dir.join("openhuman-core");
|
||||
|
||||
if standalone.exists() && !same_executable_path(&standalone, &exe) {
|
||||
return Some(standalone);
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
let legacy_standalone = exe_dir.join("openhuman.exe");
|
||||
let legacy_standalone = exe_dir.join("openhuman-core.exe");
|
||||
#[cfg(not(windows))]
|
||||
let legacy_standalone = exe_dir.join("openhuman");
|
||||
let legacy_standalone = exe_dir.join("openhuman-core");
|
||||
|
||||
if legacy_standalone.exists() && !same_executable_path(&legacy_standalone, &exe) {
|
||||
return Some(legacy_standalone);
|
||||
}
|
||||
|
||||
// Sidecar layout: bundle.externalBin("binaries/openhuman") is emitted as
|
||||
// openhuman-<target-triple>(.exe) under app resources.
|
||||
// Sidecar layout: bundle.externalBin("binaries/openhuman-core") is emitted as
|
||||
// openhuman-core-<target-triple>(.exe) under app resources.
|
||||
let search_dirs = {
|
||||
let mut dirs = vec![exe_dir.to_path_buf()];
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -318,11 +318,11 @@ pub fn default_core_bin() -> Option<PathBuf> {
|
||||
};
|
||||
|
||||
#[cfg(windows)]
|
||||
let matches = (file_name.starts_with("openhuman-") && file_name.ends_with(".exe"))
|
||||
|| (file_name.starts_with("openhuman-") && file_name.ends_with(".exe"));
|
||||
let matches = (file_name.starts_with("openhuman-core-") && file_name.ends_with(".exe"))
|
||||
|| (file_name.starts_with("openhuman-core-") && file_name.ends_with(".exe"));
|
||||
#[cfg(not(windows))]
|
||||
let matches =
|
||||
file_name.starts_with("openhuman-") || file_name.starts_with("openhuman-");
|
||||
file_name.starts_with("openhuman-core-") || file_name.starts_with("openhuman-core-");
|
||||
|
||||
if matches && !same_executable_path(&path, &exe) {
|
||||
return Some(path);
|
||||
|
||||
@@ -98,7 +98,7 @@ pub fn run() {
|
||||
|
||||
pub fn run_core_from_args(args: &[String]) -> Result<(), String> {
|
||||
let core_bin = crate::core_process::default_core_bin()
|
||||
.ok_or_else(|| "openhuman core binary not found".to_string())?;
|
||||
.ok_or_else(|| "openhuman-core binary not found".to_string())?;
|
||||
let status = std::process::Command::new(core_bin)
|
||||
.args(args)
|
||||
.status()
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"../../src/openhuman/agent/prompts"
|
||||
],
|
||||
"externalBin": [
|
||||
"binaries/openhuman"
|
||||
"binaries/openhuman-core"
|
||||
],
|
||||
"createUpdaterArtifacts": false,
|
||||
"macOS": {
|
||||
|
||||
@@ -155,16 +155,25 @@ fi
|
||||
echo
|
||||
echo "App bundle: $APP_PATH"
|
||||
|
||||
# ── Sign the .app bundle with hardened runtime ───────────────────────
|
||||
# The .app contains only the main Tauri binary (openhuman) — no separate
|
||||
# sidecar binary. We just need to sign the whole bundle with hardened
|
||||
# runtime + entitlements for notarization.
|
||||
# ── Fix CFBundleExecutable case mismatch ──────────────────────────────
|
||||
# Tauri/Cargo produces the binary as lowercase "openhuman" but Info.plist
|
||||
# sets CFBundleExecutable to "OpenHuman". codesign verification fails
|
||||
# when these don't match exactly. Rename to match the plist.
|
||||
ENTITLEMENTS="app/src-tauri/entitlements.sidecar.plist"
|
||||
EXPECTED_EXE="$(defaults read "$APP_PATH/Contents/Info.plist" CFBundleExecutable 2>/dev/null || echo "OpenHuman")"
|
||||
ACTUAL_EXE="$(ls "$APP_PATH/Contents/MacOS/" | head -1)"
|
||||
|
||||
echo
|
||||
echo "Bundle contents:"
|
||||
ls -la "$APP_PATH/Contents/MacOS/"
|
||||
|
||||
if [[ "$ACTUAL_EXE" != "$EXPECTED_EXE" ]]; then
|
||||
echo
|
||||
echo "Fixing executable name: $ACTUAL_EXE -> $EXPECTED_EXE"
|
||||
mv "$APP_PATH/Contents/MacOS/$ACTUAL_EXE" "$APP_PATH/Contents/MacOS/$EXPECTED_EXE"
|
||||
fi
|
||||
|
||||
# ── Sign the .app bundle with hardened runtime ───────────────────────
|
||||
echo
|
||||
echo "Signing .app bundle with hardened runtime..."
|
||||
codesign --force --options runtime \
|
||||
|
||||
@@ -34,12 +34,12 @@ function rustHostTriple() {
|
||||
|
||||
const triple = rustHostTriple();
|
||||
const isWindows = process.platform === "win32";
|
||||
const binName = isWindows ? "openhuman.exe" : "openhuman";
|
||||
const binName = isWindows ? "openhuman-core.exe" : "openhuman-core";
|
||||
|
||||
console.log(
|
||||
`[core:stage] Building openhuman standalone binary for ${triple}...`,
|
||||
`[core:stage] Building openhuman-core standalone binary for ${triple}...`,
|
||||
);
|
||||
run("cargo", ["build", "--manifest-path", "Cargo.toml", "--bin", "openhuman"]);
|
||||
run("cargo", ["build", "--manifest-path", "Cargo.toml", "--bin", "openhuman-core"]);
|
||||
|
||||
const targetDir = process.env.CARGO_TARGET_DIR
|
||||
? resolve(process.env.CARGO_TARGET_DIR)
|
||||
@@ -53,8 +53,8 @@ if (!existsSync(source)) {
|
||||
const outputDir = join(root, "app", "src-tauri", "binaries");
|
||||
mkdirSync(outputDir, { recursive: true });
|
||||
const sidecarName = isWindows
|
||||
? `openhuman-${triple}.exe`
|
||||
: `openhuman-${triple}`;
|
||||
? `openhuman-core-${triple}.exe`
|
||||
: `openhuman-core-${triple}`;
|
||||
const dest = join(outputDir, sidecarName);
|
||||
copyFileSync(source, dest);
|
||||
if (!isWindows) {
|
||||
|
||||
@@ -49,9 +49,9 @@ pub(crate) fn resolve_daemon_executable() -> Result<PathBuf> {
|
||||
|
||||
#[cfg(windows)]
|
||||
let matches =
|
||||
name.starts_with("openhuman-") || name.eq_ignore_ascii_case("openhuman.exe");
|
||||
name.starts_with("openhuman-core-") || name.eq_ignore_ascii_case("openhuman-core.exe");
|
||||
#[cfg(not(windows))]
|
||||
let matches = name.starts_with("openhuman-") || name == "openhuman";
|
||||
let matches = name.starts_with("openhuman-core-") || name == "openhuman-core";
|
||||
|
||||
if matches {
|
||||
return Ok(path);
|
||||
|
||||
Reference in New Issue
Block a user