Openembedded Devel Discussions
 help / color / mirror / Atom feed
* [meta-java][PATCH] java-library.bbclass: compatibility with per-recipe sysroots
@ 2017-07-12  8:36 S. Lockwood-Childs
  2017-07-21 10:53 ` Maxin B. John
  0 siblings, 1 reply; 2+ messages in thread
From: S. Lockwood-Childs @ 2017-07-12  8:36 UTC (permalink / raw)
  To: openembedded-devel

The removebinaries task was intended to remove pre-built .jar and .class files
from the unpacked source, but when per-recipe sysroots were implemented and
ended up under WORKDIR, .jar or .class in those sysroots inadvertently started 
getting killed as well.

For instance, ${WORKDIR}/recipe-sysroot-native/usr/share/java/ecj-bootstrap.jar
was deleted when attempting to build jlex-native... which made javac in
that sysroot rather unhappy.

Solve by excluding both recipe-sysroot and recipe-sysroot-native dirs
from the search-and-destroy operation.

Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
---
 classes/java-library.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass
index 58d5a40..ce1cd28 100644
--- a/classes/java-library.bbclass
+++ b/classes/java-library.bbclass
@@ -50,8 +50,10 @@ ALTJARFILENAMES = "${BPN}.jar"
 # Java "source" distributions often contain precompiled things
 # we want to delete first.
 do_removebinaries() {
-  find ${WORKDIR} -name "*.jar" -exec rm {} \;
-  find ${WORKDIR} -name "*.class" -exec rm {} \;
+  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
+                  -name "*.jar" -exec rm {} \;
+  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
+                  -name "*.class" -exec rm {} \;
 }
 
 addtask removebinaries after do_unpack before do_patch
-- 
1.9.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [meta-java][PATCH] java-library.bbclass: compatibility with per-recipe sysroots
  2017-07-12  8:36 [meta-java][PATCH] java-library.bbclass: compatibility with per-recipe sysroots S. Lockwood-Childs
@ 2017-07-21 10:53 ` Maxin B. John
  0 siblings, 0 replies; 2+ messages in thread
From: Maxin B. John @ 2017-07-21 10:53 UTC (permalink / raw)
  To: S. Lockwood-Childs, openembedded-devel

Hi,

On Wed, Jul 12, 2017 at 01:36:34AM -0700, S. Lockwood-Childs wrote:
> The removebinaries task was intended to remove pre-built .jar and .class files
> from the unpacked source, but when per-recipe sysroots were implemented and
> ended up under WORKDIR, .jar or .class in those sysroots inadvertently started 
> getting killed as well.
> 
> For instance, ${WORKDIR}/recipe-sysroot-native/usr/share/java/ecj-bootstrap.jar
> was deleted when attempting to build jlex-native... which made javac in
> that sysroot rather unhappy.
> 
> Solve by excluding both recipe-sysroot and recipe-sysroot-native dirs
> from the search-and-destroy operation.
> 
> Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
> ---
>  classes/java-library.bbclass | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass
> index 58d5a40..ce1cd28 100644
> --- a/classes/java-library.bbclass
> +++ b/classes/java-library.bbclass
> @@ -50,8 +50,10 @@ ALTJARFILENAMES = "${BPN}.jar"
>  # Java "source" distributions often contain precompiled things
>  # we want to delete first.
>  do_removebinaries() {
> -  find ${WORKDIR} -name "*.jar" -exec rm {} \;
> -  find ${WORKDIR} -name "*.class" -exec rm {} \;
> +  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
> +                  -name "*.jar" -exec rm {} \;
> +  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
> +                  -name "*.class" -exec rm {} \;
>  }
>  
>  addtask removebinaries after do_unpack before do_patch
> -- 
> 1.9.4
>

Thanks, Pushed to master.

Best Regards,
Maxin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-21 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12  8:36 [meta-java][PATCH] java-library.bbclass: compatibility with per-recipe sysroots S. Lockwood-Childs
2017-07-21 10:53 ` Maxin B. John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox