The same definition would be a problem in Android.mk too -- in fact, this
warning is coming from the makefile system (since the makefile system still
handles installation for both Make and Soong).

It looks like inside Google, we're not defining `prebuilt_etc` or
`BUILD_PREBUILT` definitions for this file, instead we're installing it via
PRODUCT_COPY_FILES in your product configuration. That way every product
can choose how to install that file.

Or you could "hide" one of the modules from Make using soong namespaces,
only turning on the one that you want for a particular device. Then make
will only create a single installation rule. (I haven't tried it, but it
should work -- this is how we handle more complicated modules that need to
be different per device)

- Dan

On Wed, Oct 9, 2019 at 3:58 PM 'Kyle Cai' via Android Building <
android-building@googlegroups.com> wrote:

> Thanks Dan for the reply. Yes I do see the warning msgs you pointed out.
>
> Now the question is how should I fix this given that the destination file
> has to be google.xml? I believe previously with .mk files this was not an
> issue?
>
> Thanks in advance.
>
> Kyle
>
> On Wednesday, October 9, 2019 at 1:24:32 PM UTC-7, Dan Willemsen wrote:
>>
>> Modules must have unique output names, as the installation rules are
>> always defined. You should be seeing warnings during the build startup
>> about duplicate rules for target:
>>
>> build/make/core/base_rules.mk:481: warning: overriding commands for
>> target `out/target/product/<device>/product/etc/sysconfig/google.xml'
>> build/make/core/base_rules.mk:481: warning: ignoring old commands for
>> target `out/target/product/<device>/product/etc/sysconfig/google.xml'
>>
>> That's saying that there are two ways to build a specific installation
>> file, and we may pick one or the other (fairly arbitrarily, and sometimes
>> using a mix of the two rules).
>>
>> - Dan
>>
>> On Wed, Oct 9, 2019 at 1:09 PM 'Kyle Cai' via Android Building <
>> android-...@googlegroups.com> wrote:
>>
>>> Hi,
>>>
>>> I'm not sure if this is the right place to ask about android.bp files.
>>> Here is an issue that I'm seeing and I can't figure out why I'm seeing
>>> this. My .bp file has the following two sections, one for regular android
>>> build and one for android go:
>>>
>>> prebuilt_etc {
>>>     name: "*sysconfig_google*",
>>>     product_specific: true,
>>>     sub_dir: "sysconfig",
>>>     *src: "google.xml",*
>>>     *filename_from_src: true,*
>>> }
>>>
>>> prebuilt_etc {
>>>     name: "*sysconfig_google_go*",
>>>     product_specific: true,
>>>     sub_dir: "sysconfig",
>>>     *src: "google_go.xml",*
>>>     *filename: "google.xml",*
>>> }
>>>
>>> The intention is that if I'm making a regular build, a gms.mk file is
>>> used and it calls sysconfig_google. If I'm making a Go build, the
>>> gms_go.mk file is used, and that calls  sysconfig_google_go. In the
>>> source directory there is "google.xml" and "google_go.xml" and depending on
>>> which is called, it should go to the destination directory as "google.xml".
>>> However, currently when I build a regular build (non-Go), I see in the
>>> destination directory that the google.xml file has the content of the
>>> google_go.xml file. Any idea why it's doing that?
>>>
>>> Thanks,
>>>
>>> Kyle
>>>
>>> --
>>> --
>>> 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/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com
>>> <https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> --
> 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/4499c9d7-c210-4f99-8dd6-dc7c4acb3888%40googlegroups.com
> <https://groups.google.com/d/msgid/android-building/4499c9d7-c210-4f99-8dd6-dc7c4acb3888%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
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/CALQgHdk4rx5369jtidnzPeu2RX5dOsnnSncYANZJuQSvdzTdyQ%40mail.gmail.com.

Reply via email to