Re: [android-building] Android.bp can't link java static library built from Android,mk

2019-09-20 Thread Jack Rong
Thanks a lot Dan for your reply.  Here is my question to Google, why you 
break the backward compatibility like that. Would it be much better to let 
the "Android.bp" recognize the library or entity exported from Android.mk. 
There are hundreds of Android,mk files still exist in AOSP source tree in 
Android 10.

On Friday, September 20, 2019 at 3:42:30 PM UTC-4, Dan Willemsen wrote:
>
> All dependencies of an Android.bp file must be in Android.bp, not 
> Android.mk. So you'll need to convert your libmine description to an 
> Android.bp file.
>
> - Dan
>
> On Wed, Sep 18, 2019 at 1:51 PM Jack Rong > 
> wrote:
>
>> I have a scenario that is to link in a Java static library built from an 
>> Android.mk file to complete the whole AOSP image build in Android P. The 
>> build system somehow is not versatile enough to discover the static library 
>> built from other project using the Android.mk. Here is an example:
>>
>>  1) Android.mk file at the "package/app/MyLibs"
>>
>> LOCAL_PATH := $(call my-dir)
>>
>> include $(CLEAR_VARS)
>>
>> LOCAL_MODULE := libmine
>>
>> LOCAL_SRC_FILES := \
>> $(call all-java-files-under, src/main/java) \
>> $(call all-Iaidl-files-under, src/main/aidl)
>>
>> ifneq ($(filter 28,$(PLATFORM_SDK_VERSION)),)
>> LOCAL_PRIVATE_PLATFORM_APIS := true
>> else
>> LOCAL_SDK_VERSION := current
>> endif
>>
>> LOCAL_STATIC_JAVA_LIBRARIES := libgson
>>
>> LOCAL_PROGUARD_FLAG_FILES := proguard.flags
>>
>> include $(BUILD_STATIC_JAVA_LIBRARY)
>>
>>
>> 2) Android.bp at "frameworks/base/services/devicepolicy"
>>
>> java_library_static {
>> name: "services.devicepolicy",
>> srcs: ["java/**/*.java"],
>>
>> libs: [
>> "conscrypt",
>> "services.core",
>> ],
>> static_libs: [
>> "libmine",
>> ],
>> }
>>
>> 3) Build message:
>>
>> error: frameworks/base/services/devicepolicy/Android.bp:1:1: 
>> "services.devicepolicy" depends on undefined module "libmine"
>>
>>
>> -- 
>> -- 
>> You received this message because you are subscribed to the "Android 
>> Building" mailing list.
>> To post to this group, send email to android-...@googlegroups.com 
>> 
>> To unsubscribe from this group, send email to
>> android-...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/android-building?hl=en
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Android Building" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to android-...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/android-building/7b078f33-17a4-47c4-b202-7a29d08f0253%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/69cac53a-f873-43ea-bb2c-15c73526a5b3%40googlegroups.com.


Re: [android-building] Android.bp can't link java static library built from Android,mk

2019-09-20 Thread 'Dan Willemsen' via Android Building
All dependencies of an Android.bp file must be in Android.bp, not
Android.mk. So you'll need to convert your libmine description to an
Android.bp file.

- Dan

On Wed, Sep 18, 2019 at 1:51 PM Jack Rong  wrote:

> I have a scenario that is to link in a Java static library built from an
> Android.mk file to complete the whole AOSP image build in Android P. The
> build system somehow is not versatile enough to discover the static library
> built from other project using the Android.mk. Here is an example:
>
>  1) Android.mk file at the "package/app/MyLibs"
>
> LOCAL_PATH := $(call my-dir)
>
> include $(CLEAR_VARS)
>
> LOCAL_MODULE := libmine
>
> LOCAL_SRC_FILES := \
> $(call all-java-files-under, src/main/java) \
> $(call all-Iaidl-files-under, src/main/aidl)
>
> ifneq ($(filter 28,$(PLATFORM_SDK_VERSION)),)
> LOCAL_PRIVATE_PLATFORM_APIS := true
> else
> LOCAL_SDK_VERSION := current
> endif
>
> LOCAL_STATIC_JAVA_LIBRARIES := libgson
>
> LOCAL_PROGUARD_FLAG_FILES := proguard.flags
>
> include $(BUILD_STATIC_JAVA_LIBRARY)
>
>
> 2) Android.bp at "frameworks/base/services/devicepolicy"
>
> java_library_static {
> name: "services.devicepolicy",
> srcs: ["java/**/*.java"],
>
> libs: [
> "conscrypt",
> "services.core",
> ],
> static_libs: [
> "libmine",
> ],
> }
>
> 3) Build message:
>
> error: frameworks/base/services/devicepolicy/Android.bp:1:1:
> "services.devicepolicy" depends on undefined module "libmine"
>
>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-building/7b078f33-17a4-47c4-b202-7a29d08f0253%40googlegroups.com
> 
> .
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/CALQgHdn8EaRAX2hZwyt2OiZm1N9KM63s%2Bx_yPdvs6o9iBx6fsQ%40mail.gmail.com.


Re: [android-building] $shell commands in Android.mk -> Android.bp migration.

2019-09-20 Thread 'Dan Willemsen' via Android Building
You'll need to execute conan before running the android build. It's not
enforced yet, but the source tree is expected to be read-only during the
build -- in particularly we start caching the Android.bp files nearly
immediately upon build startup, so adding new ones isn't going to work.
Nothing from the Android.bp files are executed before we finish reading all
the Android.bp files.

- Dan

On Fri, Sep 20, 2019 at 1:51 PM 'NIRAJ DESAI' via Android Building <
android-building@googlegroups.com> wrote:

> I have a similar need
>
> I am trying to integrate the conan package management system.
>
> I have written a custom generator for conan that creates an Android.bp
> file with the appropriate targets that are downloaded via conan
>
> I need to run a script that will install these dependencies during build
> time.
>
> My file structure is:
>
> - vendor/mycompany/external/Android.bp
> - vendor/mycompany/external/conanInstallDependencies.sh
> - vendor/mycompany/conan/conanfile.txt
>
> I am able to run the script using $(shell) via Android.mk but I am not
> sure how to integrate Android.mk and the Android.bp that uses the conan
> deps  to ensure the build order is satisfied
>
> It works with Android.mk, but I have to run the build twice.
> - First build iteration will download the dependencies via Conan and place
> them in the proper folder location but the build will fail because the
> Android.bp that is generated by Conan is not executed
> - Second build iteration will find the existing Android.bp that was
> generated by Conan and the build will succeed
>
>
> I essentially want to create a target that is called
> "conanInstallDependencies"
> This target would  be simple, it will only invoke the
> "conanInstallDependencies.sh" script
>
> I would want the Conan-generated Android.bp to "link" or "be dependent" on
> the "conanInstallDependencies" target so that this Android.bp is always
> built after the "conanInstallDependencies" Android.bp
>
>
>
>
>
> On Thursday, August 22, 2019 at 11:18:41 AM UTC-7, Dan Willemsen wrote:
>>
>> What is your pre-build-script.sh script doing? Right now, since it has no
>> dependencies and no output files, you're essentially running it on every
>> build, even when the user is only trying to compile a single file in a
>> different section of the tree. That's deprecated since it has a huge
>> performance impact.
>>
>> Generally, if this is something that takes inputs and produces output
>> files, you may be able to use a genrule. But without knowing anything about
>> what this script is doing, I can't help much more than that.
>>
>> - Dan
>>
>>
>>
>> On Tue, Aug 20, 2019 at 2:40 PM Frederic Plourde 
>> wrote:
>>
>>> Hi android building !
>>>
>>>
>>>   I used to have this in one of my Android.mk makefiles :
>>>
>>> $(shell (cd $(LOCAL_PATH)/../../ && ./pre-build-script.sh))
>>>
>>>
>>> but I just noticed that this practice is now discouraged on the Soong
>>> Android.bp build system
>>>
>>> From the Build System Best Practices
>>> 
>>> document,  I could read :
>>>
>>> Don't use $(shell) to write files, create symlinks, etc. We expect to
>>> enforce this in the future. Encode these as build rules in the build graph
>>> instead. This can be problematic in a number of ways:
>>>
>>>
>>> Could you give me a concrete example of how I could run this
>>> "pre-build-script.sh" shell script before *every* build in my new
>>> Android.bp file ?
>>>
>>> thx :)
>>>
>>>
>>> *Frederic Plourde*
>>> Principal Engineer
>>> Collabora ltd.
>>>
>>> --
>>> --
>>> You received this message because you are subscribed to the "Android
>>> Building" mailing list.
>>> To post to this group, send email to android-...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-building?hl=en
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Building" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to android-...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/android-building/1131b0a7-0656-4813-9226-c233f3c2a05c%40googlegroups.com
>>> 
>>> .
>>>
>> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> 

[android-building] boot pixel 2(with hwasan) fail

2019-09-20 Thread 刘昊
hello,
I build AOSP as https://source.android.com/devices/tech/debug/hwasan 
required, patched kernel with 
https://lore.kernel.org/patchwork/project/lkml/list/?series=375855=both 
, build kernel, build AOSP with new kernel.
but after flush and reboot, pixel 2  stuck at show "Android" picture, aosp 
version is android_10_r1.

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/5d7484d7-061d-4889-afc1-521eb691b9ce%40googlegroups.com.