meson: make https:// wrap source downloads work
PATCH 1/1 meson: make https:// wrap source downloads work
Meson would fail to fetch wraps' sources on bare systems (i.e. docker images), that only provide little more than the SDK.
The SDK's SSL directory was not searched, so meson would fail when it tried to fetch sources via https, that were specified in wrap files. Specifically urllib would fail:
``` <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)> ```
Caution: this patch depends on the underlying C library (i.e. openssl) to consider this environment variable.
---
meta/recipes-devtools/meson/meson/meson-wrapper | 4 ++++
1 file changed, 4 insertions(+)
meta/recipes-devtools/meson/meson/meson-wrapper +0 -0
@@ -4,6 +4,10 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2
fi
+if [ -z "$SSL_CERT_DIR" ]; then
+ export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/"
+fi
+
# If these are set to a cross-compile path, meson will get confused and try to
# use them as native tools. Unset them to prevent this, as all the cross-compile # config is already in meson.cross.
Signature · 1 line
2.33.0
Quoted 31 lines · Leif Middelschulte
Meson would fail to fetch wraps' sources on bare systems (i.e. docker images), that only provide little more than the SDK.
The SDK's SSL directory was not searched, so meson would fail when it tried to fetch sources via https, that were specified in wrap files. Specifically
urllibwould fail:``` <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)> ```Caution: this patch depends on the underlying C library (i.e. openssl) to consider this environment variable.
Signed-off-by Leif Middelschulte <[email protected]>---
meta/recipes-devtools/meson/meson/meson-wrapper | 4 ++++1 file changed, 4 insertions(+)meta/recipes-devtools/meson/meson/meson-wrapper +0
-0@@ -4,6 +4,10 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2fi
meta/recipes-devtools/meson/meson/meson-wrapper +4
-0+if [ -z "$SSL_CERT_DIR" ]; then + export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/" +fi +# If these are set to a cross-compile path, meson will get confused and try to
Quoted 2 lines
# use them as native tools. Unset them to prevent this, as all the cross-compile # config is already in meson.cross.
Why is meson trying to fetch sources? Shouldn't this be happening in do_fetch?
Cheers,
Richard
Am Sa., 6. Nov. 2021 um 11:07 Uhr schrieb Richard Purdie <[email protected]>:
Quoted 28 lines · Leif Middelschulte
Quoted 26 lines
Meson would fail to fetch wraps' sources on bare systems (i.e. docker images), that only provide little more than the SDK.
The SDK's SSL directory was not searched, so meson would fail when it tried to fetch sources via https, that were specified in wrap files. Specifically
urllibwould fail:``` <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)> ```Caution: this patch depends on the underlying C library (i.e. openssl) to consider this environment variable.
Signed-off-by Leif Middelschulte <[email protected]>---
meta/recipes-devtools/meson/meson/meson-wrapper | 4 ++++1 file changed, 4 insertions(+)meta/recipes-devtools/meson/meson/meson-wrapper +0
-0@@ -4,6 +4,10 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2fi
Quoted 9 lines
Quoted 7 lines
meta/recipes-devtools/meson/meson/meson-wrapper +4
-0+if [ -z "$SSL_CERT_DIR" ]; then + export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/" +fi +# If these are set to a cross-compile path, meson will get confused and try to
# use them as native tools. Unset them to prevent this, as all the cross-compile # config is already in meson.cross.Why is meson trying to fetch sources? Shouldn't this be happening in
do_fetch?
This happens outside of bitbake, i.e. when users of the SDK try to build some Meson project that uses "Wraps".
Mesons "wraps" allow its users to build software on the spot, if it is missing in the host/target toolchain. See
https://mesonbuild.com/Using-the-WrapDB.html
Quoted 6 lines
Cheers,
Richard
Thanks for the feedback,
Leif
Quoted 39 lines · Leif Middelschulte
Am Sa., 6. Nov. 2021 um 11:07 Uhr schrieb Richard Purdie <[email protected]>:
Quoted 28 lines · Leif Middelschulte
Quoted 26 lines
Meson would fail to fetch wraps' sources on bare systems (i.e. docker images), that only provide little more than the SDK.
The SDK's SSL directory was not searched, so meson would fail when it tried to fetch sources via https, that were specified in wrap files. Specifically
urllibwould fail:``` <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)> ```Caution: this patch depends on the underlying C library (i.e. openssl) to consider this environment variable.
Signed-off-by Leif Middelschulte <[email protected]>---
meta/recipes-devtools/meson/meson/meson-wrapper | 4 ++++1 file changed, 4 insertions(+)meta/recipes-devtools/meson/meson/meson-wrapper +0
-0@@ -4,6 +4,10 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2fi
Quoted 9 lines
Quoted 7 lines
meta/recipes-devtools/meson/meson/meson-wrapper +4
-0+if [ -z "$SSL_CERT_DIR" ]; then + export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/" +fi +# If these are set to a cross-compile path, meson will get confused and try to
# use them as native tools. Unset them to prevent this, as all the cross-compile # config is already in meson.cross.Why is meson trying to fetch sources? Shouldn't this be happening in
do_fetch?
Quoted 6 lines
This happens outside of bitbake, i.e. when users of the SDK try to build some Meson project that uses "Wraps".
Mesons "wraps" allow its users to build software on the spot, if it is missing in the host/target toolchain. See
https://mesonbuild.com/Using-the-WrapDB.html
Ok, this needs to be clearer in the commit message making it clear this is an SDK issue with the meson-wrapper, ideally in the shortlog.
I did take a deeper look at the patch and it doesn't apply, the whitespace somehow seems damaged as the leading whitespaces on several lines are missing and I think there is other damage.
Also, the patch needs to be sent to the openembedded-core list.
Cheers,
Richard