Skip to contentSkip to conversation

libvirt: convert more WORKDIR references to UNPACKDIR

PATCH Superseded Martin Jansa 2 participants 4 messages May 30, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libvirt: convert more WORKDIR references to UNPACKDIR

From: Hieu Van Nguyen <[email protected]>

unpacked source files are now in UNPACKDIR, so we adjust our operations to match.

Some references were missed in previous commit as they are behind conditional.

---
 recipes-extended/libvirt/libvirt-python.inc |  4 ++--
 recipes-extended/libvirt/libvirt_10.0.0.bb  | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)
recipes-extended/libvirt/libvirt-python.inc +2 -2
index 6fb2b68c..12041df0 100644
@@ -46,7 +46,7 @@ do_compile:append() {
 		# the syroot staged pkgconfig entries. So we clear the sysroot
 		# for just this portion.
 		export PKG_CONFIG_SYSROOT_DIR=
-		cd ${WORKDIR}/${BPN}-python-${PV} && \
+		cd ${UNPACKDIR}/${BPN}-python-${PV} && \
 		  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build
 	fi
 }
@@ -57,7 +57,7 @@ do_install:append() {
 		# the syroot staged pkgconfig entries. So we clear the sysroot
 		# for just this portion.
 		export PKG_CONFIG_SYSROOT_DIR=
-		cd ${WORKDIR}/${BPN}-python-${PV} && \
+		cd ${UNPACKDIR}/${BPN}-python-${PV} && \
 		  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \
                        --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
 	fi
recipes-extended/libvirt/libvirt_10.0.0.bb +9 -9
index 9ad1f798..ababbf1b 100644
@@ -286,21 +286,21 @@ do_install:append() {
 
 	if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then
 	    # Generate sample keys and certificates.
-	    cd ${WORKDIR}
-	    ${WORKDIR}/gnutls-helper.py -y
+	    cd ${UNPACKDIR}
+	    ${UNPACKDIR}/gnutls-helper.py -y
 
 	    # Deploy all sample keys and certificates of CA, server and client
 	    # to target so that libvirtd is able to boot successfully and local
 	    # connection via 127.0.0.1 is available out of box.
 	    install -d ${D}/etc/pki/CA
 	    install -d ${D}/etc/pki/libvirt/private
-            install -m 0755 ${WORKDIR}/gnutls-helper.py ${D}/${bindir}
-	    install -m 0644 ${WORKDIR}/cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem
-	    install -m 0644 ${WORKDIR}/cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem
-	    install -m 0644 ${WORKDIR}/serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem
-	    install -m 0644 ${WORKDIR}/servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem
-	    install -m 0644 ${WORKDIR}/clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem
-	    install -m 0644 ${WORKDIR}/clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem
+            install -m 0755 ${UNPACKDIR}/gnutls-helper.py ${D}/${bindir}
+	    install -m 0644 ${UNPACKDIR}/cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem
+	    install -m 0644 ${UNPACKDIR}/cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem
+	    install -m 0644 ${UNPACKDIR}/serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem
+	    install -m 0644 ${UNPACKDIR}/servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem
+	    install -m 0644 ${UNPACKDIR}/clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem
+	    install -m 0644 ${UNPACKDIR}/clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem
 
 	    # Force the connection to be tls.
 	    sed -i -e 's/^\(listen_tls\ =\ .*\)/#\1/' -e 's/^\(listen_tcp\ =\ .*\)/#\1/' ${D}/etc/libvirt/libvirtd.conf
Signature · 1 line
2.45.1
#1 lore raw
Quoted 30 lines · Martin Jansa via lists.yoctoproject.org

From: Hieu Van Nguyen <[email protected]>

unpacked source files are now in UNPACKDIR, so we adjust our operations to match.

Some references were missed in previous commit as they are behind conditional.

---
 recipes-extended/libvirt/libvirt-python.inc |  4 ++--
 recipes-extended/libvirt/libvirt_10.0.0.bb  | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)
recipes-extended/libvirt/libvirt-python.inc +1 -1
index 6fb2b68c..12041df0 100644
@@ -46,7 +46,7 @@ do_compile:append() {
                # the syroot staged pkgconfig entries. So we clear the sysroot
                # for just this portion.
                export PKG_CONFIG_SYSROOT_DIR=
-               cd ${WORKDIR}/${BPN}-python-${PV} && \
+               cd ${UNPACKDIR}/${BPN}-python-${PV} && \
                  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build
        fi
 }

recipes-extended/libvirt/libvirt-python.inc do_install:append() { · line 60

Quoted 5 lines
recipes-extended/libvirt/libvirt-python.inc +1 -1
@@ -57,7 +57,7 @@ do_install:append() {
                # the syroot staged pkgconfig entries. So we clear the sysroot
                # for just this portion.
                export PKG_CONFIG_SYSROOT_DIR=
-               cd ${WORKDIR}/${BPN}-python-${PV} && \
+               cd ${UNPACKDIR}/${BPN}-python-${PV} && \

Indeed, I did miss these behind the pkgconfig.

Quoted 8 lines
recipes-extended/libvirt/libvirt-python.inc +0 -0
                  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \
                        --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
        fi
recipes-extended/libvirt/libvirt_10.0.0.bb +0 -0
index 9ad1f798..ababbf1b 100644

recipes-extended/libvirt/libvirt_10.0.0.bb do_install:append() { · line 290

Quoted 7 lines
recipes-extended/libvirt/libvirt_10.0.0.bb +2 -2
@@ -286,21 +286,21 @@ do_install:append() {
 
        if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then
            # Generate sample keys and certificates.
-           cd ${WORKDIR}
-           ${WORKDIR}/gnutls-helper.py -y
+           cd ${UNPACKDIR}
+           ${UNPACKDIR}/gnutls-helper.py -y

I had left these on purpose. Not everything has to be in UNPACKDIR (from my understanding and point of view)

Since these are generated files as part of the build, I don't see the issue with them being in WORKDIR.

That's what my comment about "generated files" was referring to in the commit message.

Bruce

Quoted 35 lines
recipes-extended/libvirt/libvirt_10.0.0.bb +7 -8
            # Deploy all sample keys and certificates of CA, server and client
            # to target so that libvirtd is able to boot successfully and local
            # connection via 127.0.0.1 is available out of box.
            install -d ${D}/etc/pki/CA
            install -d ${D}/etc/pki/libvirt/private
-            install -m 0755 ${WORKDIR}/gnutls-helper.py ${D}/${bindir}
-           install -m 0644 ${WORKDIR}/cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem
-           install -m 0644 ${WORKDIR}/cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem
-           install -m 0644 ${WORKDIR}/serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem
-           install -m 0644 ${WORKDIR}/servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem
-           install -m 0644 ${WORKDIR}/clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem
-           install -m 0644 ${WORKDIR}/clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem
+            install -m 0755 ${UNPACKDIR}/gnutls-helper.py ${D}/${bindir}
+           install -m 0644 ${UNPACKDIR}/cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem
+           install -m 0644 ${UNPACKDIR}/cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem
+           install -m 0644 ${UNPACKDIR}/serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem
+           install -m 0644 ${UNPACKDIR}/servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem
+           install -m 0644 ${UNPACKDIR}/clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem
+           install -m 0644 ${UNPACKDIR}/clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem
 
            # Force the connection to be tls.
            sed -i -e 's/^\(listen_tls\ =\ .*\)/#\1/' -e 's/^\(listen_tcp\ =\ .*\)/#\1/' ${D}/etc/libvirt/libvirtd.conf
--

2.45.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8784): https://lists.yoctoproject.org/g/meta-virtualization/message/8784
Mute This Topic: https://lists.yoctoproject.org/mt/106387463/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#2 lore raw
Quoted 61 lines · Bruce Ashfield
Quoted 30 lines · Martin Jansa via lists.yoctoproject.org

From: Hieu Van Nguyen <[email protected]>

unpacked source files are now in UNPACKDIR, so we adjust our operations to match.

Some references were missed in previous commit as they are behind conditional.

---
 recipes-extended/libvirt/libvirt-python.inc |  4 ++--
 recipes-extended/libvirt/libvirt_10.0.0.bb  | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)
recipes-extended/libvirt/libvirt-python.inc +1 -1
index 6fb2b68c..12041df0 100644
@@ -46,7 +46,7 @@ do_compile:append() {
                # the syroot staged pkgconfig entries. So we clear the sysroot
                # for just this portion.
                export PKG_CONFIG_SYSROOT_DIR=
-               cd ${WORKDIR}/${BPN}-python-${PV} && \
+               cd ${UNPACKDIR}/${BPN}-python-${PV} && \
                  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build
        fi
 }

recipes-extended/libvirt/libvirt-python.inc do_install:append() { · line 60

Quoted 5 lines
recipes-extended/libvirt/libvirt-python.inc +1 -1
@@ -57,7 +57,7 @@ do_install:append() {
                # the syroot staged pkgconfig entries. So we clear the sysroot
                # for just this portion.
                export PKG_CONFIG_SYSROOT_DIR=
-               cd ${WORKDIR}/${BPN}-python-${PV} && \
+               cd ${UNPACKDIR}/${BPN}-python-${PV} && \

Indeed, I did miss these behind the pkgconfig.

Quoted 8 lines
recipes-extended/libvirt/libvirt-python.inc +0 -0
                  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \
                        --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
        fi
recipes-extended/libvirt/libvirt_10.0.0.bb +0 -0
index 9ad1f798..ababbf1b 100644

recipes-extended/libvirt/libvirt_10.0.0.bb do_install:append() { · line 290

Quoted 7 lines
recipes-extended/libvirt/libvirt_10.0.0.bb +2 -2
@@ -286,21 +286,21 @@ do_install:append() {
 
        if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then
            # Generate sample keys and certificates.
-           cd ${WORKDIR}
-           ${WORKDIR}/gnutls-helper.py -y
+           cd ${UNPACKDIR}
+           ${UNPACKDIR}/gnutls-helper.py -y

I had left these on purpose. Not everything has to be in UNPACKDIR (from my understanding and point of view)

Quoted 5 lines

Since these are generated files as part of the build, I don't see the issue with them being in WORKDIR.

That's what my comment about "generated files" was referring to in the commit message.

I see it's already in master-next, do you want v2 which will call gnutls-helper.py from UNPACKDIR but doesn't 'cd' there?

With libvirt-python-${PV} being built under UNPACKDIR already it's a bit confusing I agree, maybe it would be clearer to unpack all these files and libvirt-python-${PV} under ${BPN} destdir and use ${S} everywhere?

#3 lore raw
Quoted 63 lines · Martin Jansa
Quoted 61 lines · Bruce Ashfield
Quoted 30 lines · Martin Jansa via lists.yoctoproject.org

From: Hieu Van Nguyen <[email protected]>

unpacked source files are now in UNPACKDIR, so we adjust our operations to match.

Some references were missed in previous commit as they are behind conditional.

---
 recipes-extended/libvirt/libvirt-python.inc |  4 ++--
 recipes-extended/libvirt/libvirt_10.0.0.bb  | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)
recipes-extended/libvirt/libvirt-python.inc +1 -1
index 6fb2b68c..12041df0 100644
@@ -46,7 +46,7 @@ do_compile:append() {
                # the syroot staged pkgconfig entries. So we clear the sysroot
                # for just this portion.
                export PKG_CONFIG_SYSROOT_DIR=
-               cd ${WORKDIR}/${BPN}-python-${PV} && \
+               cd ${UNPACKDIR}/${BPN}-python-${PV} && \
                  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build
        fi
 }

recipes-extended/libvirt/libvirt-python.inc do_install:append() { · line 60

Quoted 5 lines
recipes-extended/libvirt/libvirt-python.inc +1 -1
@@ -57,7 +57,7 @@ do_install:append() {
                # the syroot staged pkgconfig entries. So we clear the sysroot
                # for just this portion.
                export PKG_CONFIG_SYSROOT_DIR=
-               cd ${WORKDIR}/${BPN}-python-${PV} && \
+               cd ${UNPACKDIR}/${BPN}-python-${PV} && \

Indeed, I did miss these behind the pkgconfig.

Quoted 8 lines
recipes-extended/libvirt/libvirt-python.inc +0 -0
                  ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \
                        --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
        fi
recipes-extended/libvirt/libvirt_10.0.0.bb +0 -0
index 9ad1f798..ababbf1b 100644

recipes-extended/libvirt/libvirt_10.0.0.bb do_install:append() { · line 290

Quoted 7 lines
recipes-extended/libvirt/libvirt_10.0.0.bb +2 -2
@@ -286,21 +286,21 @@ do_install:append() {
 
        if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then
            # Generate sample keys and certificates.
-           cd ${WORKDIR}
-           ${WORKDIR}/gnutls-helper.py -y
+           cd ${UNPACKDIR}
+           ${UNPACKDIR}/gnutls-helper.py -y

I had left these on purpose. Not everything has to be in UNPACKDIR (from my understanding and point of view)

Quoted 8 lines
Quoted 5 lines

Since these are generated files as part of the build, I don't see the issue with them being in WORKDIR.

That's what my comment about "generated files" was referring to in the commit message.

I see it's already in master-next, do you want v2 which will call gnutls-helper.py from UNPACKDIR but doesn't 'cd' there?

That sounds like a good idea. I'll drop the current patch from master-next.

I was guilty of building it while looking at the change, so I pushed it out of habit :)

Quoted 5 lines

With libvirt-python-${PV} being built under UNPACKDIR already it's a bit confusing I agree, maybe it would be clearer to unpack all these files and libvirt-python-${PV} under ${BPN} destdir and use ${S} everywhere?

That also sounds like a good cleanup / clarification.

Bruce

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II