Skip to content

Add install and uninstall scripts#4

Merged
UncleGrumpy merged 3 commits into
mainfrom
doc_update
May 18, 2026
Merged

Add install and uninstall scripts#4
UncleGrumpy merged 3 commits into
mainfrom
doc_update

Conversation

@UncleGrumpy
Copy link
Copy Markdown
Owner

@UncleGrumpy UncleGrumpy commented May 18, 2026

Adds self-extracting executable installer and uninstall script, updates docs on how to install and uninstall the app.

Signed-off-by: Winford <winford@object.stream>
Signed-off-by: Winford <winford@object.stream>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f65bd6eb-f376-481c-976d-7f0f77f2625e

📥 Commits

Reviewing files that changed from the base of the PR and between 19a15c0 and 0a12c61.

📒 Files selected for processing (9)
  • .github/workflows/code_quality_check.yaml
  • README.md
  • rebar.config
  • rebar.config.script
  • release/install.in
  • release/spectrometer.app.src.in
  • release/spectrometer.in
  • release/uninstall.in
  • src/spectrometer.app.src
💤 Files with no reviewable changes (1)
  • rebar.config
✅ Files skipped from review due to trivial changes (2)
  • src/spectrometer.app.src
  • README.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • .github/workflows/code_quality_check.yaml
  • release/spectrometer.in
  • release/uninstall.in
  • release/spectrometer.app.src.in
  • rebar.config.script
  • release/install.in

📝 Walkthrough

Walkthrough

Adds release packaging and build configuration, a self-extracting installer, launcher and uninstaller scripts, updated app metadata and release templates, CI workflow formatting/ShellCheck tweaks, and README installation/uninstall documentation.

Changes

Release Packaging and Installation

Layer / File(s) Summary
Release build configuration and profiles
rebar.config.script
Dynamic Version binding from git describe; compiler, escript, erlfmt, dialyzer, xref, and multiple build profiles; relx release config and provider/post hooks to escriptize and append install tarball into install.sh.
Application resource definitions
src/spectrometer.app.src, release/spectrometer.app.src.in
Updates src/spectrometer.app.src metadata (description, vsn, adds inets/ssl, populates links); adds release/spectrometer.app.src.in template with version placeholder and app metadata.
Release entrypoints and installation scripts
release/spectrometer.in, release/install.in, release/uninstall.in
spectrometer.in sets up embedded ERTS bin and execs the packaged binary. install.in is a self-extracting installer (prefix handling, version conflict check, extract embedded tar.gz, install to ${prefix}/lib/atomvm_spectrometer and ${prefix}/bin/spectrometer). uninstall.in removes installed files and optionally user cache with --full/-f.
CI workflow updates for release artifacts
.github/workflows/check-formatting.yaml, .github/workflows/code_quality_check.yaml
Formatting workflow now caches Go tools only, installs actionlint conditionally, and runs rebar3 as check fmt --check. ShellCheck step expanded to lint generate_fun_data.sh and release/{spectrometer,*install}.in.
Installation documentation and credits
README.md
Adds credit/link to Paul Guyot’s gist and a detailed “Install” section describing release build commands, generated installer behavior, install layout, PATH guidance, and uninstall options including --full.
sequenceDiagram
  participant rebar as rebar.config.script
  participant relx as relx
  participant build as build_artifacts
  participant install_sh as install.sh

  rebar->>relx: configure relx release and overlays
  rebar->>build: escriptize via provider_hooks
  build->>install_sh: post_hooks append tarball into install.sh
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • UncleGrumpy/atomvm_spectrometer#2: Modifies .github/workflows/code_quality_check.yaml ShellCheck setup; this PR extends that workflow to lint the new release template scripts.

Poem

🐰 I pack up the tarball, snug and tight,
Bury the bytes in a shell-script night.
Installer hops in, launcher leads the dance,
Uninstall sweeps up with tidy prance.
Hooray — a release, snug as a bite!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding install and uninstall scripts to the project.
Description check ✅ Passed The description is directly related to the changeset, describing the self-extracting installer, uninstall script, and documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch doc_update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
rebar.config (1)

1-136: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Address the erlfmt formatting issues.

The pipeline reports code style issues in this file. Run rebar3 as check fmt to auto-format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rebar.config` around lines 1 - 136, Run the erlfmt formatter and commit the
updated rebar.config: execute `rebar3 as check fmt` to apply the formatting
rules defined by the {erlfmt, [...] } entry in this file, review the modified
rebar.config to ensure only whitespace/formatting changes were made, and
add/commit those changes so the pipeline no longer reports style issues.
🧹 Nitpick comments (1)
rebar.config (1)

95-95: ⚡ Quick win

Consider extracting the version to avoid duplication.

The version "0.1.0" appears both in the relx release definition (line 95) and in the post_hooks tar filename (line 132). If the version changes, both locations must be updated manually, which is error-prone.

Consider using rebar3's {vsn, git} or reading from a single source.

Also applies to: 132-132

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rebar.config` at line 95, The release version string "0.1.0" is duplicated in
the {release, {atomvm_spectrometer, "0.1.0"}, ...} tuple and the post_hooks tar
filename; extract the version into a single source and reference it from both
places (e.g., define a Version variable at the top of rebar.config and use that
symbol where the release tuple and the post_hooks tar name are declared, or
switch the release to {vsn, git} and build the post_hooks filename from that
same vsn), then update {release, {atomvm_spectrometer, ...}} and the post_hooks
tar filename to use the single version source.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/code_quality_check.yaml:
- Around line 62-64: The YAML block under the GitHub Actions step has incorrect
indentation for the multiline run: | content; update the two shellcheck commands
that follow the run: | line so they are indented two more spaces (total of 8
spaces) to be nested under run: |, ensuring the shellcheck lines are valid YAML
members of the run block (look for the run: | key and the shellcheck -o
require-variable-braces... lines to adjust).

In `@README.md`:
- Line 64: Fix the typo in the README text: replace "buy" with "by" in the
sentence "the user PATH. If not already present, it can be added permanently buy
adding" so it reads "...can be added permanently by adding"; update that exact
string in README.md.
- Line 85: Replace the incorrect word "than" with "then" in the sentence
fragment "application and user cache files. If sudo was required for
installation than" in README.md so it reads "...cache files. If sudo was
required for installation then..."; simply update that word to correct the
grammar.
- Line 65: Fix the PATH export syntax: replace the incorrect variable expansion
string `"{$PATH}:<prefix>/bin"` with the correct shell expansion using braces
around the variable name, i.e., use `"${PATH}:<prefix>/bin"` in the existing
export PATH line so the shell expands PATH properly when running the `export
PATH="...":...` command.

In `@release/install.in`:
- Line 99: The cp command uses a quoted glob so the shell won't expand "*"
(echo_run cp -fr "${tmp_dir}/*" "${dest_dir}/"), causing copy to fail; change it
to pass the glob unquoted so the shell expands it (e.g. use echo_run cp -fr
"${tmp_dir}"/* "${dest_dir}/") or alternatively copy the whole directory without
a glob (e.g. use cp -fr "${tmp_dir}/." "${dest_dir}/" or switch to rsync) —
update the call referencing tmp_dir, dest_dir and the cp -fr invocation
accordingly.
- Line 5: Replace the incorrect year "206" in the copyright header string
"Copyright 206 Winford (UncleGrumpy) <winford@object.stream>" with "2026" so the
license header reads "Copyright 2026 Winford (UncleGrumpy)
<winford@object.stream>" (update the literal in release/install.in).
- Around line 68-72: The echo_run function currently builds cmd="${*}" and then
executes ${cmd}, which allows word-splitting and breaks paths with spaces;
change it to preserve arguments and quote expansions by using the
positional-parameter form (use "$@" for execution) and stop using an unquoted
${cmd}; also update the diagnostic echo to print a safe, quoted representation
of the arguments (e.g., join/format "$@" or use a quoting-aware printer) so
echo_run (the function and its cmd handling) no longer relies on unquoted ${*}
or ${cmd}.

In `@release/uninstall.in`:
- Line 5: Update the copyright year in the header line that currently reads
"Copyright 206 Winford (UncleGrumpy) <winford@object.stream>" to "Copyright 2026
Winford (UncleGrumpy) <winford@object.stream>" so the year is correct; locate
and edit the top-of-file header in release/uninstall.in to replace "206" with
"2026".
- Around line 68-79: The script uses OS=$(uname -o) and matches "GNU/Linux",
which is non-portable; change the OS detection to use uname -s (i.e., replace
uname -o with uname -s) and update the case labels to match the values uname -s
actually returns (use "Darwin" for macOS and "Linux" for Linux) so the cache_dir
assignment in the case block (cache_dir variable and its readonly assignments)
works cross-platform; keep the existing default branch for unknown OS values.
- Around line 49-53: The echo_run function uses an unquoted expansion of ${cmd},
causing word splitting on paths with spaces; update echo_run (the function and
its use of cmd) to preserve arguments and spacing by avoiding building a single
string and instead printing the command for logging while executing the original
arguments safely (use the positional expansion "${@}" for execution and quote
the printed representation), ensuring the function uses "${@}" to run the
command so each argument with spaces is preserved.

---

Outside diff comments:
In `@rebar.config`:
- Around line 1-136: Run the erlfmt formatter and commit the updated
rebar.config: execute `rebar3 as check fmt` to apply the formatting rules
defined by the {erlfmt, [...] } entry in this file, review the modified
rebar.config to ensure only whitespace/formatting changes were made, and
add/commit those changes so the pipeline no longer reports style issues.

---

Nitpick comments:
In `@rebar.config`:
- Line 95: The release version string "0.1.0" is duplicated in the {release,
{atomvm_spectrometer, "0.1.0"}, ...} tuple and the post_hooks tar filename;
extract the version into a single source and reference it from both places
(e.g., define a Version variable at the top of rebar.config and use that symbol
where the release tuple and the post_hooks tar name are declared, or switch the
release to {vsn, git} and build the post_hooks filename from that same vsn),
then update {release, {atomvm_spectrometer, ...}} and the post_hooks tar
filename to use the single version source.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ddeb77ee-b55f-4fcb-9363-8f479d95aeca

📥 Commits

Reviewing files that changed from the base of the PR and between 977fc37 and ab5bc43.

📒 Files selected for processing (9)
  • .github/workflows/check-formatting.yaml
  • .github/workflows/code_quality_check.yaml
  • README.md
  • rebar.config
  • release/install.in
  • release/spectrometer.app.src.in
  • release/spectrometer.in
  • release/uninstall.in
  • src/spectrometer.app.src

Comment thread .github/workflows/code_quality_check.yaml Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread release/install.in Outdated
Comment thread release/install.in
Comment thread release/install.in Outdated
Comment thread release/uninstall.in Outdated
Comment thread release/uninstall.in
Comment thread release/uninstall.in Outdated
@UncleGrumpy UncleGrumpy force-pushed the doc_update branch 3 times, most recently from d01fe02 to 876496a Compare May 18, 2026 08:16
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rebar.config.script`:
- Around line 10-20: The Version value retrieved into the Version variable is
taken directly from git and later injected into a shell command (referenced
around the Version binding and the injection at lines ~139-141), which allows
shell metacharacter injection; fix by validating/sanitizing Version immediately
after assignment—allow only a safe whitelist (e.g., /^[A-Za-z0-9._-]+$/) and
fall back to a fixed safe string if it fails, and/or avoid interpolating into a
shell command by using a safe API (no shell) or by robustly escaping/quoting the
value before use; update the code that injects Version into the shell (the
release-packaging invocation) to use the sanitized/validated variable or a
non-shell invocation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a08287cd-535c-4929-8913-2c3aad92c133

📥 Commits

Reviewing files that changed from the base of the PR and between ab5bc43 and 876496a.

📒 Files selected for processing (9)
  • .github/workflows/code_quality_check.yaml
  • README.md
  • rebar.config
  • rebar.config.script
  • release/install.in
  • release/spectrometer.app.src.in
  • release/spectrometer.in
  • release/uninstall.in
  • src/spectrometer.app.src
💤 Files with no reviewable changes (1)
  • rebar.config
✅ Files skipped from review due to trivial changes (3)
  • src/spectrometer.app.src
  • README.md
  • release/spectrometer.app.src.in
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/code_quality_check.yaml
  • release/install.in
  • release/uninstall.in
  • release/spectrometer.in

Comment thread rebar.config.script
@UncleGrumpy
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@UncleGrumpy
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/spectrometer.app.src (1)

14-21: 💤 Low value

Consider reordering applications to follow OTP convention.

The Erlang/OTP convention typically lists kernel and stdlib first in the applications list, as they are the fundamental runtime applications. While the current order is functionally correct, following this convention improves readability.

♻️ Suggested reordering
     {applications, [
+        kernel,
+        stdlib,
         compiler,
         inets,
-        kernel,
         ssl,
-        stdlib,
         syntax_tools
     ]},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/spectrometer.app.src` around lines 14 - 21, The applications list in the
release config is out of conventional order; reorder the tuple named
applications so that kernel and stdlib appear first (e.g., ensure kernel and
stdlib are listed before compiler, inets, ssl, syntax_tools) to follow OTP
conventions and improve readability while preserving the same entries.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/spectrometer.app.src`:
- Around line 14-21: The applications list in the release config is out of
conventional order; reorder the tuple named applications so that kernel and
stdlib appear first (e.g., ensure kernel and stdlib are listed before compiler,
inets, ssl, syntax_tools) to follow OTP conventions and improve readability
while preserving the same entries.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9505d52c-80b0-42f5-857b-c9b6545addf9

📥 Commits

Reviewing files that changed from the base of the PR and between 876496a and cee69d3.

📒 Files selected for processing (9)
  • .github/workflows/code_quality_check.yaml
  • README.md
  • rebar.config
  • rebar.config.script
  • release/install.in
  • release/spectrometer.app.src.in
  • release/spectrometer.in
  • release/uninstall.in
  • src/spectrometer.app.src
💤 Files with no reviewable changes (1)
  • rebar.config
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • release/spectrometer.in
  • release/spectrometer.app.src.in
  • release/uninstall.in
  • rebar.config.script
  • release/install.in

Signed-off-by: Winford <winford@object.stream>
@UncleGrumpy
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@UncleGrumpy UncleGrumpy merged commit af8eab1 into main May 18, 2026
8 checks passed
@UncleGrumpy UncleGrumpy deleted the doc_update branch May 18, 2026 15:38
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