Skip to content

feat(rust): make the release binary self-contained - #6

Merged
Esl1h merged 3 commits into
mainfrom
rust-standalone-binary
Oct 10, 2026
Merged

Esl1h merged 3 commits into
mainfrom
rust-standalone-binary

Conversation

@Esl1h

@Esl1h Esl1h commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Why

The bare .bin published on the release could not complete an install. It read install.conf.example and vendor/tar1090-install.sh from its working directory, and someone who downloads only the .bin has neither. A first run stopped with Example config not found, and with a hand-made install.conf it stopped at the tar1090 step, after the earlier steps had already run.

What changes

  • rust/src/core/cfg.rs: install.conf.example is compiled in with include_str!. The file next to the binary still wins; without it, the first run creates install.conf from the compiled-in copy, and a dry-run reads that copy.
  • rust/src/steps/tar1090.rs: the pinned installer is compiled in with include_bytes!, pointing at the same vendor/tar1090-install.sh the repo already tracks, so there is no second copy in the sources.
    • The pin is checked against the compiled-in bytes through sha256sum on stdin, so a dry-run still writes nothing.
    • A real run without vendor/ next to the binary writes the script to ~/.cache/easy1090/tar1090-install.sh (removed by uninstall) and runs it with sudo bash.
    • The script is still executed as is, never ported or altered.
  • rust/tests/standalone.rs and unit tests: the binary runs in an empty directory, and a test fails if the embedded installer stops matching TAR1090_INSTALLER_SHA256 in the embedded example, so updating vendor/ without the pin breaks the build.
  • .github/workflows/rust.yml: the job also runs for changes to vendor/** and install.conf.example, which are now part of the binary.
  • Docs: the READMEs, the changelog and the Makefile comment no longer claim the bare .bin cannot install.

Verification

  • cargo fmt --check, clippy -D warnings and cargo test pass: 103 tests, 1 ignored (the sudo TTY test).
  • In an Arch container, with the static musl build:
    • Archive layout, 19 cases in en and pt compared against the shell version (stdout, stderr, exit code): 114 of 114 identical after normalizing paths.
    • Bare .bin alone, with no config, example or vendor/: 36 of 36 identical to the shell version in dry-run. The only difference is the installer path, ~/.cache/easy1090/tar1090-install.sh instead of <root>/vendor/....
    • A real first run of the bare .bin created install.conf and ran feed --status.
  • Not run: the real sudo bash of the cached installer, which needs a full install. Writing the file is unit tested, and the command is the same one the vendor/ path runs.

Notes

  • The v0.2.0-rust.2-rc binaries predate this change, so the README install example keeps using the archive until the next candidate is cut.
  • The .bin alone does not carry LICENSE.tar1090, which ships in the archive's vendor/. Worth deciding whether the binary should print the notice.

Esl1h added 3 commits October 9, 2026 22:51
The bare release binary failed on a first run: it needed
install.conf.example and vendor/tar1090-install.sh next to it, and
someone who downloads only the .bin has neither.

Compile both in from the repo files with include_str! and
include_bytes!, so there is no second copy in the sources. The files
next to the binary still win, which keeps the archive layout and the
shell version's behavior unchanged. The pin is checked against the
compiled-in bytes through sha256sum on stdin, so a dry-run still
writes nothing; a real run writes the installer to ~/.cache/easy1090
before running it.
vendor/ and install.conf.example are compiled into the binary now, so a
change to either has to rebuild and test it, in particular the check
that the embedded installer still matches its pin.
The READMEs, the changelog and the Makefile comment said the bare .bin
cannot complete an install. It can now, since it carries the example
config and the pinned tar1090 installer; the copies from the archive
still take precedence.

Candidates up to v0.2.0-rust.2-rc predate this and keep needing the
archive, so the install example stays on the archive until the next
candidate.
@Esl1h
Esl1h merged commit 834c5af into main Oct 10, 2026
8 checks passed
@Esl1h
Esl1h deleted the rust-standalone-binary branch October 10, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant