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

default to disable package caching during build #920

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/rez/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ def _parse_env_var(self, value):
"package_cache_clean_limit": Float,
"allow_unversioned_packages": Bool,
"rxt_as_yaml": Bool,
"package_cache_during_build": Bool,
"package_cache_local": Bool,
"package_cache_same_device": Bool,
"color_enabled": ForceOrBool,
Expand Down
16 changes: 12 additions & 4 deletions src/rez/resolved_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(self, package_requests, verbosity=0, timestamp=None,
package_filter=None, package_orderers=None, max_fails=-1,
add_implicit_packages=True, time_limit=-1, callback=None,
package_load_callback=None, buf=None, suppress_passive=False,
print_stats=False, package_caching=True):
print_stats=False, package_caching=None):
"""Perform a package resolve, and store the result.

Args:
Expand Down Expand Up @@ -188,9 +188,10 @@ def __init__(self, package_requests, verbosity=0, timestamp=None,
suppress_passive (bool): If True, don't print debugging info that
has had no effect on the solve. This argument only has an
effect if `verbosity` > 2.
print_stats (bool): If true, print advanced solver stats at the end.
package_caching (bool): If True, apply package caching settings as
per the config.
print_stats (bool): If True, print advanced solver stats at the end.
package_caching (bool|None): If True, apply package caching settings
as per the config. If None, enable as determined by config
setting 'package_cache_during_build'.
"""
self.load_path = None

Expand Down Expand Up @@ -226,6 +227,13 @@ def __init__(self, package_requests, verbosity=0, timestamp=None,

# settings that affect context execution
self.append_sys_path = True

if package_caching is None:
if building:
package_caching = config.package_cache_during_build
else:
package_caching = True

self.package_caching = package_caching

# patch settings
Expand Down
3 changes: 3 additions & 0 deletions src/rez/rezconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@
# To disable, set to zero.
package_cache_max_variant_days = 30

# Enable package caching during a package build.
package_cache_during_build = False

# Allow caching of local packages. You would only want to set this True for
# testing purposes.
package_cache_local = False
Expand Down