diff mbox series

[meta-oe,2/2] mongodb: Fix build on 32bit

Message ID 20230922141423.2672238-2-martin.jansa@gmail.com
State Under Review
Headers show
Series [meta-oe,1/2] mongodb: add and fix Upstream-Status | expand

Commit Message

Martin Jansa Sept. 22, 2023, 2:14 p.m. UTC
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
 .../mongodb/0001-Fix-build-on-32bit.patch     | 38 +++++++++++++++++++
 .../recipes-dbs/mongodb/mongodb_git.bb        |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch

Comments

Khem Raj Sept. 22, 2023, 3:18 p.m. UTC | #1
On 9/22/23 7:14 AM, Martin Jansa wrote:
> Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> ---
>   .../mongodb/0001-Fix-build-on-32bit.patch     | 38 +++++++++++++++++++
>   .../recipes-dbs/mongodb/mongodb_git.bb        |  1 +
>   2 files changed, 39 insertions(+)
>   create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch
> 
> diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch
> new file mode 100644
> index 0000000000..4abc044151
> --- /dev/null
> +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch
> @@ -0,0 +1,38 @@
> +From b172ebe7e709b10338c1b260310dacc15c557cff Mon Sep 17 00:00:00 2001
> +From: Martin Jansa <martin.jansa@gmail.com>
> +Date: Fri, 22 Sep 2023 15:37:29 +0200
> +Subject: [PATCH] Fix build on 32bit
> +
> +* fixes:
> +  src/mongo/util/net/http_client_curl.cpp: In function 'size_t mongo::{anonymous}::ReadMemoryCallback(char*, size_t, size_t, void*)':
> +  src/mongo/util/net/http_client_curl.cpp:172:21: error: no matching function for call to 'min(size_t, long unsigned int)'
> +    172 |             std::min(size * nitems, static_cast<unsigned long>(bufReader->remaining()));
> +        |             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +* reported in:
> +  https://jira.mongodb.org/browse/SERVER-73007
> +  but will probably get closed like:
> +  mongodb/0001-Fix-type-mismatch-on-32bit-arches.patch
> +  submitted in:
> +  https://jira.mongodb.org/browse/SERVER-74633
> +  as they don't support 32bit builds
> +

Thanks for taking care of it, I was seeing this failure on my CI for on 
x86 but had tabled it down in the long list of TODO, really appreciated.

Yeah, perhaps we should just disable it for all 32bit arches as well.

> +Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> +Upstream-Status: Pending
> +---
> + src/mongo/util/net/http_client_curl.cpp | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/mongo/util/net/http_client_curl.cpp b/src/mongo/util/net/http_client_curl.cpp
> +index 57290d0f8ed..f251fe2a550 100644
> +--- a/src/mongo/util/net/http_client_curl.cpp
> ++++ b/src/mongo/util/net/http_client_curl.cpp
> +@@ -169,7 +169,7 @@ size_t ReadMemoryCallback(char* buffer, size_t size, size_t nitems, void* instre
> +
> +     if (bufReader->remaining() > 0) {
> +         size_t readSize =
> +-            std::min(size * nitems, static_cast<unsigned long>(bufReader->remaining()));
> ++            std::min(size * nitems, static_cast<size_t>(bufReader->remaining()));
> +         auto buf = bufReader->readBytes(readSize);
> +         memcpy(buffer, buf.rawData(), readSize);
> +         ret = readSize;
> diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
> index f1a508f3f2..037d58cf17 100644
> --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
> +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
> @@ -35,6 +35,7 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
>              file://0001-free_mon-Include-missing-cstdint.patch \
>              file://0001-apply-msvc-workaround-for-clang-16.patch \
>              file://0001-Fix-type-mismatch-on-32bit-arches.patch \
> +           file://0001-Fix-build-on-32bit.patch \
>              "
>   SRC_URI:append:libc-musl ="\
>              file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#105070): https://lists.openembedded.org/g/openembedded-devel/message/105070
> Mute This Topic: https://lists.openembedded.org/mt/101521811/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/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch
new file mode 100644
index 0000000000..4abc044151
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Fix-build-on-32bit.patch
@@ -0,0 +1,38 @@ 
+From b172ebe7e709b10338c1b260310dacc15c557cff Mon Sep 17 00:00:00 2001
+From: Martin Jansa <martin.jansa@gmail.com>
+Date: Fri, 22 Sep 2023 15:37:29 +0200
+Subject: [PATCH] Fix build on 32bit
+
+* fixes:
+  src/mongo/util/net/http_client_curl.cpp: In function 'size_t mongo::{anonymous}::ReadMemoryCallback(char*, size_t, size_t, void*)':
+  src/mongo/util/net/http_client_curl.cpp:172:21: error: no matching function for call to 'min(size_t, long unsigned int)'
+    172 |             std::min(size * nitems, static_cast<unsigned long>(bufReader->remaining()));
+        |             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+* reported in:
+  https://jira.mongodb.org/browse/SERVER-73007
+  but will probably get closed like:
+  mongodb/0001-Fix-type-mismatch-on-32bit-arches.patch
+  submitted in:
+  https://jira.mongodb.org/browse/SERVER-74633
+  as they don't support 32bit builds
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+Upstream-Status: Pending
+---
+ src/mongo/util/net/http_client_curl.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mongo/util/net/http_client_curl.cpp b/src/mongo/util/net/http_client_curl.cpp
+index 57290d0f8ed..f251fe2a550 100644
+--- a/src/mongo/util/net/http_client_curl.cpp
++++ b/src/mongo/util/net/http_client_curl.cpp
+@@ -169,7 +169,7 @@ size_t ReadMemoryCallback(char* buffer, size_t size, size_t nitems, void* instre
+ 
+     if (bufReader->remaining() > 0) {
+         size_t readSize =
+-            std::min(size * nitems, static_cast<unsigned long>(bufReader->remaining()));
++            std::min(size * nitems, static_cast<size_t>(bufReader->remaining()));
+         auto buf = bufReader->readBytes(readSize);
+         memcpy(buffer, buf.rawData(), readSize);
+         ret = readSize;
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
index f1a508f3f2..037d58cf17 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
@@ -35,6 +35,7 @@  SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            file://0001-free_mon-Include-missing-cstdint.patch \
            file://0001-apply-msvc-workaround-for-clang-16.patch \
            file://0001-Fix-type-mismatch-on-32bit-arches.patch \
+           file://0001-Fix-build-on-32bit.patch \
            "
 SRC_URI:append:libc-musl ="\
            file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \