@ -2642,10 +2642,9 @@ class Interpreter(InterpreterBase):
FeatureNew . single_use ( ' stdlib without variable name ' , ' 0.56.0 ' , self . subproject )
FeatureNew . single_use ( ' stdlib without variable name ' , ' 0.56.0 ' , self . subproject )
kwargs = { ' fallback ' : di ,
kwargs = { ' fallback ' : di ,
' native ' : for_machine is MachineChoice . BUILD ,
' native ' : for_machine is MachineChoice . BUILD ,
' force_fallback ' : True ,
}
}
name = display_name = l + ' _stdlib '
name = display_name = l + ' _stdlib '
dep = self . dependency_impl ( name , display_name , kwargs )
dep = self . dependency_impl ( name , display_name , kwargs , force_fallback = True )
self . build . stdlibs [ for_machine ] [ l ] = dep
self . build . stdlibs [ for_machine ] [ l ] = dep
def import_module ( self , modname ) :
def import_module ( self , modname ) :
@ -3701,7 +3700,7 @@ external dependencies (including libraries) must go to "dependencies".''')
build . DependencyOverride ( d . held_object , node , explicit = False )
build . DependencyOverride ( d . held_object , node , explicit = False )
return d
return d
def dependency_impl ( self , name , display_name , kwargs ) :
def dependency_impl ( self , name , display_name , kwargs , force_fallback = False ) :
disabled , required , feature = extract_required_kwarg ( kwargs , self . subproject )
disabled , required , feature = extract_required_kwarg ( kwargs , self . subproject )
if disabled :
if disabled :
mlog . log ( ' Dependency ' , mlog . bold ( display_name ) , ' skipped: feature ' , mlog . bold ( feature ) , ' disabled ' )
mlog . log ( ' Dependency ' , mlog . bold ( display_name ) , ' skipped: feature ' , mlog . bold ( feature ) , ' disabled ' )
@ -3743,21 +3742,21 @@ external dependencies (including libraries) must go to "dependencies".''')
raise DependencyException ( m . format ( display_name ) )
raise DependencyException ( m . format ( display_name ) )
return DependencyHolder ( cached_dep , self . subproject )
return DependencyHolder ( cached_dep , self . subproject )
if fallback :
# If the dependency has already been configured, possibly by
# If the dependency has already been configured, possibly by
# a higher level project, try to use it first.
# a higher level project, try to use it first.
if fallback :
dirname , varname = self . get_subproject_infos ( fallback )
dirname , varname = self . get_subproject_infos ( fallback )
if self . get_subproject ( dirname ) :
if self . get_subproject ( dirname ) :
return self . get_subproject_dep ( name , display_name , dirname , varname , kwargs )
return self . get_subproject_dep ( name , display_name , dirname , varname , kwargs )
wrap_mode = self . coredata . get_builtin_option ( ' wrap_mode ' )
wrap_mode = self . coredata . get_builtin_option ( ' wrap_mode ' )
force_fallback_for = self . coredata . get_builtin_option ( ' force_fallback_for ' )
force_fallback_for = self . coredata . get_builtin_option ( ' force_fallback_for ' )
force_fallback = kwargs . get ( ' force_fallback ' , False )
force_fallback = ( force_fallback or
forcefallback = fallback and ( wrap_mode == WrapMode . forcefallback or \
wrap_mode == WrapMode . forcefallback or
name in force_fallback_for or \
name in force_fallback_for or
dirname in force_fallback_for or \
dirname in force_fallback_for )
force_fallback )
if name != ' ' and not forcefallback :
if name != ' ' and ( not fallback or not force_ fallback ) :
self . _handle_featurenew_dependencies ( name )
self . _handle_featurenew_dependencies ( name )
kwargs [ ' required ' ] = required and not fallback
kwargs [ ' required ' ] = required and not fallback
dep = dependencies . find_external_dependency ( name , self . environment , kwargs )
dep = dependencies . find_external_dependency ( name , self . environment , kwargs )