fix(install): default project dir to CWD and ensure Erlang runtime so the README quick start works#34
Open
shaun0927 wants to merge 1 commit into
Conversation
The release path documented in the README ("curl ... install.sh | bash"
then "ourocode") failed on any machine other than the maintainer's:
1. StartupArgs hardcoded the default project directory to a build-time
developer path (/Users/jaegyu.lee/Project/ourocode). Running `ourocode`
without --project-dir on any other machine errored with
"project directory does not exist". Default to the current working
directory instead, with an OUROCODE_PROJECT_DIR override.
2. The bundled `ourocode` is an Erlang escript and needs the Erlang/OTP
runtime (escript/erl) on PATH, but install.sh never checked for or
installed it. On a fresh machine the installer "succeeded" yet every
invocation died with "env: escript: No such file or directory".
Add a best-effort runtime ensure step (brew on macOS, apt/dnf on
Linux) that fails fast with manual instructions when it cannot help,
with an OUROCODE_SKIP_ERLANG=1 escape hatch.
Also document the Erlang/OTP requirement and the CWD default in the README.
Verified with `mix test test/ourocode/cli_test.exs` (46 tests, 0 failures)
and `bash -n install.sh`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Following the README quick start on a clean machine —
curl -fsSL https://raw.githubusercontent.com/Q00/ourocode/release/bootstrap/install.sh | bash ourocode— does not work today. Two release-path bugs break it. This PR fixes both so the documented flow works on any machine.
Bug 1 — hardcoded developer project directory
lib/ourocode/cli/startup_args.exdefaulted the project directory to a build-time absolute path:On any other machine, running
ourocode(orourocode --smoke-test) without--project-dirfails inresolve_project_dir/1:Fix: default to the current working directory (
File.cwd!()), with anOUROCODE_PROJECT_DIRenvironment override. This matches the README's "Then run:ourocode" contract.Bug 2 — Erlang/OTP runtime not ensured by the installer
The bundled
ourocodeis an Erlang escript (#! /usr/bin/env escript) and needsescript/erlonPATH. The release tarball does not bundle the runtime, andinstall.shonly checks formix/cargoon the build-from-source path — never on the bundled-release path. So on a fresh machine the installer prints==> ready, yet every invocation dies with:Fix: add a best-effort
ensure_erlang_runtimestep (consistent with the existing best-effort Ouroboros step) that installs Erlang via Homebrew (macOS) orapt/dnf(Linux), and otherwise fails fast with actionable manual instructions.OUROCODE_SKIP_ERLANG=1bypasses it.Docs
README.md: document the Erlang/OTP runtime requirement, the installer's handling of it, and the new CWD default /OUROCODE_PROJECT_DIRoverride.Changes
lib/ourocode/cli/startup_args.exdefault_project_dir/0→ CWD +OUROCODE_PROJECT_DIRoverridetest/ourocode/cli_test.exsinstall.shensure_erlang_runtime(best-effort install + fail-fast guidance)README.mdVerification
mix test test/ourocode/cli_test.exs→ 46 tests, 0 failuresbash -n install.sh→ syntax OKmix format --check-formattedon the edited Elixir files → cleanOut of scope
Single self-contained binary (already tracked in the README Status section), Homebrew tap, the separate
ouroborosPython installer warnings, and Windows support.🤖 Generated with Claude Code