diff mbox series

opencv: fix reproducibility issues

Message ID 20221006084048.154710-1-anuj.mittal@intel.com
State Under Review
Headers show
Series opencv: fix reproducibility issues | expand

Commit Message

Mittal, Anuj Oct. 6, 2022, 8:40 a.m. UTC
Download and unpack contrib modules and other repositories in S instead
of WORKDIR so they don't escape file-prefix-map substitutions.

Fixes a number of reproducibility problems because of OpenCV check
macros that were embedding path to files in contrib/.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 .../recipes-support/opencv/opencv_4.6.0.bb    | 30 +++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)

Comments

Khem Raj Oct. 6, 2022, 6:30 p.m. UTC | #1
btw. I do see a QA warning, perhaps its not related to your change but
I thought it would be good to check

https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2082/steps/14/logs/warnings

On Thu, Oct 6, 2022 at 1:40 AM Anuj Mittal <anuj.mittal@intel.com> wrote:
>
> Download and unpack contrib modules and other repositories in S instead
> of WORKDIR so they don't escape file-prefix-map substitutions.
>
> Fixes a number of reproducibility problems because of OpenCV check
> macros that were embedding path to files in contrib/.
>
> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
> ---
>  .../recipes-support/opencv/opencv_4.6.0.bb    | 30 +++++++++----------
>  1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb b/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
> index f6c10054c..da1e659a4 100644
> --- a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
> +++ b/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
> @@ -39,12 +39,12 @@ IPP_MD5 = "${@ipp_md5sum(d)}"
>
>  SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg"
>  SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https \
> -           git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib;branch=master;protocol=https \
> -           git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=ipp;name=ipp;protocol=https \
> -           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc;protocol=https \
> -           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg;protocol=https \
> -           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face;protocol=https \
> -           git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=wechat_qrcode;name=wechat-qrcode;protocol=https \
> +           git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=master;protocol=https \
> +           git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=git/ipp;name=ipp;protocol=https \
> +           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=git/boostdesc;name=boostdesc;protocol=https \
> +           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=git/vgg;name=vgg;protocol=https \
> +           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=git/face;name=face;protocol=https \
> +           git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=git/wechat_qrcode;name=wechat-qrcode;protocol=https \
>             file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
>             file://0003-To-fix-errors-as-following.patch \
>             file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \
> @@ -52,7 +52,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol
>             file://download.patch \
>             file://0001-Make-ts-module-external.patch \
>             "
> -SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib"
> +SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib"
>
>  S = "${WORKDIR}/git"
>
> @@ -61,7 +61,7 @@ S = "${WORKDIR}/git"
>  OPENCV_DLDIR = "${WORKDIR}/downloads"
>
>  do_unpack_extra() {
> -    tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR}
> +    tar xzf ${S}/ipp/ippicv/${IPP_FILENAME} -C ${S}
>
>      md5() {
>          # Return the MD5 of $1
> @@ -76,22 +76,22 @@ do_unpack_extra() {
>              test -e $DEST || ln -s $F $DEST
>          done
>      }
> -    cache xfeatures2d/boostdesc ${WORKDIR}/boostdesc/*.i
> -    cache xfeatures2d/vgg ${WORKDIR}/vgg/*.i
> -    cache data ${WORKDIR}/face/*.dat
> -    cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.caffemodel
> -    cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.prototxt
> +    cache xfeatures2d/boostdesc ${S}/boostdesc/*.i
> +    cache xfeatures2d/vgg ${S}/vgg/*.i
> +    cache data ${S}/face/*.dat
> +    cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel
> +    cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt
>  }
>  addtask unpack_extra after do_unpack before do_patch
>
>  CMAKE_VERBOSE = "VERBOSE=1"
>
> -EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
> +EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \
>      -DWITH_1394=OFF \
>      -DENABLE_PRECOMPILED_HEADERS=OFF \
>      -DCMAKE_SKIP_RPATH=ON \
>      -DOPENCV_ICV_HASH=${IPP_MD5} \
> -    -DIPPROOT=${WORKDIR}/ippicv_lnx \
> +    -DIPPROOT=${S}/ippicv_lnx \
>      -DOPENCV_GENERATE_PKGCONFIG=ON \
>      -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \
>      -DOPENCV_ALLOW_DOWNLOADS=OFF \
> --
> 2.37.3
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#99078): https://lists.openembedded.org/g/openembedded-devel/message/99078
> Mute This Topic: https://lists.openembedded.org/mt/94153787/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Mittal, Anuj Oct. 6, 2022, 11:15 p.m. UTC | #2
On Thu, 2022-10-06 at 11:30 -0700, Khem Raj wrote:
> btw. I do see a QA warning, perhaps its not related to your change
> but
> I thought it would be good to check
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2082/steps/14/logs/warnings

Yes, there were ~30 of them earlier I think. This change fixes most of
them except this. I will send a separate change later to fix this last
one as well.

Thanks,

Anuj

> 
> On Thu, Oct 6, 2022 at 1:40 AM Anuj Mittal <anuj.mittal@intel.com>
> wrote:
> > 
> > Download and unpack contrib modules and other repositories in S
> > instead
> > of WORKDIR so they don't escape file-prefix-map substitutions.
> > 
> > Fixes a number of reproducibility problems because of OpenCV check
> > macros that were embedding path to files in contrib/.
> > 
> > Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
> > ---
> >  .../recipes-support/opencv/opencv_4.6.0.bb    | 30 +++++++++------
> > ----
> >  1 file changed, 15 insertions(+), 15 deletions(-)
> > 
> > diff --git a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb b/meta-
> > oe/recipes-support/opencv/opencv_4.6.0.bb
> > index f6c10054c..da1e659a4 100644
> > --- a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
> > +++ b/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
> > @@ -39,12 +39,12 @@ IPP_MD5 = "${@ipp_md5sum(d)}"
> > 
> >  SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg"
> >  SRC_URI =
> > "git://github.com/opencv/opencv.git;name=opencv;branch=master;proto
> > col=https \
> > -          
> > git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=
> > contrib;branch=master;protocol=https \
> > -          
> > git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20
> > 191018;destsuffix=ipp;name=ipp;protocol=https \
> > -          
> > git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeature
> > s2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc;protocol
> > =https \
> > -          
> > git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeature
> > s2d_vgg_20160317;destsuffix=vgg;name=vgg;protocol=https \
> > -          
> > git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_ali
> > gnment_20170818;destsuffix=face;name=face;protocol=https \
> > -          
> > git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;
> > destsuffix=wechat_qrcode;name=wechat-qrcode;protocol=https \
> > +          
> > git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;n
> > ame=contrib;branch=master;protocol=https \
> > +          
> > git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20
> > 191018;destsuffix=git/ipp;name=ipp;protocol=https \
> > +          
> > git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeature
> > s2d_boostdesc_20161012;destsuffix=git/boostdesc;name=boostdesc;prot
> > ocol=https \
> > +          
> > git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeature
> > s2d_vgg_20160317;destsuffix=git/vgg;name=vgg;protocol=https \
> > +          
> > git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_ali
> > gnment_20170818;destsuffix=git/face;name=face;protocol=https \
> > +          
> > git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;
> > destsuffix=git/wechat_qrcode;name=wechat-qrcode;protocol=https \
> >            
> > file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
> >             file://0003-To-fix-errors-as-following.patch \
> >            
> > file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch
> >  \
> > @@ -52,7 +52,7 @@ SRC_URI =
> > "git://github.com/opencv/opencv.git;name=opencv;branch=master;proto
> > col
> >             file://download.patch \
> >             file://0001-Make-ts-module-external.patch \
> >             "
> > -SRC_URI:append:riscv64 = "
> > file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib
> > "
> > +SRC_URI:append:riscv64 = "
> > file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib"
> > 
> >  S = "${WORKDIR}/git"
> > 
> > @@ -61,7 +61,7 @@ S = "${WORKDIR}/git"
> >  OPENCV_DLDIR = "${WORKDIR}/downloads"
> > 
> >  do_unpack_extra() {
> > -    tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR}
> > +    tar xzf ${S}/ipp/ippicv/${IPP_FILENAME} -C ${S}
> > 
> >      md5() {
> >          # Return the MD5 of $1
> > @@ -76,22 +76,22 @@ do_unpack_extra() {
> >              test -e $DEST || ln -s $F $DEST
> >          done
> >      }
> > -    cache xfeatures2d/boostdesc ${WORKDIR}/boostdesc/*.i
> > -    cache xfeatures2d/vgg ${WORKDIR}/vgg/*.i
> > -    cache data ${WORKDIR}/face/*.dat
> > -    cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.caffemodel
> > -    cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.prototxt
> > +    cache xfeatures2d/boostdesc ${S}/boostdesc/*.i
> > +    cache xfeatures2d/vgg ${S}/vgg/*.i
> > +    cache data ${S}/face/*.dat
> > +    cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel
> > +    cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt
> >  }
> >  addtask unpack_extra after do_unpack before do_patch
> > 
> >  CMAKE_VERBOSE = "VERBOSE=1"
> > 
> > -EXTRA_OECMAKE = "-
> > DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
> > +EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules
> > \
> >      -DWITH_1394=OFF \
> >      -DENABLE_PRECOMPILED_HEADERS=OFF \
> >      -DCMAKE_SKIP_RPATH=ON \
> >      -DOPENCV_ICV_HASH=${IPP_MD5} \
> > -    -DIPPROOT=${WORKDIR}/ippicv_lnx \
> > +    -DIPPROOT=${S}/ippicv_lnx \
> >      -DOPENCV_GENERATE_PKGCONFIG=ON \
> >      -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \
> >      -DOPENCV_ALLOW_DOWNLOADS=OFF \
> > --
> > 2.37.3
> > 
> > 
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#99078):
> > https://lists.openembedded.org/g/openembedded-devel/message/99078
> > Mute This Topic: https://lists.openembedded.org/mt/94153787/1997914
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe:
> > https://lists.openembedded.org/g/openembedded-devel/unsub [
> > raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb b/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
index f6c10054c..da1e659a4 100644
--- a/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
+++ b/meta-oe/recipes-support/opencv/opencv_4.6.0.bb
@@ -39,12 +39,12 @@  IPP_MD5 = "${@ipp_md5sum(d)}"
 
 SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg"
 SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https \
-           git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib;branch=master;protocol=https \
-           git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=ipp;name=ipp;protocol=https \
-           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc;protocol=https \
-           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg;protocol=https \
-           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face;protocol=https \
-           git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=wechat_qrcode;name=wechat-qrcode;protocol=https \
+           git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=master;protocol=https \
+           git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=git/ipp;name=ipp;protocol=https \
+           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=git/boostdesc;name=boostdesc;protocol=https \
+           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=git/vgg;name=vgg;protocol=https \
+           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=git/face;name=face;protocol=https \
+           git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=git/wechat_qrcode;name=wechat-qrcode;protocol=https \
            file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
            file://0003-To-fix-errors-as-following.patch \
            file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \
@@ -52,7 +52,7 @@  SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol
            file://download.patch \
            file://0001-Make-ts-module-external.patch \
            "
-SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib"
+SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib"
 
 S = "${WORKDIR}/git"
 
@@ -61,7 +61,7 @@  S = "${WORKDIR}/git"
 OPENCV_DLDIR = "${WORKDIR}/downloads"
 
 do_unpack_extra() {
-    tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR}
+    tar xzf ${S}/ipp/ippicv/${IPP_FILENAME} -C ${S}
 
     md5() {
         # Return the MD5 of $1
@@ -76,22 +76,22 @@  do_unpack_extra() {
             test -e $DEST || ln -s $F $DEST
         done
     }
-    cache xfeatures2d/boostdesc ${WORKDIR}/boostdesc/*.i
-    cache xfeatures2d/vgg ${WORKDIR}/vgg/*.i
-    cache data ${WORKDIR}/face/*.dat
-    cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.caffemodel
-    cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.prototxt
+    cache xfeatures2d/boostdesc ${S}/boostdesc/*.i
+    cache xfeatures2d/vgg ${S}/vgg/*.i
+    cache data ${S}/face/*.dat
+    cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel
+    cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt
 }
 addtask unpack_extra after do_unpack before do_patch
 
 CMAKE_VERBOSE = "VERBOSE=1"
 
-EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
+EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \
     -DWITH_1394=OFF \
     -DENABLE_PRECOMPILED_HEADERS=OFF \
     -DCMAKE_SKIP_RPATH=ON \
     -DOPENCV_ICV_HASH=${IPP_MD5} \
-    -DIPPROOT=${WORKDIR}/ippicv_lnx \
+    -DIPPROOT=${S}/ippicv_lnx \
     -DOPENCV_GENERATE_PKGCONFIG=ON \
     -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \
     -DOPENCV_ALLOW_DOWNLOADS=OFF \