Skip to content

Commit

Permalink
fix cli
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Feb 16, 2022
1 parent 6070662 commit 0fdf9af
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
3 changes: 1 addition & 2 deletions boa/cli/boa.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ def main(config=None):
)
build_parser.add_argument(
"--suppress-variables",
action="append",
action="store_true",
help="CURRENTLY IGNORED! Do not display value of environment variables specified in build.script_env"
)
build_parser.add_argument(
"--clobber-file",
action="append",
help="CURRENTLY IGNORED! Clobber data in meta.yaml with fields from this file. Jinja2 is not done on clobbered fields"
)
subparsers.add_parser(
Expand Down
35 changes: 33 additions & 2 deletions boa/core/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,40 @@ def copy(self):
return new

def get_used_vars(self, force_top_level=False):
return []

raw_dependencies = (
self.get_dependencies("build")
+ self.get_dependencies("host")
)
dependencies = {x.name for x in raw_dependencies}

take_keys = set(k for k in self.config.variant.keys() if k in dependencies)
if "python" in take_keys and "python" not in dependencies:
take_keys.remove("python")

# Add <lang>_compiler and <lang>_compiler_version if it was used
for dep in raw_dependencies:
if dep.is_compiler:
if f'{dep.splitted[1]}_compiler' in self.config.variant:
take_keys.add(f'{dep.splitted[1]}_compiler')
if f'{dep.splitted[1]}_compiler_version' in self.config.variant:
take_keys.add(f'{dep.splitted[1]}_compiler_version')

if 'CONDA_BUILD_SYSROOT' in self.config.variant:
for dep in raw_dependencies:
if dep.is_compiler and dep.splitted[1] in ['c', 'cxx']:
take_keys.add('CONDA_BUILD_SYSROOT')

# always add target_platform and channel_targets to hash
if ('target_platform' in self.config.variant) and not self.noarch:
take_keys.add('target_platform')
if 'channel_targets' in self.config.variant:
take_keys.add('channel_targets')

return take_keys

def get_used_loop_vars(self, force_top_level=False):
return []
return set()

def get_test_deps(self, py_files, pl_files, lua_files, r_files):
specs = ["%s %s %s" % (self.name(), self.version(), self.build_id())]
Expand Down

0 comments on commit 0fdf9af

Please sign in to comment.