Skip to content

Add debug loggings for identifying a matching dist #2751

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

Merged
merged 2 commits into from
Feb 17, 2023
Merged
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
16 changes: 15 additions & 1 deletion pythonforandroid/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import glob
import json

from pythonforandroid.logger import (info, info_notify, warning, Err_Style, Err_Fore)
from pythonforandroid.logger import (debug, info, info_notify, warning, Err_Style, Err_Fore)
from pythonforandroid.util import current_directory, BuildInterruptingException
from shutil import rmtree

Expand Down Expand Up @@ -91,6 +91,7 @@ def get_distribution(
'''

possible_dists = Distribution.get_distributions(ctx)
debug(f"All possible dists: {possible_dists}")

# Will hold dists that would be built in the same folder as an existing dist
folder_match_dist = None
Expand All @@ -100,6 +101,7 @@ def get_distribution(
possible_dists = [
d for d in possible_dists if
(d.name == name) and all(arch_name in d.archs for arch_name in archs)]
debug(f"Dist matching name and arch: {possible_dists}")

if possible_dists:
# There should only be one folder with a given dist name *and* arch.
Expand All @@ -115,13 +117,18 @@ def get_distribution(
if (
ndk_api is not None and dist.ndk_api != ndk_api
) or dist.ndk_api is None:
debug(
f"dist {dist} failed to match ndk_api, target api {ndk_api}, dist api {dist.ndk_api}"
)
continue
for recipe in recipes:
if recipe not in dist.recipes:
debug(f"dist {dist} missing recipe {recipe}")
break
else:
_possible_dists.append(dist)
possible_dists = _possible_dists
debug(f"Dist matching ndk_api and recipe: {possible_dists}")

if possible_dists:
info('Of the existing distributions, the following meet '
Expand All @@ -133,17 +140,24 @@ def get_distribution(
# If any dist has perfect recipes, arch and NDK API, return it
for dist in possible_dists:
if force_build:
debug("Skipping dist due to forced build")
continue
if ndk_api is not None and dist.ndk_api != ndk_api:
debug("Skipping dist due to ndk_api mismatch")
continue
if not all(arch_name in dist.archs for arch_name in archs):
debug("Skipping dist due to arch mismatch")
continue
if (set(dist.recipes) == set(recipes) or
(set(recipes).issubset(set(dist.recipes)) and
not require_perfect_match)):
info_notify('{} has compatible recipes, using this one'
.format(dist.name))
return dist
else:
debug(
f"Skipping dist due to recipes mismatch, expected {set(recipes)}, actual {set(dist.recipes)}"
)

# If there was a name match but we didn't already choose it,
# then the existing dist is incompatible with the requested
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy