fix: use canonical ~/hero/var/hero_compute.env path (#70) #72

Merged
mahmoud merged 1 commit from development_env_path into development 2026-04-07 08:45:37 +00:00
Owner

Replace fragile .env loading (CWD guessing, binary parent scanning,
$HOME/.env symlink) with a single canonical path:

~/hero/var/hero_compute.env

Changes:

  • Add env_file_path() and load_env() to hero_compute_sdk
  • All four binaries (CLI, server, UI, explorer) now call
    hero_compute_sdk::load_env() instead of dotenvy::dotenv()
  • write_env() writes directly to the canonical path, no symlink
  • Remove find_env_path() and all CWD/binary-parent heuristics
  • Remove dotenvy dependency from server, UI, explorer, CLI crates
    (only SDK needs it now)

This fixes the "Symbolic link loop (os error 40)" crash that occurred
when hero_compute created a self-referential symlink $HOME/.env ->
$HOME/.env after running from $HOME with no Cargo.toml in CWD.

#70

Replace fragile .env loading (CWD guessing, binary parent scanning, $HOME/.env symlink) with a single canonical path: ~/hero/var/hero_compute.env Changes: - Add env_file_path() and load_env() to hero_compute_sdk - All four binaries (CLI, server, UI, explorer) now call hero_compute_sdk::load_env() instead of dotenvy::dotenv() - write_env() writes directly to the canonical path, no symlink - Remove find_env_path() and all CWD/binary-parent heuristics - Remove dotenvy dependency from server, UI, explorer, CLI crates (only SDK needs it now) This fixes the "Symbolic link loop (os error 40)" crash that occurred when hero_compute created a self-referential symlink $HOME/.env -> $HOME/.env after running from $HOME with no Cargo.toml in CWD. https://forge.ourworld.tf/lhumina_code/hero_compute/issues/70
fix: use canonical ~/hero/var/hero_compute.env path (#70)
All checks were successful
Test / test (push) Successful in 1m52s
Test / test (pull_request) Successful in 1m56s
82d0812974
Replace fragile .env loading (CWD guessing, binary parent scanning,
$HOME/.env symlink) with a single canonical path:

  ~/hero/var/hero_compute.env

Changes:
- Add env_file_path() and load_env() to hero_compute_sdk
- All four binaries (CLI, server, UI, explorer) now call
  hero_compute_sdk::load_env() instead of dotenvy::dotenv()
- write_env() writes directly to the canonical path, no symlink
- Remove find_env_path() and all CWD/binary-parent heuristics
- Remove dotenvy dependency from server, UI, explorer, CLI crates
  (only SDK needs it now)

This fixes the "Symbolic link loop (os error 40)" crash that occurred
when hero_compute created a self-referential symlink $HOME/.env ->
$HOME/.env after running from $HOME with no Cargo.toml in CWD.

#70
mahmoud merged commit a939a2256e into development 2026-04-07 08:45:37 +00:00
mahmoud deleted branch development_env_path 2026-04-07 08:45:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_compute!72
No description provided.