Setup environment before determining version in plan build
`_set_environment` must run prior to determining the value for `pkg_version`
because the function populates metadata, including the PATH metafile, with
filepaths including the value of `pkg_version` in their path
@@ -3090,14 +3090,14 @@ _determine_hab_bin
_resolve_dependencies
-# Set up runtime environment
-_set_environment
-
mkdir -pv "$HAB_CACHE_SRC_PATH"
-# Run any code after the environment is set but before the build starts
+# Run any code before environment is set and the build starts
do_before
+# Set up runtime environment
+_set_environment
+
# Download the source
do_download
