Skip to content

Commit

Permalink
Add REZ_USED_LOCAL_RESOLVE context environment variable (#1378)
Browse files Browse the repository at this point in the history
* Add REZ_USED_LOCAL_RESOLVE context environment variable in the same style as REZ_USED_EPH_RESOLVE for any packages resolved to a local destination

Signed-off-by: Josh <[email protected]>
  • Loading branch information
JoshkVFX authored Nov 15, 2022
1 parent 8c87993 commit 44b3d51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rez/resolved_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,7 @@ def normalized(path):
request_str = ' '.join(str(x) for x in self._package_requests)
implicit_str = ' '.join(str(x) for x in self.implicit_packages)
resolve_str = ' '.join(x.qualified_package_name for x in resolved_pkgs)
local_packages_str = ' '.join(x.qualified_package_name for x in resolved_pkgs if x.is_local)
req_timestamp_str = str(self.requested_timestamp or 0)
package_paths_str = executor.interpreter.pathsep.join(
normalized(x) for x in self.package_paths
Expand All @@ -1979,6 +1980,9 @@ def normalized(path):
eph_resolve_str = ' '.join(str(x) for x in ephemerals)
executor.setenv("REZ_USED_EPH_RESOLVE", eph_resolve_str)

if local_packages_str:
executor.setenv("REZ_USED_LOCAL_RESOLVE", local_packages_str)

if self.building:
executor.setenv("REZ_BUILD_ENV", "1")

Expand Down
2 changes: 2 additions & 0 deletions wiki/pages/Environment-Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ These are variables that rez generates within a resolved environment (a "context
* **REZ_USED_PACKAGES_PATH** - The package searchpath used for this resolve.
* **REZ_USED_RESOLVE** - The list of resolved packages, eg *"platform-linux utils-1.2.3"*.
* **REZ_USED_EPH_RESOLVE** - The list of resolved ephemerals, eg *".foo.cli-1 .debugging-0"*.
* **REZ_USED_LOCAL_RESOLVE** - The list of resolved local packages, eg *"utils-1.2.3 maya_utils-1.3+"*.
Packages listed here will always be a subset of the packages in *REZ_USED_RESOLVE*.
* **REZ_USED_REQUEST** - The environment request string, eg *"maya-2017 maya_utils-1.3+"*.
Does not include implicit packages.
* **REZ_USED_REQUESTED_TIMESTAMP** - The epoch time of this resolved environment,
Expand Down

0 comments on commit 44b3d51

Please sign in to comment.