scripts: apply-patches: don't stop if no patch is found for a package
PATCH 1/1 scripts: apply-patches: don't stop if no patch is found for a package
If no patch is available for a specific package it doesn't mean that is necessarily an error, perhaps there is no need to apply any patches. Therefore, don't stop the build by returning '1', but go ahead.
--- support/scripts/apply-patches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
support/scripts/apply-patches.sh +1 -1
@@ -43,7 +43,7 @@ if [ ! -d "${builddir}" ] ; then fi if [ ! -d "${patchdir}" ] ; then echo "Aborting. '${patchdir}' is not a directory." - exit 1 + exit fi # Remove any rejects present BEFORE patching - Because if there are
Signature · 1 line
1.8.4.2
PATCH 1/1 scripts: apply-patches: don't stop if no patch is found for a package
Quoted 4 lines · Andi Shyti
If no patch is available for a specific package it doesn't mean that is necessarily an error, perhaps there is no need to apply any patches. Therefore, don't stop the build by returning '1', but go ahead.
This is in fact intentional, because it indicates that there is
something wrong with the configuration. When you specify in your configuration that some specific patch directory should be used, but that directory doesn't exist, then it probably means you made a mistake in your configuration.
Can you give an example of a specific situation where you had a problem
with this check?
Regards,
Arnout
Quoted 20 lines
Signed-off-by Andi Shyti <[email protected]>--- support/scripts/apply-patches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)support/scripts/apply-patches.sh +1
-1@@ -43,7 +43,7 @@ if [ ! -d "${builddir}" ] ; then fi if [ ! -d "${patchdir}" ] ; then echo "Aborting. '${patchdir}' is not a directory." - exit 1 + exit fi # Remove any rejects present BEFORE patching - Because if there are
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 scripts: apply-patches: don't stop if no patch is found for a package
Hi Arnout,
Quoted 5 lines
Quoted 4 lines
If no patch is available for a specific package it doesn't mean that is necessarily an error, perhaps there is no need to apply any patches. Therefore, don't stop the build by returning '1', but go ahead.
Quoted 8 lines
This is in fact intentional, because it indicates that there is
something wrong with the configuration. When you specify in your configuration that some specific patch directory should be used, but that directory doesn't exist, then it probably means you made a mistake in your configuration.Can you give an example of a specific situation where you had a
problem with this check?
this happens when for example you want to get as cross compiler the daily snapshot instead of a specific version.
The build stops with an error because of that 'exit 1' since it doesn't find any gcc-20131105 patch directory (i think the snapshot is called so).
Andi
PATCH 1/1 scripts: apply-patches: don't stop if no patch is found for a package
Quoted 16 lines · Andi Shyti
Hi Arnout,
Quoted 5 lines
Quoted 4 lines
If no patch is available for a specific package it doesn't mean that is necessarily an error, perhaps there is no need to apply any patches. Therefore, don't stop the build by returning '1', but go ahead.
Quoted 8 lines
This is in fact intentional, because it indicates that there is
something wrong with the configuration. When you specify in your configuration that some specific patch directory should be used, but that directory doesn't exist, then it probably means you made a mistake in your configuration.Can you give an example of a specific situation where you had a
problem with this check?
Quoted 6 lines
this happens when for example you want to get as cross compiler the daily snapshot instead of a specific version.
The build stops with an error because of that 'exit 1' since it doesn't find any gcc-20131105 patch directory (i think the snapshot is called so).
That's a bug in the gcc package then :-)
It should actually be converted to using the default patch strategy
instead of post-patch hooks. Let me look into it...
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 scripts: apply-patches: don't stop if no patch is found for a package
Dear Arnout Vandecappelle,
Quoted 4 lines · Arnout Vandecappelle
That's a bug in the gcc package then :-)
It should actually be converted to using the default patch strategy
instead of post-patch hooks. Let me look into it...
Good luck. The gcc package is special: there is only one location for the gcc patches (i.e package/gcc/<version>/), but there are in fact three gcc packages (package/gcc/gcc-{initial,intermediate,final}).
I'm impatient to see what your solution will be :-)
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 gcc: use generic infrastructure for patches
In reply to Arnout VandecappelleThis solves the patch error for gcc snapshots.
Also sneak in an extra condition when applying the powerpc softfloat patch, so that the error is really fixed.
---
The powerpc patch could be converted to link-with-math-lib.patch.powerpc, but since we're deprecating the *.patch.$(ARCH) pattern I choose to keep this special treatment.
I didn't want to bother with splitting this patch for the powerpc stuff.
--- package/gcc/gcc-final/4.2.2-avr32-2.1.5 | 1 + package/gcc/gcc-final/4.3.6 | 1 + package/gcc/gcc-final/4.4.7 | 1 + package/gcc/gcc-final/4.5.4 | 1 + package/gcc/gcc-final/4.6.4 | 1 + package/gcc/gcc-final/4.7.3 | 1 + package/gcc/gcc-final/4.8-arc | 1 + package/gcc/gcc-final/4.8.2 | 1 + package/gcc/gcc-final/gcc-final.mk | 2 +- package/gcc/gcc-initial/4.2.2-avr32-2.1.5 | 1 + package/gcc/gcc-initial/4.3.6 | 1 + package/gcc/gcc-initial/4.4.7 | 1 + package/gcc/gcc-initial/4.5.4 | 1 + package/gcc/gcc-initial/4.6.4 | 1 + package/gcc/gcc-initial/4.7.3 | 1 + package/gcc/gcc-initial/4.8-arc | 1 + package/gcc/gcc-initial/4.8.2 | 1 + package/gcc/gcc-initial/gcc-initial.mk | 2 +- package/gcc/gcc-intermediate/4.2.2-avr32-2.1.5 | 1 + package/gcc/gcc-intermediate/4.3.6 | 1 + package/gcc/gcc-intermediate/4.4.7 | 1 + package/gcc/gcc-intermediate/4.5.4 | 1 + package/gcc/gcc-intermediate/4.6.4 | 1 + package/gcc/gcc-intermediate/4.7.3 | 1 + package/gcc/gcc-intermediate/4.8-arc | 1 + package/gcc/gcc-intermediate/4.8.2 | 1 + package/gcc/gcc-intermediate/gcc-intermediate.mk | 2 +- package/gcc/gcc.mk | 9 +++------ 28 files changed, 30 insertions(+), 9 deletions(-) create mode 120000 package/gcc/gcc-final/4.2.2-avr32-2.1.5 create mode 120000 package/gcc/gcc-final/4.3.6 create mode 120000 package/gcc/gcc-final/4.4.7 create mode 120000 package/gcc/gcc-final/4.5.4 create mode 120000 package/gcc/gcc-final/4.6.4 create mode 120000 package/gcc/gcc-final/4.7.3 create mode 120000 package/gcc/gcc-final/4.8-arc create mode 120000 package/gcc/gcc-final/4.8.2 create mode 120000 package/gcc/gcc-initial/4.2.2-avr32-2.1.5 create mode 120000 package/gcc/gcc-initial/4.3.6 create mode 120000 package/gcc/gcc-initial/4.4.7 create mode 120000 package/gcc/gcc-initial/4.5.4 create mode 120000 package/gcc/gcc-initial/4.6.4 create mode 120000 package/gcc/gcc-initial/4.7.3 create mode 120000 package/gcc/gcc-initial/4.8-arc create mode 120000 package/gcc/gcc-initial/4.8.2 create mode 120000 package/gcc/gcc-intermediate/4.2.2-avr32-2.1.5 create mode 120000 package/gcc/gcc-intermediate/4.3.6 create mode 120000 package/gcc/gcc-intermediate/4.4.7 create mode 120000 package/gcc/gcc-intermediate/4.5.4 create mode 120000 package/gcc/gcc-intermediate/4.6.4 create mode 120000 package/gcc/gcc-intermediate/4.7.3 create mode 120000 package/gcc/gcc-intermediate/4.8-arc create mode 120000 package/gcc/gcc-intermediate/4.8.2
package/gcc/gcc-final/4.2.2-avr32-2.1.5 new file +1 -0
@@ -0,0 +1 @@ +../4.2.2-avr32-2.1.5
package/gcc/gcc-final/4.3.6 new file +1 -0
@@ -0,0 +1 @@ +../4.3.6
package/gcc/gcc-final/4.4.7 new file +1 -0
@@ -0,0 +1 @@ +../4.4.7
package/gcc/gcc-final/4.5.4 new file +1 -0
@@ -0,0 +1 @@ +../4.5.4
package/gcc/gcc-final/4.6.4 new file +1 -0
@@ -0,0 +1 @@ +../4.6.4
package/gcc/gcc-final/4.7.3 new file +1 -0
@@ -0,0 +1 @@ +../4.7.3
package/gcc/gcc-final/4.8-arc new file +1 -0
@@ -0,0 +1 @@ +../4.8-arc
package/gcc/gcc-final/4.8.2 new file +1 -0
@@ -0,0 +1 @@ +../4.8.2
package/gcc/gcc-final/gcc-final.mk +1 -1
@@ -18,7 +18,7 @@ ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),) HOST_GCC_FINAL_POST_EXTRACT_CMDS += HOST_GCC_FINAL_XTENSA_OVERLAY_EXTRACT endif -HOST_GCC_FINAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES +HOST_GCC_FINAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_POWERPC_PATCH # gcc doesn't support in-tree build, so we create a 'build' # subdirectory in the gcc sources, and build from there.
package/gcc/gcc-initial/4.2.2-avr32-2.1.5 new file +1 -0
@@ -0,0 +1 @@ +../4.2.2-avr32-2.1.5
package/gcc/gcc-initial/4.3.6 new file +1 -0
@@ -0,0 +1 @@ +../4.3.6
package/gcc/gcc-initial/4.4.7 new file +1 -0
@@ -0,0 +1 @@ +../4.4.7
package/gcc/gcc-initial/4.5.4 new file +1 -0
@@ -0,0 +1 @@ +../4.5.4
package/gcc/gcc-initial/4.6.4 new file +1 -0
@@ -0,0 +1 @@ +../4.6.4
package/gcc/gcc-initial/4.7.3 new file +1 -0
@@ -0,0 +1 @@ +../4.7.3
package/gcc/gcc-initial/4.8-arc new file +1 -0
@@ -0,0 +1 @@ +../4.8-arc
package/gcc/gcc-initial/4.8.2 new file +1 -0
@@ -0,0 +1 @@ +../4.8.2
package/gcc/gcc-initial/gcc-initial.mk +1 -1
@@ -16,7 +16,7 @@ ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),) HOST_GCC_INITIAL_POST_EXTRACT_CMDS += HOST_GCC_XTENSA_OVERLAY_EXTRACT endif -HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES +HOST_GCC_INITIAL_POST_PATCH_HOOKS += HOST_GCC_APPLY_POWERPC_PATCH # gcc doesn't support in-tree build, so we create a 'build' # subdirectory in the gcc sources, and build from there.
package/gcc/gcc-intermediate/4.2.2-avr32-2.1.5 new file +1 -0
@@ -0,0 +1 @@ +../4.2.2-avr32-2.1.5
package/gcc/gcc-intermediate/4.3.6 new file +1 -0
@@ -0,0 +1 @@ +../4.3.6
package/gcc/gcc-intermediate/4.4.7 new file +1 -0
@@ -0,0 +1 @@ +../4.4.7
package/gcc/gcc-intermediate/4.5.4 new file +1 -0
@@ -0,0 +1 @@ +../4.5.4
package/gcc/gcc-intermediate/4.6.4 new file +1 -0
@@ -0,0 +1 @@ +../4.6.4
package/gcc/gcc-intermediate/4.7.3 new file +1 -0
@@ -0,0 +1 @@ +../4.7.3
package/gcc/gcc-intermediate/4.8-arc new file +1 -0
@@ -0,0 +1 @@ +../4.8-arc
package/gcc/gcc-intermediate/4.8.2 new file +1 -0
@@ -0,0 +1 @@ +../4.8.2
package/gcc/gcc-intermediate/gcc-intermediate.mk +1 -1
@@ -18,7 +18,7 @@ ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),) HOST_GCC_INTERMEDIATE_POST_EXTRACT_CMDS += HOST_GCC_XTENSA_OVERLAY_EXTRACT endif -HOST_GCC_INTERMEDIATE_POST_PATCH_HOOKS += HOST_GCC_APPLY_PATCHES +HOST_GCC_INTERMEDIATE_POST_PATCH_HOOKS += HOST_GCC_APPLY_POWERPC_PATCH # gcc doesn't support in-tree build, so we create a 'build' # subdirectory in the gcc sources, and build from there.
package/gcc/gcc.mk +3 -6
@@ -43,16 +43,13 @@ endef ifeq ($(ARCH),powerpc) ifneq ($(BR2_SOFT_FLOAT),) define HOST_GCC_APPLY_POWERPC_PATCH - support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional + if [ -e package/gcc/$(GCC_VERSION)/powerpc-link-with-math-lib.patch.conditional ]; then \ + support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional; \ + fi endef endif endif -define HOST_GCC_APPLY_PATCHES - support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) \*.patch - $(HOST_GCC_APPLY_POWERPC_PATCH) -endef - # # Custom extract command to save disk space #
Signature · 1 line
1.8.4.rc3
PATCH 1/1 gcc: use generic infrastructure for patches
Dear Arnout Vandecappelle (Essensium/Mind),
Quoted 8 lines · Arnout Vandecappelle (Essensium/Mind)
package/gcc/gcc-final/4.2.2-avr32-2.1.5 | 1 + package/gcc/gcc-final/4.3.6 | 1 + package/gcc/gcc-final/4.4.7 | 1 + package/gcc/gcc-final/4.5.4 | 1 + package/gcc/gcc-final/4.6.4 | 1 + package/gcc/gcc-final/4.7.3 | 1 + package/gcc/gcc-final/4.8-arc | 1 + package/gcc/gcc-final/4.8.2 | 1 +
The only problem that I see with this symbolic link based solution is that we will have to remember to add/update the three symbolic each time we do a gcc version bump. If we forget to do so, then the build will go on silently, but without having applied the patches.
I don't say this problem is a show-stopper, but it's a drawback of this symbolic link solution, IMO.
package/gcc/gcc.mk endef · line 48
Quoted 5 lines
define
HOST_GCC_APPLY_POWERPC_PATCHpackage/gcc/gcc.mk +3
-1- support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional + if [ -e package/gcc/$(GCC_VERSION)/powerpc-link-with-math-lib.patch.conditional ]; then \ + support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional; \ + fi
Why was adding the condition necessary?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 gcc: use generic infrastructure for patches
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Dear Arnout Vandecappelle (Essensium/Mind),
Quoted 8 lines · Arnout Vandecappelle (Essensium/Mind)
package/gcc/gcc-final/4.2.2-avr32-2.1.5 | 1 + package/gcc/gcc-final/4.3.6 | 1 + package/gcc/gcc-final/4.4.7 | 1 + package/gcc/gcc-final/4.5.4 | 1 + package/gcc/gcc-final/4.6.4 | 1 + package/gcc/gcc-final/4.7.3 | 1 + package/gcc/gcc-final/4.8-arc | 1 + package/gcc/gcc-final/4.8.2 | 1 +
Quoted 7 lines
The only problem that I see with this symbolic link based solution is that we will have to remember to add/update the three symbolic each time we do a gcc version bump. If we forget to do so, then the build will go on silently, but without having applied the patches.
I don't say this problem is a show-stopper, but it's a drawback of this symbolic link solution, IMO.
That was the exact same thought I had. Perhaps it is the best we can come up with, but it isn't really nice.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 gcc: use generic infrastructure for patches
In reply to Thomas PetazzoniQuoted 14 lines · Thomas Petazzoni
Dear Arnout Vandecappelle (Essensium/Mind),
Quoted 8 lines · Arnout Vandecappelle (Essensium/Mind)
package/gcc/gcc-final/4.2.2-avr32-2.1.5 | 1 + package/gcc/gcc-final/4.3.6 | 1 + package/gcc/gcc-final/4.4.7 | 1 + package/gcc/gcc-final/4.5.4 | 1 + package/gcc/gcc-final/4.6.4 | 1 + package/gcc/gcc-final/4.7.3 | 1 + package/gcc/gcc-final/4.8-arc | 1 + package/gcc/gcc-final/4.8.2 | 1 +
Quoted 7 lines
The only problem that I see with this symbolic link based solution is that we will have to remember to add/update the three symbolic each time we do a gcc version bump. If we forget to do so, then the build will go on silently, but without having applied the patches.
I don't say this problem is a show-stopper, but it's a drawback of this symbolic link solution, IMO.
I'm hoping that the separate source/build directories will be merged
soon, so that this won't be necessary anymore :-)
Quoted 8 lines
package/gcc/gcc.mk endef · line 48
Quoted 6 lines
define
HOST_GCC_APPLY_POWERPC_PATCHpackage/gcc/gcc.mk +3
-1- support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional + if [ -e package/gcc/$(GCC_VERSION)/powerpc-link-with-math-lib.patch.conditional ]; then \ + support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional; \ + fiWhy was adding the condition necessary?
Read the rest of the thread: otherwise, apply-patches.sh will error out
because package/gcc/some-snapshot-directory doesn't exist.
Granted, I could have tested for the directory instead of the patch
existence.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 gcc: use generic infrastructure for patches
Quoted 20 lines · Arnout Vandecappelle
Quoted 19 lines · Thomas Petazzoni
Dear Arnout Vandecappelle (Essensium/Mind),
Quoted 8 lines · Arnout Vandecappelle (Essensium/Mind)
package/gcc/gcc-final/4.2.2-avr32-2.1.5 | 1 + package/gcc/gcc-final/4.3.6 | 1 + package/gcc/gcc-final/4.4.7 | 1 + package/gcc/gcc-final/4.5.4 | 1 + package/gcc/gcc-final/4.6.4 | 1 + package/gcc/gcc-final/4.7.3 | 1 + package/gcc/gcc-final/4.8-arc | 1 + package/gcc/gcc-final/4.8.2 | 1 +The only problem that I see with this symbolic link based solution is that we will have to remember to add/update the three symbolic each time we do a gcc version bump. If we forget to do so, then the build will go on silently, but without having applied the patches.
Quoted 5 lines
Quoted 2 lines
I don't say this problem is a show-stopper, but it's a drawback of this symbolic link solution, IMO.
I'm hoping that the separate source/build directories will be merged
soon, so that this won't be necessary anymore :-)
Let me clarify that:
Once the separate source/build directories exist, I would like to
introduce infrastructure to build several packages from the same source. So gcc would be extracted and patched only once, and built several times. Same for kernel-headers vs. linux, or uboot vs. uboot-tools. That will really make me happy :-)
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 gcc: use generic infrastructure for patches
In reply to Arnout Vandecappelle (Essensium/Mind)Quoted 6 lines
This solves the patch error for gcc snapshots.
Also sneak in an extra condition when applying the powerpc softfloat patch, so that the error is really fixed.
works fine, just tested it.
If this is going to be applied, please feel free to add:
PATCH 1/1 scripts: apply-patches: don't stop if no patch is found for a package
In reply to Arnout VandecappelleQuoted 11 lines
Quoted 6 lines
this happens when for example you want to get as cross compiler the daily snapshot instead of a specific version.
The build stops with an error because of that 'exit 1' since it doesn't find any gcc-20131105 patch directory (i think the snapshot is called so).
That's a bug in the gcc package then :-)
It should actually be converted to using the default patch strategy
instead of post-patch hooks. Let me look into it...
Thanks for looking into it, please add me in CC when you come to a solution.
Anyway one solution could be to check whether the gcc chosen is a snapshot or not, something similar:
(quoted diff) +0 -0
b/support/scripts/apply-patches.sh
index ff72b45..12f384c 100755
support/scripts/apply-patches.sh +5 -0
@@ -42,6 +42,11 @@ if [ ! -d "${builddir}" ] ; then exit 1 fi if [ ! -d "${patchdir}" ] ; then + if grep -q BR2_GCC_VERSION_SNAP=y .config; then + echo "Warning: no patch can be applied to the daily snapshot." + exit + fi + echo "Aborting. '${patchdir}' is not a directory." exit 1 fi
looks like a hack, but it's the fastest thing that comes to my mind :)
Andi