def loadenv(logger, event_queue, job_env, package, context, verbose=True): # Get the paths to the env loaders env_loader_paths = get_env_loaders(package, context) # If DESTDIR is set, set _CATKIN_SETUP_DIR as well if context.destdir is not None: job_env['_CATKIN_SETUP_DIR'] = context.package_dest_path(package) envs = [] for env_loader_path in env_loader_paths: if logger and verbose: logger.out('Loading environment from: {}'.format(env_loader_path)) envs.append( get_resultspace_environment(os.path.split(env_loader_path)[0], base_env=job_env, quiet=True, cached=context.use_env_cache, strict=False)) # Avoid using merge logic if not required (in the non-isolated resultspace # case. It has corner cases which may trip up the unwary, so having the # option to switch to a merged resultspace is a good fallback. if len(envs) > 1: merge_envs(job_env, envs) elif len(envs) == 1: job_env.update(envs[0]) return 0
def loadenv(logger, event_queue, job_env, package, context): # Get the paths to the env loaders env_loader_paths = get_env_loaders(package, context) # If DESTDIR is set, set _CATKIN_SETUP_DIR as well if context.destdir is not None: job_env['_CATKIN_SETUP_DIR'] = context.package_dest_path(package) envs = [] for env_loader_path in env_loader_paths: if logger: logger.out('Loading environment from: {}'.format(env_loader_path)) envs.append(get_resultspace_environment( os.path.split(env_loader_path)[0], base_env=job_env, quiet=True, cached=context.use_env_cache, strict=False)) # Avoid using merge logic if not required (in the non-isolated resultspace # case. It has corner cases which may trip up the unwary, so having the # option to switch to a merged resultspace is a good fallback. if len(envs) > 1: merge_envs(job_env, envs) elif len(envs) == 1: job_env.update(envs[0]) return 0
def loadenv(logger, event_queue, job_env, package, context): if context.install: raise ValueError('Cannot test with installed workspace.') env_loader_path = context.package_final_path(package) job_env.update( get_resultspace_environment(env_loader_path, base_env=job_env, quiet=True, cached=context.use_env_cache, strict=False)) return 0
def loadenv(logger, event_queue, job_env, package, context): # Get the paths to the env loaders env_loader_paths = get_env_loaders(package, context) # If DESTDIR is set, set _CATKIN_SETUP_DIR as well if context.destdir is not None: job_env['_CATKIN_SETUP_DIR'] = context.package_dest_path(package) for env_loader_path in env_loader_paths: if logger: logger.out('Loading environment from: {}'.format(env_loader_path)) resultspace_env = get_resultspace_environment( os.path.split(env_loader_path)[0], base_env=job_env, quiet=True, cached=context.use_env_cache, strict=False) job_env.update(resultspace_env) return 0
def load_env(base_env): # Copy the base environment to extend job_env = dict(base_env) # Get the paths to the env loaders env_loader_paths = get_env_loaders(package, context) # If DESTDIR is set, set _CATKIN_SETUP_DIR as well if context.destdir is not None: job_env['_CATKIN_SETUP_DIR'] = context.package_dest_path(package) for env_loader_path in env_loader_paths: # print(' - Loading resultspace env from: {}'.format(env_loader_path)) resultspace_env = get_resultspace_environment( os.path.split(env_loader_path)[0], base_env=job_env, quiet=True, cached=context.use_env_cache, strict=False) job_env.update(resultspace_env) return job_env