Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R

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

Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R

Sumit Kumar-2
hi all,
    i am trying to build android R but getting the following error in the kernel makefile
       kernel/exynos/AndroidKernel.mk:155: error: writing to readonly directory: "/data/home/sumkumar/work/workspace/R/out/../out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"
    this was handled in Android Q by using the flag "BUILD_BROKEN_PHONY_TARGETS=true" but in R this is depreciated hence cannot use the same.

   after looking at following link given for phony rules changes from google for android R 

  i have updated my Makefile as follows by removing the "../" in the erronous path and past the previous error ,
  #KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

 but now i am getting errors with phony-rebuild as mentioned below
  kernel/exynos/AndroidKernel.mk:139: error: real file "out/target/product/**/obj/KERNEL_OBJ/.config" depends on PHONY target "phony-rebuild"
14:21:04 ckati failed with: exit status 1
  
  
  
   i understood as phony targets are always dirty hence every file will be rebuild which depends on that phony, but in my case this rebuilding is required .
  Attaching a snap of the file depicting the same

KERNEL_CONFIG := $(KERNEL_OUT)/.config

KERNEL_CONFIG := $(KERNEL_OUT)/.config

 

.PHONY: phony-rebuild

 

 

$(KERNEL_CONFIG): phony-rebuild

      $(show) echo "make $(KERNEL_DEFCONFIG)"

      $(MAKE_CONFIG_CMD)

      $(info  MAKE_CONFIG_CMD is $(MAKE_CONFIG_CMD)) 

  Please let me know if there is any way to avoid using phony-rebuild and replace it with an alternate mechanism.

Regards,

--
--
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/786689cd-9816-454d-ba1f-bead4944ce3fo%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R

Dan Willemsen-2
but in my case this rebuilding is required .

I think this is where we're disconnected. Forcing rebuilds means that incremental builds will nearly never be as fast as they should be, as the entire tree starting from that phony would need to be rebuilt even if you weren't touching anything related to the kernel. Instead, we'd much prefer that the rule depended on what it uses, so it'll only be re-executed when necessary. That list of dependencies may end up being a significant portion of the kernel tree, but that's still better than every build.

This also gets more important as we improve per-action sandboxing to get better incremental builds and remote execution / cross-machine caching of build actions. We're not there yet, but that's the direction we'd like to be heading.

- Dan 

On Wed, Jul 29, 2020 at 9:08 AM Sumit Kumar <[hidden email]> wrote:
hi all,
    i am trying to build android R but getting the following error in the kernel makefile
       kernel/exynos/AndroidKernel.mk:155: error: writing to readonly directory: "/data/home/sumkumar/work/workspace/R/out/../out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"
    this was handled in Android Q by using the flag "BUILD_BROKEN_PHONY_TARGETS=true" but in R this is depreciated hence cannot use the same.

   after looking at following link given for phony rules changes from google for android R 

  i have updated my Makefile as follows by removing the "../" in the erronous path and past the previous error ,
  #KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

 but now i am getting errors with phony-rebuild as mentioned below
  kernel/exynos/AndroidKernel.mk:139: error: real file "out/target/product/**/obj/KERNEL_OBJ/.config" depends on PHONY target "phony-rebuild"
14:21:04 ckati failed with: exit status 1
  
  
  
   i understood as phony targets are always dirty hence every file will be rebuild which depends on that phony, but in my case this rebuilding is required .
  Attaching a snap of the file depicting the same

KERNEL_CONFIG := $(KERNEL_OUT)/.config

KERNEL_CONFIG := $(KERNEL_OUT)/.config

 

.PHONY: phony-rebuild

 

 

$(KERNEL_CONFIG): phony-rebuild

      $(show) echo "make $(KERNEL_DEFCONFIG)"

      $(MAKE_CONFIG_CMD)

      $(info  MAKE_CONFIG_CMD is $(MAKE_CONFIG_CMD)) 

  Please let me know if there is any way to avoid using phony-rebuild and replace it with an alternate mechanism.

Regards,

--
--
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/786689cd-9816-454d-ba1f-bead4944ce3fo%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/CALQgHdnNEArhZ-NoDSwrmmncaacN8WVFDeekUPYj%3DmUmk4rYiQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

رد: [android-building] Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R

احمد الطيب
II

تم الإرسال من هاتف Huawei الخاص بي


-------- الرسالة الأصلية --------
من:‏ 'Dan Willemsen' via Android Building <[hidden email]>
التاريخ:‏ الثلاثاء، ١١ آب، ٢٠٢٠ ١٢:٠٢ ص
إلى:‏ Android Building <[hidden email]>
الموضوع:‏ Re: [android-building] Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R
but in my case this rebuilding is required .

I think this is where we're disconnected. Forcing rebuilds means that incremental builds will nearly never be as fast as they should be, as the entire tree starting from that phony would need to be rebuilt even if you weren't touching anything related to the kernel. Instead, we'd much prefer that the rule depended on what it uses, so it'll only be re-executed when necessary. That list of dependencies may end up being a significant portion of the kernel tree, but that's still better than every build.

This also gets more important as we improve per-action sandboxing to get better incremental builds and remote execution / cross-machine caching of build actions. We're not there yet, but that's the direction we'd like to be heading.

- Dan 

On Wed, Jul 29, 2020 at 9:08 AM Sumit Kumar <[hidden email]> wrote:
hi all,
    i am trying to build android R but getting the following error in the kernel makefile
       kernel/exynos/AndroidKernel.mk:155: error: writing to readonly directory: "/data/home/sumkumar/work/workspace/R/out/../out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"
    this was handled in Android Q by using the flag "BUILD_BROKEN_PHONY_TARGETS=true" but in R this is depreciated hence cannot use the same.

   after looking at following link given for phony rules changes from google for android R 
  <a href="https://android.googlesource.com/platform/build/&#43;/master/Changes.md#phony_targets" style="font-family:&#39;calibri&#39; , sans-serif;font-size:11pt">https://android.googlesource.com/platform/build/+/master/Changes.md#phony_targets

  i have updated my Makefile as follows by removing the "../" in the erronous path and past the previous error ,
  #KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

 but now i am getting errors with phony-rebuild as mentioned below
  kernel/exynos/AndroidKernel.mk:139: error: real file "out/target/product/**/obj/KERNEL_OBJ/.config" depends on PHONY target "phony-rebuild"
14:21:04 ckati failed with: exit status 1
  
  
  
   i understood as phony targets are always dirty hence every file will be rebuild which depends on that phony, but in my case this rebuilding is required .
  Attaching a snap of the file depicting the same

KERNEL_CONFIG := $(KERNEL_OUT)/.config

KERNEL_CONFIG := $(KERNEL_OUT)/.config

 

.PHONY: phony-rebuild

 

 

$(KERNEL_CONFIG): phony-rebuild

      $(show) echo "make $(KERNEL_DEFCONFIG)"

      $(MAKE_CONFIG_CMD)

      $(info  MAKE_CONFIG_CMD is $(MAKE_CONFIG_CMD)) 

  Please let me know if there is any way to avoid using phony-rebuild and replace it with an alternate mechanism.

Regards,

--
--
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 <a href="https://groups.google.com/d/msgid/android-building/786689cd-9816-454d-ba1f-bead4944ce3fo%40googlegroups.com?utm_medium&#61;email&amp;utm_source&#61;footer">https://groups.google.com/d/msgid/android-building/786689cd-9816-454d-ba1f-bead4944ce3fo%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
android-building+[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 <a href="https://groups.google.com/d/msgid/android-building/CALQgHdnNEArhZ-NoDSwrmmncaacN8WVFDeekUPYj%3DmUmk4rYiQ%40mail.gmail.com?utm_medium&#61;email&amp;utm_source&#61;footer">https://groups.google.com/d/msgid/android-building/CALQgHdnNEArhZ-NoDSwrmmncaacN8WVFDeekUPYj%3DmUmk4rYiQ%40mail.gmail.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/-883cn8-1vykq6ynwm8i95rxk4xmpbri-rhn4ef-1ii4aevqlw6ed8f1yx1k26paqnok8shld1ooj41rtz3n2ylv8abdd7-6qyqok-xgsi7m-klsa27-dbria3-8o15v93g8sd6d3oaqa-8sbfvu-hk81sl.1597149584014%40email.android.com.
Reply | Threaded
Open this post in threaded view
|

Re: Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R

Sumit Kumar-2
HI Dan, 
    Thank for the insight , i was able to get through the phony-rebuild with an alternate mechanism "KERNEL_CONFIG: $(shell find -L $(KERNEL_SRCDIR)" and the build is passing successfully the only issue now i am getting is because of the previous change 

#KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

all the kernel intermidiates are generated in kernel source  folder as we have removed the realpath $(OUT_DIR) from the equation , generating kernel intermidiates in kernel_source dir is not acceptable, i have tried all diffrent methods of pointing to the real "out/target/product/**"  but with out success,  , 
further please help me with the following querry

      The target is a real file, but it's outside the output directories. All outputs from the build system should be within the output directory, otherwise m clean is unable to clean the build, and future builds may not work properly.
:- Does this mean the path to the target file should start with "out"  because i am not getting readonly error only when the path is specified as out/target/product/**  as mentoined by KERNE_OUT above , but any other real path "/data/home/sumkumar/work/workspace/R/out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"  is leading to error thrown ?

Please sugget any alternative for this so that the kernel intermidiates are actually generated in the real out/target/product/**/obj/KERNEL_OBJ directory .

Regards,
Sumit Kumar

On Tuesday, August 11, 2020 at 8:43:40 PM UTC+5:30 [hidden email] wrote:
II

تم الإرسال من هاتف Huawei الخاص بي


-------- الرسالة الأصلية --------
من:‏ 'Dan Willemsen' via Android Building <[hidden email]>
التاريخ:‏ الثلاثاء، ١١ آب، ٢٠٢٠ ١٢:٠٢ ص
إلى:‏ Android Building <[hidden email]>
الموضوع:‏ Re: [android-building] Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R
but in my case this rebuilding is required .

I think this is where we're disconnected. Forcing rebuilds means that incremental builds will nearly never be as fast as they should be, as the entire tree starting from that phony would need to be rebuilt even if you weren't touching anything related to the kernel. Instead, we'd much prefer that the rule depended on what it uses, so it'll only be re-executed when necessary. That list of dependencies may end up being a significant portion of the kernel tree, but that's still better than every build.

This also gets more important as we improve per-action sandboxing to get better incremental builds and remote execution / cross-machine caching of build actions. We're not there yet, but that's the direction we'd like to be heading.

- Dan 

On Wed, Jul 29, 2020 at 9:08 AM Sumit Kumar <[hidden email]> wrote:
hi all,
    i am trying to build android R but getting the following error in the kernel makefile
       kernel/exynos/AndroidKernel.mk:155: error: writing to readonly directory: "/data/home/sumkumar/work/workspace/R/out/../out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"
    this was handled in Android Q by using the flag "BUILD_BROKEN_PHONY_TARGETS=true" but in R this is depreciated hence cannot use the same.

   after looking at following link given for phony rules changes from google for android R 

  i have updated my Makefile as follows by removing the "../" in the erronous path and past the previous error ,
  #KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

 but now i am getting errors with phony-rebuild as mentioned below
  kernel/exynos/AndroidKernel.mk:139: error: real file "out/target/product/**/obj/KERNEL_OBJ/.config" depends on PHONY target "phony-rebuild"
14:21:04 ckati failed with: exit status 1
  
  
  
   i understood as phony targets are always dirty hence every file will be rebuild which depends on that phony, but in my case this rebuilding is required .
  Attaching a snap of the file depicting the same

KERNEL_CONFIG := $(KERNEL_OUT)/.config

KERNEL_CONFIG := $(KERNEL_OUT)/.config

 

.PHONY: phony-rebuild

 

 

$(KERNEL_CONFIG): phony-rebuild

      $(show) echo "make $(KERNEL_DEFCONFIG)"

      $(MAKE_CONFIG_CMD)

      $(info  MAKE_CONFIG_CMD is $(MAKE_CONFIG_CMD)) 

  Please let me know if there is any way to avoid using phony-rebuild and replace it with an alternate mechanism.

Regards,

--
--
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/786689cd-9816-454d-ba1f-bead4944ce3fo%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].

--
--
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/03948d45-7e96-4919-b311-5fe0e4abba7cn%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R

Dan Willemsen-2
So the problem here is likely because it's mixing absolute and relative paths. All makefile rules (inputs and outputs) should be using $(OUT_DIR) as is (which is usually "out", but can be an absolute path if the user has changed it). So this would be appropriate:

KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

But then the rule itself is likely expecting to use that path as an absolute path, since the kernel build system likely uses `cd` to change into a different path, where the relative path is no longer correct. The best solution is to expand it inside those rules, as it keeps absolute paths out of the ninja file (which can preserve the ability to diff between checkouts, and allows moving the source directory without requiring rebuilding everything). This doc section has an example, but it's essentially something like:

$(KERNEL_OUT)/arch/.../zImage: PRIVATE_SRCDIR := $(KERNEL_SRCDIR)
$(KERNEL_OUT)/arch/.../zImage: PRIVATE_OUT := $(KERNEL_OUT)
$(KERNEL_OUT)/arch/.../zImage: $(KERNEL_CONFIG) $(sort $(shell find -L $(KERNEL_SRCDIR) -type f))
    $(MAKE) -C $(PRIVATE_SRCDIR) O=$$(cd $(PRIVATE_OUT); pwd) ...


(If you can guarantee that nothing later in the build will change KERNEL_SRCDIR/KERNEL_OUT, then you wouldn't need to use the PRIVATE_* indirection, but it's generally a good idea to do so to prevent issues in the future)

- Dan

On Tue, Aug 11, 2020 at 12:06 PM Sumit Kumar <[hidden email]> wrote:
HI Dan, 
    Thank for the insight , i was able to get through the phony-rebuild with an alternate mechanism "KERNEL_CONFIG: $(shell find -L $(KERNEL_SRCDIR)" and the build is passing successfully the only issue now i am getting is because of the previous change 

#KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

all the kernel intermidiates are generated in kernel source  folder as we have removed the realpath $(OUT_DIR) from the equation , generating kernel intermidiates in kernel_source dir is not acceptable, i have tried all diffrent methods of pointing to the real "out/target/product/**"  but with out success,  , 
further please help me with the following querry

      The target is a real file, but it's outside the output directories. All outputs from the build system should be within the output directory, otherwise m clean is unable to clean the build, and future builds may not work properly.
:- Does this mean the path to the target file should start with "out"  because i am not getting readonly error only when the path is specified as out/target/product/**  as mentoined by KERNE_OUT above , but any other real path "/data/home/sumkumar/work/workspace/R/out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"  is leading to error thrown ?

Please sugget any alternative for this so that the kernel intermidiates are actually generated in the real out/target/product/**/obj/KERNEL_OBJ directory .

Regards,
Sumit Kumar

On Tuesday, August 11, 2020 at 8:43:40 PM UTC+5:30 [hidden email] wrote:
II

تم الإرسال من هاتف Huawei الخاص بي


-------- الرسالة الأصلية --------
من:‏ 'Dan Willemsen' via Android Building <[hidden email]>
التاريخ:‏ الثلاثاء، ١١ آب، ٢٠٢٠ ١٢:٠٢ ص
إلى:‏ Android Building <[hidden email]>
الموضوع:‏ Re: [android-building] Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R
but in my case this rebuilding is required .

I think this is where we're disconnected. Forcing rebuilds means that incremental builds will nearly never be as fast as they should be, as the entire tree starting from that phony would need to be rebuilt even if you weren't touching anything related to the kernel. Instead, we'd much prefer that the rule depended on what it uses, so it'll only be re-executed when necessary. That list of dependencies may end up being a significant portion of the kernel tree, but that's still better than every build.

This also gets more important as we improve per-action sandboxing to get better incremental builds and remote execution / cross-machine caching of build actions. We're not there yet, but that's the direction we'd like to be heading.

- Dan 

On Wed, Jul 29, 2020 at 9:08 AM Sumit Kumar <[hidden email]> wrote:
hi all,
    i am trying to build android R but getting the following error in the kernel makefile
       kernel/exynos/AndroidKernel.mk:155: error: writing to readonly directory: "/data/home/sumkumar/work/workspace/R/out/../out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"
    this was handled in Android Q by using the flag "BUILD_BROKEN_PHONY_TARGETS=true" but in R this is depreciated hence cannot use the same.

   after looking at following link given for phony rules changes from google for android R 

  i have updated my Makefile as follows by removing the "../" in the erronous path and past the previous error ,
  #KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

 but now i am getting errors with phony-rebuild as mentioned below
  kernel/exynos/AndroidKernel.mk:139: error: real file "out/target/product/**/obj/KERNEL_OBJ/.config" depends on PHONY target "phony-rebuild"
14:21:04 ckati failed with: exit status 1
  
  
  
   i understood as phony targets are always dirty hence every file will be rebuild which depends on that phony, but in my case this rebuilding is required .
  Attaching a snap of the file depicting the same

KERNEL_CONFIG := $(KERNEL_OUT)/.config

KERNEL_CONFIG := $(KERNEL_OUT)/.config

 

.PHONY: phony-rebuild

 

 

$(KERNEL_CONFIG): phony-rebuild

      $(show) echo "make $(KERNEL_DEFCONFIG)"

      $(MAKE_CONFIG_CMD)

      $(info  MAKE_CONFIG_CMD is $(MAKE_CONFIG_CMD)) 

  Please let me know if there is any way to avoid using phony-rebuild and replace it with an alternate mechanism.

Regards,

--
--
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/786689cd-9816-454d-ba1f-bead4944ce3fo%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].

--
--
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/03948d45-7e96-4919-b311-5fe0e4abba7cn%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/CALQgHdkAs_YoMRjTHHA9egQkyqNyk3D92GmL5WXf3yjJ9sDRPw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R

Sumit Kumar-2
Thanks Dan for the descriptive answer, this helped alot in solving the issue.

Regards,
Sumit Kumar 
On Wednesday, August 12, 2020 at 4:49:34 AM UTC+5:30 Dan Willemsen wrote:
So the problem here is likely because it's mixing absolute and relative paths. All makefile rules (inputs and outputs) should be using $(OUT_DIR) as is (which is usually "out", but can be an absolute path if the user has changed it). So this would be appropriate:

KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

But then the rule itself is likely expecting to use that path as an absolute path, since the kernel build system likely uses `cd` to change into a different path, where the relative path is no longer correct. The best solution is to expand it inside those rules, as it keeps absolute paths out of the ninja file (which can preserve the ability to diff between checkouts, and allows moving the source directory without requiring rebuilding everything). This doc section has an example, but it's essentially something like:

$(KERNEL_OUT)/arch/.../zImage: PRIVATE_SRCDIR := $(KERNEL_SRCDIR)
$(KERNEL_OUT)/arch/.../zImage: PRIVATE_OUT := $(KERNEL_OUT)
$(KERNEL_OUT)/arch/.../zImage: $(KERNEL_CONFIG) $(sort $(shell find -L $(KERNEL_SRCDIR) -type f))
    $(MAKE) -C $(PRIVATE_SRCDIR) O=$$(cd $(PRIVATE_OUT); pwd) ...


(If you can guarantee that nothing later in the build will change KERNEL_SRCDIR/KERNEL_OUT, then you wouldn't need to use the PRIVATE_* indirection, but it's generally a good idea to do so to prevent issues in the future)

- Dan

On Tue, Aug 11, 2020 at 12:06 PM Sumit Kumar <[hidden email]> wrote:
HI Dan, 
    Thank for the insight , i was able to get through the phony-rebuild with an alternate mechanism "KERNEL_CONFIG: $(shell find -L $(KERNEL_SRCDIR)" and the build is passing successfully the only issue now i am getting is because of the previous change 

#KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

all the kernel intermidiates are generated in kernel source  folder as we have removed the realpath $(OUT_DIR) from the equation , generating kernel intermidiates in kernel_source dir is not acceptable, i have tried all diffrent methods of pointing to the real "out/target/product/**"  but with out success,  , 
further please help me with the following querry

      The target is a real file, but it's outside the output directories. All outputs from the build system should be within the output directory, otherwise m clean is unable to clean the build, and future builds may not work properly.
:- Does this mean the path to the target file should start with "out"  because i am not getting readonly error only when the path is specified as out/target/product/**  as mentoined by KERNE_OUT above , but any other real path "/data/home/sumkumar/work/workspace/R/out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"  is leading to error thrown ?

Please sugget any alternative for this so that the kernel intermidiates are actually generated in the real out/target/product/**/obj/KERNEL_OBJ directory .

Regards,
Sumit Kumar

On Tuesday, August 11, 2020 at 8:43:40 PM UTC+5:30 [hidden email] wrote:
II

تم الإرسال من هاتف Huawei الخاص بي


-------- الرسالة الأصلية --------
من:‏ 'Dan Willemsen' via Android Building <[hidden email]>
التاريخ:‏ الثلاثاء، ١١ آب، ٢٠٢٠ ١٢:٠٢ ص
إلى:‏ Android Building <[hidden email]>
الموضوع:‏ Re: [android-building] Replacement for BUILD_BROKEN_PHONY and phony-rebuild in android R
but in my case this rebuilding is required .

I think this is where we're disconnected. Forcing rebuilds means that incremental builds will nearly never be as fast as they should be, as the entire tree starting from that phony would need to be rebuilt even if you weren't touching anything related to the kernel. Instead, we'd much prefer that the rule depended on what it uses, so it'll only be re-executed when necessary. That list of dependencies may end up being a significant portion of the kernel tree, but that's still better than every build.

This also gets more important as we improve per-action sandboxing to get better incremental builds and remote execution / cross-machine caching of build actions. We're not there yet, but that's the direction we'd like to be heading.

- Dan 

On Wed, Jul 29, 2020 at 9:08 AM Sumit Kumar <[hidden email]> wrote:
hi all,
    i am trying to build android R but getting the following error in the kernel makefile
       kernel/exynos/AndroidKernel.mk:155: error: writing to readonly directory: "/data/home/sumkumar/work/workspace/R/out/../out/target/product/**/obj/KERNEL_OBJ/arch/arm64/boot/Image"
    this was handled in Android Q by using the flag "BUILD_BROKEN_PHONY_TARGETS=true" but in R this is depreciated hence cannot use the same.

   after looking at following link given for phony rules changes from google for android R 

  i have updated my Makefile as follows by removing the "../" in the erronous path and past the previous error ,
  #KERNEL_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(realpath $(OUT_DIR))/../)$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_OUT ?= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ

 but now i am getting errors with phony-rebuild as mentioned below
  kernel/exynos/AndroidKernel.mk:139: error: real file "out/target/product/**/obj/KERNEL_OBJ/.config" depends on PHONY target "phony-rebuild"
14:21:04 ckati failed with: exit status 1
  
  
  
   i understood as phony targets are always dirty hence every file will be rebuild which depends on that phony, but in my case this rebuilding is required .
  Attaching a snap of the file depicting the same

KERNEL_CONFIG := $(KERNEL_OUT)/.config

KERNEL_CONFIG := $(KERNEL_OUT)/.config

 

.PHONY: phony-rebuild

 

 

$(KERNEL_CONFIG): phony-rebuild

      $(show) echo "make $(KERNEL_DEFCONFIG)"

      $(MAKE_CONFIG_CMD)

      $(info  MAKE_CONFIG_CMD is $(MAKE_CONFIG_CMD)) 

  Please let me know if there is any way to avoid using phony-rebuild and replace it with an alternate mechanism.

Regards,

--
--
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/786689cd-9816-454d-ba1f-bead4944ce3fo%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].

--
--
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].

--
--
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/4cda382b-55fb-4f82-81b2-cece91f41fc2n%40googlegroups.com.