Allow renaming the launcher without recompilation#3
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 config—main.goresolves 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_nameconfig 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.ln -screates 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.goimports clashed because the fork usesgithub.com/jdevera/...while the upstream branch still usesgithub.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 locallygo test ./...passes locally./test/integration.sh— 19/19 suites pass (was 18; newtest-runtime-name.shsuite)