Skip to content

docs(settings): say where an executable unpacks its assets - #32

Merged
allanbowe merged 1 commit into
mainfrom
docs/pkg-cache-in-root
Nov 4, 2026
Merged

allanbowe merged 1 commit into
mainfrom
docs/pkg-cache-in-root

Conversation

@sasjs-dev

@sasjs-dev sasjs-dev Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Follows sasjs/server#536 (issue #523).

A standalone executable used to leave the assets it unpacks in ~/.cache/pkg/tmp-XXXXXX, in the service account's home, on every start that refreshed the drive. That cache now lives in a tmp subfolder of SASJS_ROOT, is removed when the process exits, and a start clears out folders from earlier runs once they are a day old.

Two docs surfaces, because an operator looking for it could arrive at either:

  • docs/settings.md - the SASJS_ROOT entry now says what the tmp subfolder is for.
  • docs/installation.md - the standalone-executable section says the same in the place someone reads while installing.

Both state the contract only - the folder under SASJS_ROOT, the cleanup, and the age - rather than the folder's own naming or pkg's PKG_NATIVE_CACHE_PATH, which belong to the packaging runtime and would go stale with it. No version numbers are named either, so nothing here goes stale with the next release.

@sasjs-dev sasjs-dev Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

REVIEWED ON 2026-11-04 13:40 UTC

Reviewed the two added paragraphs in docs/installation.md and docs/settings.md, plus the cross-links and anchors they use (/settings/#sasjs_root resolves - settings.md carries ### SASJS_ROOT and the other links in installation.md use the same form).

  • docs/settings.md: the pkg-cache-<pid> folder name, its removal on start, and PKG_NATIVE_CACHE_PATH are behaviours of the executable's packaging runtime, not of anything this repo pins. Nothing here can catch them going stale when the pkg version changes, so name the source of the claim (the module or pkg release the behaviour comes from) or keep the wording to the contract that matters - the directory used and that it is cleaned up - rather than the folder name and the env var override.

1 note above; no blocking issues.

@sasjs-dev
sasjs-dev Bot force-pushed the docs/pkg-cache-in-root branch from d477f61 to 9f8b06d Compare November 4, 2026 13:42
@sasjs-dev

sasjs-dev Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Both rounds actioned, current head 57df2a5.

Round 1 - contract, not implementation. docs/settings.md now states only what an operator relies on: a tmp subfolder under SASJS_ROOT, removed when the process exits, with leftovers from earlier runs cleared at start. The folder's own name and PKG_NATIVE_CACHE_PATH are gone. docs/installation.md was already contract-only and is unchanged. The override now appears once, in sasjs/server's README.md, next to the code that honours it and attributed as pkg's own variable.

Round 2 - how the sweep decides. It is age, not a pid probe: a running instance refreshes its folder's timestamp hourly, and a start removes a pkg-cache-* folder that nothing has refreshed for a day. So the sentence has to say a day, and it does: "A start also removes leftover folders from earlier runs once they are a day old, so a process that was killed does not leave one behind for good." The previous wording ("processes that are no longer running") is exactly the overstatement you flagged, and it was based on a pid check that does not survive process namespaces - sasjs/server#536 reviews that in detail.

Build the site is green on 57df2a5.

@sasjs-dev sasjs-dev Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

REVIEWED ON 2026-11-04 14:03 UTC

Reviewed the current diff - two documentation paragraphs, no code, CI still pending on this head.

The SASJS_ROOT addition to docs/settings.md says a start removes leftover tmp folders "belonging to processes that are no longer running", while docs/installation.md only promises removal on exit. If the startup sweep is real, saying how it decides a process is gone (pid file, marker file) would save a reader from assuming the sweep covers a crash - and if it does not exist, the settings.md sentence overstates the behaviour.

Reviewed the diff - no blocking issues found.

sasjs/server#523 moved pkg's extracted-asset cache from `~/.cache/pkg` into
`<SASJS_ROOT>/tmp/pkg-cache-<pid>`, removed when the process exits. The
`SASJS_ROOT` entry and the standalone-executable section are the two places an
operator would look for it.
@sasjs-dev
sasjs-dev Bot force-pushed the docs/pkg-cache-in-root branch from 9f8b06d to 57df2a5 Compare November 4, 2026 14:08
@allanbowe
allanbowe merged commit dd15a1e into main Nov 4, 2026
1 check passed
@allanbowe
allanbowe deleted the docs/pkg-cache-in-root branch November 4, 2026 14:22
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