You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$(hab pkg path origin/thingie) in a hook does not guarantee that that the path returned is the version the hook's package was built against. The presence of this command in a hook should be considered a code smell.
Anyone running multiple habitat packages on a single host, the bare-metal scenario. Should not affect those running habitat packages exported to containers.
Solutions Today:
Paths can be computed at build time and ...
written out to wrapper scripts that act like binstubs for the real binaries, see this pattern in wrap_with_cert_path (used for cargo-nightly and rust) and write_shim (used for github_changelog_generator)
written out to a file that is sourced by hooks, see notional work on packaging Supermarket with Habitat (write out in plan and then source it in a hook)
Solution Idea
Throwing a noodle at the wall:
A do_pkg_exports function that would write out given exports from a plan to an EXPORTS file at $pkg_prefix.
The generator for the default run hook would source this EXPORTS file.
A make_binstub (similar to fix_interpreter) to be called during build/install to rename an original binary (like in wrap_with_cert_path & write_shim) and write out a binstub/wrapper/shim to the original binary's location that sources the EXPORTS file.
The text was updated successfully, but these errors were encountered:
Problem:
$(hab pkg path origin/thingie)
in a hook does not guarantee that that the path returned is the version the hook's package was built against. The presence of this command in a hook should be considered a code smell.First notion I can find on this problem is a forum post from @elliott-davis.
Affects:
Anyone running multiple habitat packages on a single host, the bare-metal scenario. Should not affect those running habitat packages exported to containers.
Solutions Today:
wrap_with_cert_path
(used for cargo-nightly and rust) andwrite_shim
(used for github_changelog_generator)Solution Idea
Throwing a noodle at the wall:
do_pkg_exports
function that would write out given exports from a plan to anEXPORTS
file at$pkg_prefix
.EXPORTS
file.make_binstub
(similar tofix_interpreter
) to be called during build/install to rename an original binary (like inwrap_with_cert_path
&write_shim
) and write out a binstub/wrapper/shim to the original binary's location that sources theEXPORTS
file.The text was updated successfully, but these errors were encountered: