2
2
import glob
3
3
import json
4
4
5
- from pythonforandroid .logger import (info , info_notify , warning , Err_Style , Err_Fore )
5
+ from pythonforandroid .logger import (debug , info , info_notify , warning , Err_Style , Err_Fore )
6
6
from pythonforandroid .util import current_directory , BuildInterruptingException
7
7
from shutil import rmtree
8
8
@@ -91,6 +91,7 @@ def get_distribution(
91
91
'''
92
92
93
93
possible_dists = Distribution .get_distributions (ctx )
94
+ debug (f"All possible dists: { possible_dists } " )
94
95
95
96
# Will hold dists that would be built in the same folder as an existing dist
96
97
folder_match_dist = None
@@ -100,6 +101,7 @@ def get_distribution(
100
101
possible_dists = [
101
102
d for d in possible_dists if
102
103
(d .name == name ) and all (arch_name in d .archs for arch_name in archs )]
104
+ debug (f"Dist matching name and arch: { possible_dists } " )
103
105
104
106
if possible_dists :
105
107
# There should only be one folder with a given dist name *and* arch.
@@ -115,13 +117,18 @@ def get_distribution(
115
117
if (
116
118
ndk_api is not None and dist .ndk_api != ndk_api
117
119
) or dist .ndk_api is None :
120
+ debug (
121
+ f"dist { dist } failed to match ndk_api, target api { ndk_api } , dist api { dist .ndk_api } "
122
+ )
118
123
continue
119
124
for recipe in recipes :
120
125
if recipe not in dist .recipes :
126
+ debug (f"dist { dist } missing recipe { recipe } " )
121
127
break
122
128
else :
123
129
_possible_dists .append (dist )
124
130
possible_dists = _possible_dists
131
+ debug (f"Dist matching ndk_api and recipe: { possible_dists } " )
125
132
126
133
if possible_dists :
127
134
info ('Of the existing distributions, the following meet '
@@ -133,17 +140,24 @@ def get_distribution(
133
140
# If any dist has perfect recipes, arch and NDK API, return it
134
141
for dist in possible_dists :
135
142
if force_build :
143
+ debug ("Skipping dist due to forced build" )
136
144
continue
137
145
if ndk_api is not None and dist .ndk_api != ndk_api :
146
+ debug ("Skipping dist due to ndk_api mismatch" )
138
147
continue
139
148
if not all (arch_name in dist .archs for arch_name in archs ):
149
+ debug ("Skipping dist due to arch mismatch" )
140
150
continue
141
151
if (set (dist .recipes ) == set (recipes ) or
142
152
(set (recipes ).issubset (set (dist .recipes )) and
143
153
not require_perfect_match )):
144
154
info_notify ('{} has compatible recipes, using this one'
145
155
.format (dist .name ))
146
156
return dist
157
+ else :
158
+ debug (
159
+ f"Skipping dist due to recipes mismatch, expected { set (recipes )} , actual { set (dist .recipes )} "
160
+ )
147
161
148
162
# If there was a name match but we didn't already choose it,
149
163
# then the existing dist is incompatible with the requested
0 commit comments