Fixing Supervisor's PATH
setting & two other treats
#421
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.
This changeset has three parts:
[sup] Update how Supervisor sets
PATH
on start.This change uses a more robust strategy for setting the
PATH
environment variable before a supervised process is start via the
start
subcommand.Prior to this change, an install of the supervisor package was required
in order for the Supervisor to start any service, which included
running the Supervisor in the source tree for purposes of development.
This change makes it more explict what we are after in the supervisor's
PATH
entry: a minmal BusyBox userland.There is a series of fallback strategies used here in order to find a
usable BusyBox installation. The general strategy is the following:
DEPS
metafile& return its
PATH
entries& return its
PATH
entriesbusybox
binary present on$PATH
?the
busybox
binarythe user we're done
The end result is that an installation of the Supervisor package is no
longer required in a development environment--only an installation of
the
core/busybox-static
package. Additionally, the precise release ofthe
core/busybox-static
dependency will be used when running theSupervisor out of a pacakge (its natural home).
[formatting] Code formating updates due to
rustfmt
.Without this change there will be mega code churn in the
core::crypto
module.[core] Add
env::var
&env::var_os
functions to check for empty vars.The standard library will consider an empty-but-set environment
variable a legit result. After inspecting the codebase, it turns out
that is not the expectation in most of our code. Indeed, a set-but-empty
HAB_DEPOT_URL
is not valid and should be ignored.This change introduces 2 functions which shadow their standard library
cousins providing this additional check.