app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit 8cf6b880735cb9ba24abac3a9b088fed018957ae
parent 40b000a216deda93ab5f02a8ce822d063446176f
Author: triesap <tyson@radroots.org>
Date:   Sun, 19 Apr 2026 20:58:22 +0000

build: remove runtime env shell helpers

Diffstat:
Mplatforms/macos/Scripts/test_host.sh | 6------
Dscripts/runtime_env.sh | 130-------------------------------------------------------------------------------
2 files changed, 0 insertions(+), 136 deletions(-)

diff --git a/platforms/macos/Scripts/test_host.sh b/platforms/macos/Scripts/test_host.sh @@ -6,8 +6,6 @@ platform_root="$(cd "${script_dir}/.." && pwd -P)" repo_root="$(git -C "${script_dir}" rev-parse --show-toplevel)" date_utc="$(date -u +%F)" -source "${repo_root}/scripts/runtime_env.sh" - require_command() { if command -v "$1" >/dev/null 2>&1; then return @@ -157,7 +155,6 @@ cleanup() { trap cleanup EXIT runtime_mode="localhost-dev" -run_id="$(radroots_app_run_id "${runtime_mode}")" default_nostr_relay_url="${RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL:-ws://127.0.0.1:8080}" local_log_root="${tmp_root}/logs" structured_log_file="${local_log_root}/apps/local/app/app-macos-native/${date_utc}.jsonl" @@ -166,7 +163,6 @@ stdout_file="${local_log_root}/apps/local/app/app-macos-native/raw/stdout.${date stderr_file="${local_log_root}/apps/local/app/app-macos-native/raw/stderr.${date_utc}.log" RADROOTS_APP_RUNTIME_MODE="${runtime_mode}" \ -RADROOTS_APP_RUN_ID="${run_id}" \ RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL="${default_nostr_relay_url}" \ RADROOTS_APP_LOCAL_LOG_ROOT="${local_log_root}" \ "${script_dir}/run_host.sh" & @@ -178,7 +174,6 @@ assert_raw_logs_exist "${stdout_file}" "${stderr_file}" terminate_runner "${runner_pid}" runner_pid="" -degraded_run_id="$(radroots_app_run_id "${runtime_mode}")" degraded_log_root="${tmp_root}/degraded-logs" degraded_structured_log_file="${degraded_log_root}/apps/local/app/app-macos-native/${date_utc}.jsonl" degraded_latest_log_path="${degraded_log_root}/apps/local/app/app-macos-native/latest.jsonl" @@ -187,7 +182,6 @@ degraded_stderr_file="${degraded_log_root}/apps/local/app/app-macos-native/raw/s env -u HOME \ RADROOTS_APP_RUNTIME_MODE="${runtime_mode}" \ - RADROOTS_APP_RUN_ID="${degraded_run_id}" \ RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL="${default_nostr_relay_url}" \ RADROOTS_APP_LOCAL_LOG_ROOT="${degraded_log_root}" \ "${script_dir}/run_host.sh" & diff --git a/scripts/runtime_env.sh b/scripts/runtime_env.sh @@ -1,130 +0,0 @@ -#!/usr/bin/env bash - -radroots_app_workspace_version() { - local repo_root="$1" - - python3 - <<'PY' "${repo_root}/Cargo.toml" -import re -import sys - -path = sys.argv[1] -with open(path, "r", encoding="utf-8") as handle: - cargo_toml = handle.read() - -match = re.search(r'^\[workspace\.package\][\s\S]*?^version\s*=\s*"([^"]+)"', cargo_toml, re.MULTILINE) -if not match: - raise SystemExit("missing workspace.package.version") - -print(match.group(1), end="") -PY -} - -radroots_app_runtime_mode() { - printf '%s' "${RADROOTS_APP_RUNTIME_MODE:-localhost-dev}" -} - -radroots_app_run_id() { - local runtime_mode="$1" - - if [[ -n "${RADROOTS_APP_RUN_ID:-}" ]]; then - printf '%s' "${RADROOTS_APP_RUN_ID}" - return - fi - - RADROOTS_APP_RUNTIME_MODE_FOR_RUN_ID="${runtime_mode}" python3 - <<'PY' -import os -import secrets -import time - -runtime_mode = os.environ["RADROOTS_APP_RUNTIME_MODE_FOR_RUN_ID"].strip().lower() or "unknown" -timestamp = time.strftime("%Y%m%dT%H%M%SZ", time.gmtime()) -suffix = secrets.token_hex(8) -print(f"app-{runtime_mode}-{timestamp}-{suffix}", end="") -PY -} - -radroots_app_platform_name() { - case "$(uname -s)" in - Darwin) printf 'macos' ;; - Linux) printf 'linux' ;; - *) uname -s | tr '[:upper:]' '[:lower:]' ;; - esac -} - -radroots_app_bundle_identifier() { - if [[ "$(uname -s)" == "Darwin" ]]; then - printf 'org.radroots.app.macos' - return - fi - - printf 'org.radroots.app.desktop' -} - -radroots_app_os_version() { - printf '%s-%s' "$(radroots_app_platform_name)" "$(uname -r)" -} - -radroots_app_local_log_root() { - local repo_root="$1" - - if [[ -n "${RADROOTS_APP_LOCAL_LOG_ROOT:-}" ]]; then - printf '%s' "${RADROOTS_APP_LOCAL_LOG_ROOT}" - return - fi - - printf '%s' "${repo_root}/logs" -} - -radroots_app_default_nostr_relay_url() { - if [[ -n "${RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL:-}" ]]; then - printf '%s' "${RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL}" - return - fi - - printf 'missing required env: RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL\n' >&2 - exit 1 -} - -radroots_app_build_runtime_config_json() { - local repo_root="$1" - local runtime_mode="$2" - local run_id="$3" - local default_nostr_relay_url="$4" - local bundle_identifier="$5" - local platform_name="$6" - local local_log_root="$7" - - RADROOTS_APP_RUNTIME_CONFIG_SCHEMA="radroots.app.runtime-config.v1" \ - RADROOTS_APP_RUNTIME_MODE="${runtime_mode}" \ - RADROOTS_APP_RUN_ID="${run_id}" \ - RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL="${default_nostr_relay_url}" \ - RADROOTS_APP_BUNDLE_IDENTIFIER="${bundle_identifier}" \ - RADROOTS_APP_BUNDLE_NAME="Radroots" \ - RADROOTS_APP_MARKETING_VERSION="$(radroots_app_workspace_version "${repo_root}")" \ - RADROOTS_APP_BUILD_NUMBER="${RADROOTS_APP_BUILD:-dev}" \ - RADROOTS_APP_PLATFORM_NAME="${platform_name}" \ - RADROOTS_APP_OS_VERSION="$(radroots_app_os_version)" \ - RADROOTS_APP_HOST_LOCALE="${LANG:-system-default}" \ - RADROOTS_APP_RUNTIME_ORIGIN="gpui://localhost" \ - RADROOTS_APP_LOCAL_LOG_ROOT="${local_log_root}" \ - python3 - <<'PY' -import json -import os - -print(json.dumps({ - "schema_version": os.environ["RADROOTS_APP_RUNTIME_CONFIG_SCHEMA"], - "runtime_mode": os.environ["RADROOTS_APP_RUNTIME_MODE"], - "run_id": os.environ["RADROOTS_APP_RUN_ID"], - "default_nostr_relay_url": os.environ["RADROOTS_APP_DEFAULT_NOSTR_RELAY_URL"], - "bundle_identifier": os.environ["RADROOTS_APP_BUNDLE_IDENTIFIER"], - "bundle_name": os.environ["RADROOTS_APP_BUNDLE_NAME"], - "marketing_version": os.environ["RADROOTS_APP_MARKETING_VERSION"], - "build_number": os.environ["RADROOTS_APP_BUILD_NUMBER"], - "platform_name": os.environ["RADROOTS_APP_PLATFORM_NAME"], - "operating_system_version": os.environ["RADROOTS_APP_OS_VERSION"], - "host_locale": os.environ["RADROOTS_APP_HOST_LOCALE"], - "runtime_origin": os.environ["RADROOTS_APP_RUNTIME_ORIGIN"], - "local_log_root": os.environ["RADROOTS_APP_LOCAL_LOG_ROOT"], -}, sort_keys=True, separators=(",", ":")), end="") -PY -}