<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:22:01 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>[CDRIVER-4813] Document library consumption from Scons &amp; meson</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4813</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Updated description:&lt;/p&gt;

&lt;p&gt;Based on the discussion in this ticket, it is apparent that we need to document the proper way to consume libbson and libmongoc from some build systems. We currently provide pkg-config and CMake scripts which can be used directly by autotools and CMake, respectively. However, for other build systems it is necessary to document that consumption of libbson and libmongoc requires leveraging the build system&apos;s pkg-config compatibility features. See the discussion in this ticket for details and pointers.&lt;/p&gt;

&lt;p&gt;Original description follows:&lt;/p&gt;

&lt;p&gt;First of all, thank you. I appreciate your great work!&lt;/p&gt;

&lt;p&gt;I am using the prebuilt libmongoc from Ubuntu Jammy, installable with APT. I notice that libmogoc and libbson headers are installed to `/usr/include/libmongoc-1.0/mongoc/` and `/usr/include/libbson-1.0/bson/`, instead of the conventional `/usr/include/`. So when I do&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;#include &amp;lt;libmongoc-&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1.0&lt;/span&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;/mongoc/mongoc.h&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;I get errors such as&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;   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;/usr/include/libmongoc-&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1.0&lt;/span&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;/mongoc/mongoc.h:&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;22&lt;/span&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;:&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;10&lt;/span&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;: fatal error: bson/bson.h: No such file or directory&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;&#160; &#160;&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;22&lt;/span&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; | #include &amp;lt;bson/bson.h&amp;gt;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;&#160; &#160; &#160; | &#160; &#160; &#160; &#160; &#160;^~~~~~~~~~~~~&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;&#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://mongoc.org/libmongoc/current/tutorial.html#include-and-link-libmongoc-in-your-c-program&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;The documentation&lt;/a&gt; only mentions cmake and pkg-config. For other build systems, such scons and meson, I have to hard-code the include path, by passing&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;-isystem /usr/include/libbson-&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1.0&lt;/span&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; -isystem /usr/include/libmongoc-&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1.0&lt;/span&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; &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;This is not only inconvenient, but also prevents overriding the system library with a custom one, typically installed into `/usr/local/include`.&lt;/p&gt;

&lt;p&gt;So, are there any reasons why these headers are not installed to `/usr/include/libmongoc-1.0/mongoc/` instead of the more conventional `/usr/include/mongoc/`? Thanks in advance.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2544319">CDRIVER-4813</key>
            <summary>Document library consumption from Scons &amp; meson</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="13203">Gone away</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="lh_mouse@126.com">LIU Hao</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Jan 2024 13:19:06 +0000</created>
                <updated>Tue, 6 Feb 2024 10:35:45 +0000</updated>
                            <resolved>Tue, 6 Feb 2024 10:35:45 +0000</resolved>
                                    <version>1.21.0</version>
                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="6047193" author="JIRAUSER1276836" created="Sat, 27 Jan 2024 21:14:06 +0000"  >&lt;p&gt;&lt;del&gt;I&apos;m migrating one of my C++ projects to meson now.&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;&lt;tt&gt;dep_mongoc = dependency(&apos;libmongoc-1.0&apos;, required: false)&#160;&lt;/tt&gt;&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;This seems to yield a dependency object for the C language. It adds libraries i.e. &lt;tt&gt;LIBS&lt;/tt&gt; but doesn&apos;t seem to pass necessary &lt;tt&gt;CFLAGS&lt;/tt&gt; to the C++ compiler. (still looking for a practical solution.)&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;Apologies for the confusion; forgot to attach the dependency to the program.&lt;/p&gt;</comment>
                            <comment id="6046341" author="roberto.sanchez" created="Sat, 27 Jan 2024 01:13:03 +0000"  >&lt;p&gt;That is a good point about the difference between &lt;tt&gt;-I&lt;/tt&gt; and &lt;tt&gt;-isystem&lt;/tt&gt;. I will raise the issue within the team to see if we might be able to change our generated &lt;tt&gt;.pc&lt;/tt&gt; files.&lt;/p&gt;</comment>
                            <comment id="6043720" author="JIRAUSER1276836" created="Fri, 26 Jan 2024 08:33:46 +0000"  >&lt;p&gt;Well, using a standard include path has a side effect: GCC knows it is a system header and suppress warnings.&lt;/p&gt;

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

&lt;p&gt;For mongoc, pkg-config gives two directories using &lt;tt&gt;-I&lt;/tt&gt; instead of &lt;tt&gt;-isystem&lt;/tt&gt;:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$ pkg-config --cflags libmongoc-1.0&#160;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;-I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0&lt;/tt&gt;&lt;/p&gt;

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

&lt;p&gt;If I add&#160;&lt;tt&gt;-Werror=sign-conversion&lt;/tt&gt; then I get errors from bson headers:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;/usr/include/libbson-1.0/bson/bson-iter.h: In function &#8216;uint32_t bson_iter_utf8_len_unsafe(const bson_iter_t*)&#8217;:&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;/usr/include/libbson-1.0/bson/bson-endian.h:87:33: error: conversion to &#8216;int32_t&#8217; {aka &#8216;int&#8217;} from &#8216;uint32_t&#8217; {aka &#8216;unsigned int&#8217;} may change the sign of the result &lt;span class=&quot;error&quot;&gt;&amp;#91;-Werror=sign-conversion&amp;#93;&lt;/span&gt;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160;87 | #define BSON_UINT32_FROM_LE(v) ((uint32_t) v)&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; | &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;sub&gt;^&lt;/sub&gt;~~~~~~~~~~~&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="6043393" author="JIRAUSER1276836" created="Fri, 26 Jan 2024 01:41:05 +0000"  >&lt;p&gt;Thanks! This works for me:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;project(&apos;mongoc_version&apos;, &apos;c&apos;)&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;libmongoc_dep = dependency(&apos;libmongoc-1.0&apos;, version : &apos;&amp;gt;=1.21.0&apos;)&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;exe = executable(&apos;mongoc_version&apos;, &apos;main.c&apos;, dependencies : libmongoc_dep)&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="6042275" author="roberto.sanchez" created="Thu, 25 Jan 2024 18:35:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lh_mouse%40126.com&quot; class=&quot;user-hover&quot; rel=&quot;lh_mouse@126.com&quot;&gt;lh_mouse@126.com&lt;/a&gt;, have you considered making use of the facilities available in SCons and meson for this particular need?&lt;/p&gt;

&lt;p&gt;From the &lt;a href=&quot;https://scons.org/faq.html#I.27m_already_using_ldconfig.2C_pkg-config.2C_gtk-config.2C_etc._Do_I_have_to_rewrite_their_logic_to_use_SCons.3F&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;SCons documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;I&apos;m already using ldconfig, pkg-config, gtk-config, etc. Do I have to rewrite their logic to use SCons?&lt;/p&gt;

&lt;p&gt;SCons provides explicit support for getting information from programs like ldconfig and pkg-config. The relevant method is ParseConfig(), which executes a *-config command, parses the returned flags, and puts them in the environment through which the ParseConfig() method is called:&lt;/p&gt;

&lt;p&gt;env.ParseConfig(&apos;pkg-config --cflags --libs libxml&apos;)&lt;/p&gt;

&lt;p&gt;If you need to provide some special-purpose processing, you can supply a function to process the flags and apply them to the environment in any way you want.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;From the &lt;a href=&quot;https://mesonbuild.com/Dependencies.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Meson documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Meson also allows one to get variables that are defined in a pkg-config file. This can be done by using the dep.get_pkgconfig_variable() function.&lt;/p&gt;

&lt;p&gt;zdep_prefix = zdep.get_pkgconfig_variable(&apos;prefix&apos;)&lt;/p&gt;

&lt;p&gt;These variables can also be redefined by passing the define_variable parameter, which might be useful in certain situations:&lt;/p&gt;

&lt;p&gt;zdep_prefix = zdep.get_pkgconfig_variable(&apos;libdir&apos;, define_variable: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;prefix&amp;#39;, &amp;#39;/tmp&amp;#39;&amp;#93;&lt;/span&gt;)&lt;/p&gt;

&lt;p&gt;The dependency detector works with all libraries that provide a pkg-config file.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Consuming the libmongoc and libbson in this way will also ensure that you have the correct linker flags, preprocessor definitions, etc.&lt;/p&gt;

&lt;p&gt;Please let us know if this works for you.&lt;/p&gt;</comment>
                            <comment id="6036658" author="JIRAUSER1276836" created="Wed, 24 Jan 2024 04:21:21 +0000"  >&lt;h3&gt;&lt;a name=&quot;Proposedsolution&quot;&gt;&lt;/a&gt;Proposed solution&lt;/h3&gt;

&lt;p&gt;Install two additional symbol links, which point to directories of the latest version:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;bson&#160; &#160; =&amp;gt;&#160; libbson-1.0/bson&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;mongoc&#160; =&amp;gt; &#160;libmongoc-1.0/mongoc&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="6006876" author="dbeng-pm-bot" created="Fri, 12 Jan 2024 13:19:08 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lh_mouse%40126.com&quot; class=&quot;user-hover&quot; rel=&quot;lh_mouse@126.com&quot;&gt;lh_mouse@126.com&lt;/a&gt;, thank you for reporting this issue! The team will look into it and get back to you soon. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                        <customfield id="customfield_23812" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Assigned Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26444"><![CDATA[C Drivers]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <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|i2po6c:</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>