Skip to content
getelephcPublic

About

Version manager for the elephc compiler. Pins a version per project through a committed .elephc-version, installs published binaries or builds from source, and adds no shell hooks: PATH gets one entry, then a shim resolves the version and execs the real compiler.

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Latest commit

 

History

65 Commits

Folders and files

Repository files navigation

elvm logo

elvm

Pin a compiler. Ship the same one everywhere.

Stars Downloads License: MIT Follow @nahime0 on X

single binary · no shell hooks · per-project pinning · builds from source

Version manager for elephc, the PHP-to-native compiler. ~/.elvm/bin goes on your PATH once; from then on a committed .elephc-version decides which compiler runs, so every contributor and every CI job builds with the same one. No shell function to source and no cd hook — a shim resolves the version and execs the real binary, so exit codes, signals and TTY behaviour are indistinguishable from calling elephc directly.

Official Website


Install

curl -fsSL https://get.elephc.dev | sh
elvm install latest

The installer prompts to add ~/.elvm/bin to your PATH and installs elvm itself. It does not download a compiler — you choose the version. After installation, start a new shell for the PATH to update.

Use

elvm install 0.26.4        # install a specific version
elvm install nightly       # install the newest published nightly
elvm install main          # install the latest complete development build from CI
elvm use 0.26.4            # pin it for this project (.elephc-version)
elvm use 0.26.4 --global   # set the default
elvm ls                    # what is installed
elvm ls-remote             # what is published
elvm doctor                # diagnose PATH and installation problems

Commit .elephc-version and every contributor gets the same compiler:

elvm install              # reads .elephc-version

How version selection works

The first of these that applies wins:

  1. $ELEPHC_VERSION
  2. the nearest .elephc-version, searching upward from the current directory
  3. the global default set by elvm use --global

latest in a version file means the highest installed version; elvm install latest means the newest published one. Running elephc never downloads anything — if the selected version is missing, elvm tells you which command installs it.

Nightly builds

elephc publishes unattended builds of main as pre-releases. They are not supported: no compatibility, stability, or upgrade guarantees.

elvm install nightly       # the newest published nightly
elvm install nightly-20260901   # one specific build

nightly is a channel, not a version. Installing it again is an update, not an error, and it never takes part in version selection: latest and prefixes like 0.26 only ever match released versions, so a nightly on disk cannot change what an existing .elephc-version resolves to. elvm ls-remote lists the dated builds; elvm ls and elvm doctor show which one is installed, since every rolling install is called nightly no matter which build is in it.

nightly is not a pin. It names whichever build was newest when each person last installed it, so a committed .elephc-version saying nightly gives different compilers to different machines — the one thing a version file exists to prevent. A dated tag like nightly-20260901 is a pin, because upstream never republishes one.

Dated builds are kept upstream for 14 nightlies and then deleted, tag included. So a dated pin is reproducible for about two weeks and no longer: after that, only someone who already has it installed — or still has the tarball in ~/.elvm/cache/downloads — can reinstall it. Pin a release for anything that has to build a year from now.

Main builds

elvm install main installs the latest complete development build from the elephc GitHub Actions artifacts. Install GitHub CLI and sign in with gh auth login before downloading.

elvm install main
elvm exec main --version

Run elvm install main again to update. elvm ls shows the installed commit and build profile. Since main moves, pin a release for reproducible builds. The current CI builds use the debug profile, and their Linux binaries require glibc 2.39 or newer.

Platform support

Which platforms have a downloadable binary is a property of each elephc release, not a fixed list — check elvm ls-remote for the version and platform you need. As of elephc v0.25.2, releases publish macOS ARM64 (aarch64-apple-darwin), Linux x86_64 (x86_64-unknown-linux-gnu), and Linux ARM64 (aarch64-unknown-linux-gnu); older releases (through v0.24.x) are macOS ARM64 only. Wherever a binary isn't published, build from source:

elvm install --build v0.26.4    # requires Rust and git

Unreliable connections

Network requests retry temporary failures up to five times with increasing waits. Connection and stalled-transfer timeouts prevent downloads from hanging; slow downloads can continue while they are making progress. Permanent HTTP errors, such as a missing release, fail immediately.

Release and nightly installs and self-updates keep partial archives in ~/.elvm/cache/downloads, resuming them on the next attempt or invocation when the server supports it. Servers without resume support trigger a fresh download. Only archives with a matching SHA-256 checksum enter the completed cache. Run elvm cache clean to discard cached archives and partial downloads. The shell installer resumes within its current run and cleans its temporary files on exit.

License

MIT

About

Version manager for the elephc compiler. Pins a version per project through a committed .elephc-version, installs published binaries or builds from source, and adds no shell hooks: PATH gets one entry, then a shim resolves the version and execs the real compiler.

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages