Skip to content

Commit

Permalink
Prefer ARCH specific prebuilt APKs
Browse files Browse the repository at this point in the history
The prebuilt APKs in the ARCH folder (e.g. arm64) should be preferred
over the prebuilt APKs in the all folder.
  • Loading branch information
stefanhh0 authored and acr92 committed Feb 8, 2020
1 parent 85625c1 commit f8bd617
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions core/prebuilt_apk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,31 @@ ifneq ($(GAPPS_LOCAL_OVERRIDES_PACKAGES),)
endif
endif

LOCAL_SRC_FILES := $(call find-apk-for-pkg,all,$(LOCAL_PACKAGE_NAME))

LOCAL_SRC_FILES := $(call find-apk-for-pkg,$(TARGET_ARCH),$(LOCAL_PACKAGE_NAME))
ifdef LOCAL_SRC_FILES
LOCAL_PREBUILT_JNI_LIBS := $(call find-libs-in-apk,$(TARGET_ARCH),$(LOCAL_SRC_FILES))
else
LOCAL_SRC_FILES := $(call find-apk-for-pkg,$(TARGET_ARCH),$(LOCAL_PACKAGE_NAME))
ifdef LOCAL_SRC_FILES
ifeq ($(filter 21,$(call get-allowed-api-levels)),)
# only kitkat
ifneq ($(call find-libs-in-apk,$(TARGET_ARCH),$(LOCAL_SRC_FILES)),)
LOCAL_SHARED_LIBRARIES := $(notdir $(basename $(shell zipinfo -1 "$(LOCAL_SRC_FILES)" "$(call get-lib-search-path, $(TARGET_ARCH))" -x lib/*/crazy/* 2>/dev/null)))
endif
else
LOCAL_PREBUILT_JNI_LIBS_$(TARGET_ARCH) := $(call find-libs-in-apk,$(TARGET_ARCH),$(LOCAL_SRC_FILES))
ifeq ($(filter 21,$(call get-allowed-api-levels)),)
# only kitkat
ifneq ($(call find-libs-in-apk,$(TARGET_ARCH),$(LOCAL_SRC_FILES)),)
LOCAL_SHARED_LIBRARIES := $(notdir $(basename $(shell zipinfo -1 "$(LOCAL_SRC_FILES)" "$(call get-lib-search-path, $(TARGET_ARCH))" -x lib/*/crazy/* 2>/dev/null)))
endif
else
ifdef TARGET_2ND_ARCH
LOCAL_SRC_FILES := $(call find-apk-for-pkg,$(TARGET_2ND_ARCH),$(LOCAL_PACKAGE_NAME))
ifdef LOCAL_SRC_FILES
LOCAL_MODULE_TARGET_ARCH := $(TARGET_2ND_ARCH)
LOCAL_PREBUILT_JNI_LIBS_$(TARGET_2ND_ARCH) := $(call find-libs-in-apk,$(TARGET_2ND_ARCH),$(LOCAL_SRC_FILES))
endif
LOCAL_PREBUILT_JNI_LIBS_$(TARGET_ARCH) := $(call find-libs-in-apk,$(TARGET_ARCH),$(LOCAL_SRC_FILES))
endif
else
ifdef TARGET_2ND_ARCH
LOCAL_SRC_FILES := $(call find-apk-for-pkg,$(TARGET_2ND_ARCH),$(LOCAL_PACKAGE_NAME))
ifdef LOCAL_SRC_FILES
LOCAL_MODULE_TARGET_ARCH := $(TARGET_2ND_ARCH)
LOCAL_PREBUILT_JNI_LIBS_$(TARGET_2ND_ARCH) := $(call find-libs-in-apk,$(TARGET_2ND_ARCH),$(LOCAL_SRC_FILES))
endif
endif
endif

ifndef LOCAL_SRC_FILES
LOCAL_SRC_FILES := $(call find-apk-for-pkg,all,$(LOCAL_PACKAGE_NAME))
LOCAL_PREBUILT_JNI_LIBS := $(call find-libs-in-apk,$(TARGET_ARCH),$(LOCAL_SRC_FILES))
endif

ifndef LOCAL_SRC_FILES
# the three calls to find-apk-for-pkg above all failed.
# emit an error if the module is in the set GAPPS_PRODUCT_PACKAGES - GAPPS_EXCLUDED_PACKAGES
Expand Down

5 comments on commit f8bd617

@greyltc
Copy link

@greyltc greyltc commented on f8bd617 Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, can you please test this commit with x86 and x86_64 arches? I'm pretty sure it breaks those.

Maybe it's having trouble falling back to all? I'm not really sure. @stefanhh0

@stefanhh0
Copy link
Contributor Author

@stefanhh0 stefanhh0 commented on f8bd617 Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @greyltc,

please open an issue with your findings and include as much information as you have available. I will then try to reproduce it on x86 and x86_64

Can you elaborate a little why it is breaking x86 and x86_64 i.e. adding some log output?

  • If you revert that commit then it is now longer failing?
  • But when not reverting it, it is failing?
  • It would be important to have the full output of those two cases to compare the outputs.
  • What is the configuration you are running it, specifically what are the values of: $(TARGET_ARCH), $(TARGET_2ND_ARCH) and $(PLATFORM_SDK_VERSION)?
  • Do you have an idea where exactly the problem is in the make file or do you even have a fix proposal? Just let me know please.

Thanks & best regards,
Stefan

@greyltc
Copy link

@greyltc greyltc commented on f8bd617 Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Stefan. Thanks for the thorough reply! I am getting build failures for my x86_64 builds (the error actually is that on version 28, ActionsServices is not available for x86_64). After looking into it more closely, that doesn't seem to be related to this commit as I had thought previously. I'm doing some debugging/trials now to try to better understand where the problem actually comes from. I'll follow up when I understand things more to be able to provide a bit more clarity and post an issue if it warrants one.

@MarijnS95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be caused by packages like TrichromeLibrary that are mandatory for Chrome/WebViewChrome but currently only provided for arm64 (with no all fallback) in gapps repos, similar to the issue for arm reported last week.

Indeed, providing the exact build failure will help us pin-point the issue and resolve it in an appropriate manner.

@greyltc
Copy link

@greyltc greyltc commented on f8bd617 Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanhh0 as promised, here is a concise issue report on the problem #255 So not related to this commit!

Please sign in to comment.