Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: a mechanism to declare runtime environment variables at build time #1579

Closed
robbkidd opened this issue Dec 14, 2016 · 2 comments · Fixed by #4067
Closed

RFC: a mechanism to declare runtime environment variables at build time #1579

robbkidd opened this issue Dec 14, 2016 · 2 comments · Fixed by #4067
Labels
Focus :Plan Build Type: Feature Issues that describe a new desired feature
Milestone

Comments

@robbkidd
Copy link
Contributor

robbkidd commented Dec 14, 2016

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.

habitat-sh/core-plans > ack --files-with-matches "hab pkg path" | ack "hooks" | wc -l
      10

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:

  • Paths can be computed at build time and ...

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.
@smurawski
Copy link
Contributor

Currently the hab pkg path problem should be helped with a new helper pkgPathFor, but the greater problem remains and is one that we need to solve.

@robbkidd
Copy link
Contributor Author

@christophermaier 👋 Heeeey ... runtime env vars!

@christophermaier christophermaier added Type: Feature Issues that describe a new desired feature and removed C-feature labels Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus :Plan Build Type: Feature Issues that describe a new desired feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants