Skip to content

Allow renaming the launcher without recompilation#3

Merged
jdevera merged 5 commits into
mainfrom
port-runtime-app-name
May 17, 2026
Merged

Allow renaming the launcher without recompilation#3
jdevera merged 5 commits into
mainfrom
port-runtime-app-name

Conversation

@jdevera
Copy link
Copy Markdown
Owner

@jdevera jdevera commented May 17, 2026

Summary

Port of upstream PR criteo#195 onto the fork's main.

Five commits implementing runtime-derived binary name:

  • Derive app name from binary path, allow long name override via configmain.go resolves the binary's real path at startup, the app name comes from the filename (symlinks resolve to the same identity; copies become separate instances with their own config dirs). app_long_name config key lets the long display name be overridden without recompilation.
  • Update FULL_COMMAND_NAME test to not rely on binary copies sharing identity — adjusts an integration test that the new behavior would otherwise break.
  • Two commits skipping a symlink test on Windows where Git Bash ln -s creates copies and where symlinks need elevated privileges.
  • Document renaming the binary as an alternative to building from source — README + quickstart docs.

One conflict during cherry-pick: main.go imports clashed because the fork uses github.com/jdevera/... while the upstream branch still uses github.com/criteo/.... Resolved in favor of jdevera (the fork's module path).

The original branch runtime-app-name (which still backs PR criteo#195 upstream) is untouched.

Test plan

  • go vet ./... clean locally
  • go test ./... passes locally
  • ./test/integration.sh — 19/19 suites pass (was 18; new test-runtime-name.sh suite)
  • CI passes on Linux/Windows/macOS (Windows-specific symlink-skip logic is the most likely failure surface)

jdevera added 5 commits May 17, 2026 16:02
Resolve os.Args[0] through symlinks to get the real binary name at
runtime. Symlinks behave as aliases (same identity), while copies or
hard links produce a distinct app name and config directory.

The display long name can be overridden via the app_long_name config
key, falling back to the compiled-in default when unset.
…entity

The test-cmd-context test previously copied the cl binary to clcopy
and checked that CL_FULL_COMMAND_NAME reflected the new name. With
runtime app name resolution, a copied binary is now a separate instance
with its own env var prefix (CLCOPY_ instead of CL_), so the dropin
script's hardcoded $CL_FULL_COMMAND_NAME comes back empty.

The copy-based FULL_COMMAND_NAME behavior is already covered by the
new test-runtime-name integration test. This test now checks
FULL_COMMAND_NAME with the original cl binary, which still validates
that the env var is correctly set with group and without group.
@jdevera jdevera merged commit 27e3643 into main May 17, 2026
16 checks passed
@jdevera jdevera deleted the port-runtime-app-name branch May 17, 2026 15:11
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