<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:08:42 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[MONGOCRYPT-451] Cannot build with shared libbson</title>
                <link>https://jira.mongodb.org/browse/MONGOCRYPT-451</link>
                <project id="17481" key="MONGOCRYPT">Libmongocrypt</project>
                    <description>&lt;p&gt;I&apos;m unable to build RPM of new version using system shared libbson.&lt;/p&gt;

&lt;p&gt;In all case, it seems the static libbson is required (which is not available in the package per packaging Guidelines)&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2079321">MONGOCRYPT-451</key>
            <summary>Cannot build with shared libbson</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="colby.pike@mongodb.com">Colby Pike</assignee>
                                    <reporter username="remi">Remi Collet</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Jun 2022 07:48:21 +0000</created>
                <updated>Fri, 27 Jan 2023 08:41:39 +0000</updated>
                            <resolved>Thu, 28 Jul 2022 18:54:01 +0000</resolved>
                                    <version>1.5.0</version>
                                                    <component>cmake</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4712679" author="JIRAUSER1260880" created="Thu, 28 Jul 2022 18:53:01 +0000"  >&lt;p&gt;I believe this is all settled now.&#160; Feel free to re-open if you run into any new issues.&lt;/p&gt;</comment>
                            <comment id="4685075" author="remi" created="Mon, 18 Jul 2022 09:29:36 +0000"  >&lt;p&gt;Build in Fedora Rawhide using&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://src.fedoraproject.org/rpms/libmongocrypt/raw/rawhide/f/libmongocrypt-static.patch&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://src.fedoraproject.org/rpms/libmongocrypt/raw/rawhide/f/libmongocrypt-static.patch&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Perhaps will have to keep it rawhide only because of ABI/API change (&lt;a href=&quot;https://jira.mongodb.org/browse/MONGOCRYPT-460&quot; title=&quot;ABI/API breakage in 1.5.x&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MONGOCRYPT-460&quot;&gt;&lt;del&gt;MONGOCRYPT-460&lt;/del&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;(looks like each day I hate cmake a bit more)&lt;/p&gt;</comment>
                            <comment id="4664548" author="JIRAUSER1260880" created="Thu, 7 Jul 2022 19:50:03 +0000"  >&lt;p&gt;Those references in &lt;tt&gt;mongocrypt-config.cmake&lt;/tt&gt; will not create issues. Those are there for setting up link rules at import time and do not require any bson-static targets.&lt;/p&gt;</comment>
                            <comment id="4663109" author="remi" created="Thu, 7 Jul 2022 13:35:13 +0000"  >&lt;p&gt;Yes, using&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;sed -e &apos;/target_link_libraries/s/bson_static/bson_shared/&apos; -i cmake/ImportBSON.cmake&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;build passes&lt;/p&gt;

&lt;p&gt;(tests are no more available)&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;But some static are now referenced in installed cmake files:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;+ grep -r static cmake&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;cmake/mongocrypt/mongocrypt-config.cmake: &#160; &#160;# The user has named a library that should be linked as the static libbson library&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;cmake/mongocrypt/mongocrypt-config.cmake: &#160; &#160; &#160; &#160;TARGET mongo::_mongocrypt-libbson_for_static&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;cmake/mongocrypt/mongocrypt-config.cmake:# &#160; (Note: static libmongocrypt &lt;b&gt;always&lt;/b&gt; needs to link against an external libbson, as it does not&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;cmake/mongocrypt/mongocrypt_targets.cmake:foreach(_expectedTarget mongo::_mongocrypt-libbson_for_static mongo::_mongocrypt-libbson_for_shared mongo::mongocrypt)&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;cmake/mongocrypt/mongocrypt_targets.cmake:# Create imported target mongo::_mongocrypt-libbson_for_static&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;cmake/mongocrypt/mongocrypt_targets.cmake:add_library(mongo::_mongocrypt-libbson_for_static INTERFACE IMPORTED)&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="4661492" author="JIRAUSER1260880" created="Wed, 6 Jul 2022 19:40:36 +0000"  >&lt;p&gt;I believe I have found the issue. The &lt;tt&gt;mongocrypt_static&lt;/tt&gt; attempts to link with &lt;tt&gt;bson_static&lt;/tt&gt;, but that target is not defined in your build. That CMake target also exposes the usage requirements that set up the header search paths. Since &lt;tt&gt;bson_static&lt;/tt&gt; does not refer to anything, the build does not receive any usage requirements that allow it to compile and link.&lt;/p&gt;

&lt;p&gt;In &lt;tt&gt;ImportBSON.cmake&lt;/tt&gt;, there is a line:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;target_link_libraries (_mongocrypt-libbson_for_static INTERFACE $&amp;lt;BUILD_INTERFACE:bson_static&amp;gt;)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Replace it with this:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;target_link_libraries (_mongocrypt-libbson_for_static INTERFACE $&amp;lt;BUILD_INTERFACE:bson_shared&amp;gt;)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="4654338" author="remi" created="Sat, 2 Jul 2022 05:44:44 +0000"  >&lt;p&gt;&lt;tt&gt;CMakeCache&lt;/tt&gt;.txt attached&lt;/p&gt;</comment>
                            <comment id="4653724" author="JIRAUSER1260880" created="Fri, 1 Jul 2022 19:21:39 +0000"  >&lt;p&gt;Can you post your &lt;tt&gt;CMakeCache.txt&lt;/tt&gt; from the failing build?&lt;/p&gt;</comment>
                            <comment id="4652171" author="remi" created="Fri, 1 Jul 2022 06:25:12 +0000"  >&lt;p&gt;Using:&lt;/p&gt;

&lt;p&gt;{{&#160; &#160; -DENABLE_PIC:BOOL=ON }}&lt;br/&gt;
{{&#160; &#160; -DUSE_SHARED_LIBBSON:BOOL=ON }}&lt;br/&gt;
{{&#160; &#160; -DMONGOCRYPT_MONGOC_DIR:STRING=USE-SYSTEM }}&lt;br/&gt;
{{&#160; &#160; -DENABLE_ONLINE_TESTS:BOOL=OFF }}&lt;br/&gt;
{{&#160; &#160; -DBUILD_TESTING:BOOL=OFF }}&lt;br/&gt;
&lt;tt&gt;&#160; &#160; -DENABLE_STATIC:BOOL=OFF&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Still failing:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;[ 48%] Building C object CMakeFiles/mongocrypt_static.dir/src/crypto/cng.c.o&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/ccache/gcc -DKMS_MSG_STATIC -DMLIB_USER -DMONGOCRYPT_LITTLE_ENDIAN -DMONGOCRYPT_STATIC_DEFINE -I/dev/shm/extras/BUILD/libmongocrypt-1.5.0/kms-message/src -I/dev/shm/extras/BUILD/libmongocrypt-1.5.0/src -I/dev/shm/extras/BUILD/libmongocrypt-1.5.0/redhat-linux-build/src -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 &#160;-m64 &#160;-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=discarded-qualifiers -Werror=uninitialized -fPIC -std=gnu99 -MD -MT CMakeFiles/mongocrypt_static.dir/src/crypto/cng.c.o -MF CMakeFiles/mongocrypt_static.dir/src/crypto/cng.c.o.d -o CMakeFiles/mongocrypt_static.dir/src/crypto/cng.c.o -c /dev/shm/extras/BUILD/libmongocrypt-1.5.0/src/crypto/cng.c&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;In file included from /dev/shm/extras/BUILD/libmongocrypt-1.5.0/src/crypto/../mongocrypt-crypto-private.h:21,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;from /dev/shm/extras/BUILD/libmongocrypt-1.5.0/src/crypto/cng.c:17:&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/dev/shm/extras/BUILD/libmongocrypt-1.5.0/src/crypto/../mongocrypt-buffer-private.h:20:10: fatal error: bson/bson.h: No such file or directory&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160;20 | #include &amp;lt;bson/bson.h&amp;gt;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; | &#160; &#160; &#160; &#160; &#160;^~~~~~~~~~~~~&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;compilation terminated.&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Notice: this issue also blocks update in official repository of&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;mongo-c-driver 1.22.0&lt;/li&gt;
	&lt;li&gt;upcoming pecl extension 1.14.0&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="4650931" author="JIRAUSER1260880" created="Thu, 30 Jun 2022 16:57:52 +0000"  >&lt;p&gt;Hi Remi,&lt;/p&gt;

&lt;p&gt;I made the changes that are relevant here. The static libbson in this case is only needed to compile some test programs. Does the build succeed if you set &lt;tt&gt;BUILD_TESTING=OFF&lt;/tt&gt; as a CMake setting?&lt;/p&gt;</comment>
                            <comment id="4646996" author="remi" created="Wed, 29 Jun 2022 07:53:44 +0000"  >&lt;p&gt;&lt;tt&gt;Package content:&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;# rpm -q libbson-devel&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;libbson-devel-1.21.2-1.fc35.remi.x86_64&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;# rpm -ql libbson-devel&#160;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/include/libbson-1.0&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/include/libbson-1.0/bson&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/include/libbson-1.0/bson.h&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;...&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/bson-1.0&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/bson-1.0/bson-1.0-config-version.cmake&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/bson-1.0/bson-1.0-config.cmake&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/bson-1.0/bson-targets-relwithdebinfo.cmake&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/bson-1.0/bson-targets.cmake&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/libbson-1.0&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/libbson-1.0/libbson-1.0-config-version.cmake&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/cmake/libbson-1.0/libbson-1.0-config.cmake&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/libbson-1.0.so&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/lib64/pkgconfig/libbson-1.0.pc&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="4646991" author="remi" created="Wed, 29 Jun 2022 07:51:19 +0000"  >&lt;p&gt;Using &#160; &#160; -DUSE_SHARED_LIBBSON:BOOL=ON&#160; &#160; -DMONGOCRYPT_MONGOC_DIR:STRING=USE-SYSTEM&#160; &#160; -DENABLE_ONLINE_TESTS:BOOL=OFF &#160; &#160; -DENABLE_STATIC:BOOL=OFF&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;gmake&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;: *** No rule to make target &apos;_MONGOCRYPT_SYSTEM_LIBBSON_STATIC-NOTFOUND&apos;, needed by &apos;mongo_crypt_v1.so&apos;. &#160;Stop.&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;gmake&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;: *** Waiting for unfinished jobs....&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;gmake&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;: Entering directory &apos;/dev/shm/extras/BUILD/libmongocrypt-1.5.0/redhat-linux-build&apos;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;gmake&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;: *** No rule to make target &apos;_MONGOCRYPT_SYSTEM_LIBBSON_STATIC-NOTFOUND&apos;, needed by &apos;stubbed-crypt_shared-2.dll&apos;. &#160;Stop.&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;gmake&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;: *** Waiting for unfinished jobs....&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Trying with removing find_library (_MONGOCRYPT_SYSTEM_LIBBSON_STATIC ...&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;/dev/shm/extras/BUILD/libmongocrypt-1.5.0/test/crypt_shared-stub.cpp:20:10: fatal error: bson/bson.h: No such file or directory&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160;20 | #include &amp;lt;bson/bson.h&amp;gt;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; | &#160; &#160; &#160; &#160; &#160;^~~~~~~~~~~~~&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;compilation terminated.&lt;/tt&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10720">
                    <name>Cloners</name>
                                                                <inwardlinks description="is cloned by">
                                        <issuelink>
            <issuekey id="2245227">MONGOCRYPT-522</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="388142" name="CMakeCache.txt" size="24323" author="remi" created="Sat, 2 Jul 2022 05:44:27 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                            <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0ja34:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>