Run the full activation lifecycle in 'hermit env --activate' - #601
Open
joahg wants to merge 1 commit into
Open
Conversation
'hermit activate' installs install-on-activate packages and runs 'on activate' triggers before emitting environment variables, but 'hermit env --activate' - used by the shell hooks in activate.tmpl.sh/activate.tmpl.fish when the environment changes, and commonly by CI via 'eval $(hermit env --activate)' - only computed and applied the envar operations. The two activation paths could therefore drift: packages and triggers were skipped entirely on the env --activate path. Extract the shared lifecycle into Env.Activate and use it from both paths. Trigger messages are printed to stderr on the env --activate path since stdout is reserved for shell commands. Buzz-Message: buzz://message?channel=573ff355-6c19-422d-b425-112853d0ec7e&id=16f5b666c0976829a1985868753407c7b20b393d89f99a8b39106be9fe6a1514 Amp-Thread-ID: https://ampcode.com/threads/T-019fce27-e59e-727c-b6d3-cdeeba894a4e Co-authored-by: Amp <amp@ampcode.com>
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.
Context: #597 — composing agent-skills-style content packages from existing Hermit primitives.
hermit activateinstallsinstall-on-activatepackages and runson activatetriggers before emitting environment variables, buthermit env --activate— used by the shell hooks inactivate.tmpl.sh/activate.tmpl.fishwhen the environment changes, and commonly by CI viaeval $(hermit env --activate)— only computed and applied the envar operations. The two activation paths could therefore drift: packages and triggers were skipped entirely on theenv --activatepath.This extracts the shared lifecycle into
Env.Activateand uses it from both paths. Trigger messages are printed to stderr on theenv --activatepath since stdout is reserved for shell commands.Tested with
go test ./...andgolangci-lint run.