Android.bp file copy issue

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Android.bp file copy issue

Kyle Cai
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 [hidden email]
To unsubscribe from this group, send email to
[hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Android.bp file copy issue

Dan Willemsen-2
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 <[hidden email]> 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 [hidden email]
To unsubscribe from this group, send email to
[hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to
[hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CALQgHdk_kXp3TJZ_NnJELDUK0jwHm_1w4KQ2zQmAvdAc%2BpRyfg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Android.bp file copy issue

Kyle Cai
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/<a href="http://base_rules.mk:481" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbase_rules.mk%3A481\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFedawImtP2qOmJFYwO6QffmBHg7A&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbase_rules.mk%3A481\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFedawImtP2qOmJFYwO6QffmBHg7A&#39;;return true;">base_rules.mk:481: warning: overriding commands for target `out/target/product/<device>/product/etc/sysconfig/google.xml'
build/make/core/<a href="http://base_rules.mk:481" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbase_rules.mk%3A481\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFedawImtP2qOmJFYwO6QffmBHg7A&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbase_rules.mk%3A481\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFedawImtP2qOmJFYwO6QffmBHg7A&#39;;return true;">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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="fezF3lQgCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">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 <a href="http://gms.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgms.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGjeamUgfI5V31-E0ushvAeYvTHZA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgms.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGjeamUgfI5V31-E0ushvAeYvTHZA&#39;;return true;">gms.mk file is used and it calls sysconfig_google. If I'm making a Go build, the <a href="http://gms_go.mk" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgms_go.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHQZsY5bwjed9rcRhvvpxeqSCgyhg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgms_go.mk\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHQZsY5bwjed9rcRhvvpxeqSCgyhg&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="fezF3lQgCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android-...@googlegroups.com
To unsubscribe from this group, send email to
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="fezF3lQgCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android-...@googlegroups.com
For more options, visit this group at
<a href="http://groups.google.com/group/android-building?hl=en" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://groups.google.com/group/android-building?hl\x3den&#39;;return true;" onclick="this.href=&#39;http://groups.google.com/group/android-building?hl\x3den&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="fezF3lQgCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android-...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to
[hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/4499c9d7-c210-4f99-8dd6-dc7c4acb3888%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Android.bp file copy issue

Dan Willemsen-2
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 <[hidden email]> 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 <[hidden email]> 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 [hidden email]
To unsubscribe from this group, send email to
[hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/a37db4cd-f4b0-43bf-a507-964f552873f1%40googlegroups.com.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to
[hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/4499c9d7-c210-4f99-8dd6-dc7c4acb3888%40googlegroups.com.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to
[hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CALQgHdk4rx5369jtidnzPeu2RX5dOsnnSncYANZJuQSvdzTdyQ%40mail.gmail.com.