<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:37:00 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>[GODRIVER-1727] Allow static compilation when using client-side encryption</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1727</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;When compiling Go programs that use the MongoDB driver with the &quot;cse&quot; tag (to enable client-side encryption), static compilation will fail. To be clear, by static compilation I mean the following &lt;tt&gt;go build&lt;/tt&gt; command is used:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;GOOS=linux GOARCH=amd64 go build -tags cse --ldflags &apos;-linkmode external -extldflags &quot;-static&quot;&apos;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This results in the following error:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1&lt;/tt&gt;&lt;br/&gt;
 &lt;tt&gt;/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lmongocrypt&lt;/tt&gt;&lt;br/&gt;
 &lt;tt&gt;collect2: error: ld returned 1 exit status&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Static compilation is required to be able to package &amp;amp; deploy such programs as AWS Lambda functions (which are simple zip files).&lt;/p&gt;

&lt;p&gt;The issue stems from &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/master/x/mongo/driver/mongocrypt/mongocrypt.go#L11&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;line 11&lt;/a&gt; at the x/mongo/driver/mongocrypt/mongocrypt.go file:&lt;/p&gt;

&lt;p&gt;&#160;&lt;tt&gt;// #cgo linux solaris darwin pkg-config: libmongocrypt&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This can never statically compile because the installation process of libmongocrypt generates two separate pkg-config files: libmongocrypt.pc, and libmongocrypt-static.pc, when in fact one .pc file can be used for both, and the &lt;tt&gt;--static&lt;/tt&gt; flag to pkg-config can be used to return appropriate flags for static compilation.&lt;/p&gt;

&lt;p&gt;To be able to statically compile, I had to replace the aforementioned line with the following:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;// #cgo linux CFLAGS: -I/usr/include/mongocrypt -I/usr/include/kms_message -I/usr/include/libbson-1.0 -DBSON_STATIC&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;// #cgo linux LDFLAGS: /usr/lib64/libmongocrypt-static.a /usr/lib64/libkms_message-static.a -L/usr/lib64 -lbson-static-1.0 /usr/lib/librt.a /usr/lib/libm.a -lssl -lcrypto -ldl -pthread&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This is obviously very specific to my environment, but I am wondering if there is a way to allow static compilation without having to fork the driver and change this one line.&lt;/p&gt;</description>
                <environment>Alpine Linux 3.12&lt;br/&gt;
Go 1.14.4</environment>
        <key id="1450104">GODRIVER-1727</key>
            <summary>Allow static compilation when using client-side encryption</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="preston.vasquez@mongodb.com">Preston Vasquez</assignee>
                                    <reporter username="ido@ido50.net">Ido Perlmuter</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Aug 2020 09:56:04 +0000</created>
                <updated>Fri, 27 Oct 2023 20:01:19 +0000</updated>
                            <resolved>Thu, 23 Mar 2023 12:00:58 +0000</resolved>
                                    <version>1.3.7</version>
                                                                        <votes>1</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="5295032" author="dbeng-pm-bot" created="Thu, 23 Mar 2023 12:01:00 +0000"  >&lt;p&gt;There hasn&apos;t been any recent activity on this ticket, so we&apos;re resolving it. Thanks for reaching out! Please feel free to comment on this if you&apos;re able to provide more information.&lt;/p&gt;</comment>
                            <comment id="5258341" author="dbeng-pm-bot" created="Wed, 8 Mar 2023 12:01:02 +0000"  >&lt;p&gt;Hey &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ido%40ido50.net&quot; class=&quot;user-hover&quot; rel=&quot;ido@ido50.net&quot;&gt;ido@ido50.net&lt;/a&gt;, We need additional details to investigate the problem. If this is still an issue for you, please provide the requested information.&lt;/p&gt;</comment>
                            <comment id="5238172" author="JIRAUSER1265158" created="Tue, 28 Feb 2023 21:20:06 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ido%40ido50.net&quot; class=&quot;user-hover&quot; rel=&quot;ido@ido50.net&quot;&gt;ido@ido50.net&lt;/a&gt; From the &lt;a href=&quot;https://pkg.go.dev/cmd/cgo&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;cgo&lt;/tt&gt; documentation&lt;/a&gt;: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The default pkg-config tool may be changed by setting the PKG_CONFIG environment variable.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That is, one solution to avoid forking the repository would be to build the library pointing to a custom libmongocrypt.pc file. For example, &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;PKG_CONFIG_PATH=&quot;/etc/opts/mongocrypt/pkgconfig&quot; \&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;    CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \&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;    -tags &apos;cse&apos; \&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;    -ldflags &apos;-linkmode external -extldflags &quot;-static&quot;&apos;&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;Then in &quot;/etc/opts/mongocrypt/pkgconfig/libmongocrypt.pc&quot; you can add your custom linking:&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;Name: mongocrypt&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;Description: The libmongocrypt client-side field level encryption library.&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;Version: 1.7.2&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;Requires:&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;prefix=/usr&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;includedir=${prefix}/include/mongocrypt&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;libdir=${prefix}/lib/lib64&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;Libs: ${libdir}/libmongocrypt-static.a ${libdir}/libkms_message-static.a -L${libdir} -lbson-static-1.0 /usr/lib/librt.a /usr/lib/libm.a -lssl -lcrypto -ldl -pthread&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;Clfags: -I/${includedir} -I/usr/include/kms_message -I/usr/include/libbson-1.0 -DBSON_STATIC&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="3380480" author="divjot.arora" created="Tue, 8 Sep 2020 18:01:14 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ido%40ido50.net&quot; class=&quot;user-hover&quot; rel=&quot;ido@ido50.net&quot;&gt;ido@ido50.net&lt;/a&gt;&#160;Thanks for confirming! I&apos;ve updated the ticket title and changed it to &quot;Improvement&quot; to reflect the work that needs to be done. I don&apos;t think there&apos;s anything for us to do until the upstream libmongocrypt work is done, so I&apos;m going to move this out of &quot;Investigating&quot; and we&apos;ll pick it up again when we&apos;re unblocked.&lt;/p&gt;</comment>
                            <comment id="3380473" author="JIRAUSER1256230" created="Tue, 8 Sep 2020 17:58:34 +0000"  >&lt;p&gt;Sounds good to me, thanks!&lt;/p&gt;</comment>
                            <comment id="3380343" author="divjot.arora" created="Tue, 8 Sep 2020 17:18:21 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ido%40ido50.net&quot; class=&quot;user-hover&quot; rel=&quot;ido@ido50.net&quot;&gt;ido@ido50.net&lt;/a&gt;&#160;After some more investigation, I believe this requires changes in libmongocrypt packaging. The pkg-config output for libmongocrypt-static doesn&apos;t output all of the required flags to link against libbson, which causes &quot;undefined reference&quot; errors when building the driver. I&apos;ve brought this up to the team that maintains libmongocrypt and they&apos;re going to investigate further.&lt;/p&gt;

&lt;p&gt;Once we resolve these build issues, I&apos;m hoping to add a new &lt;tt&gt;cse-static&lt;/tt&gt; build tag for the driver. If enabled, the driver will check for &lt;tt&gt;pkg-config: libmongocrypt-static&lt;/tt&gt; rather than &lt;tt&gt;pkg-config: libmongocrypt&lt;/tt&gt; in this line:&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/33c65f5f06d172aa2425932e76c75932ea5f58dd/x/mongo/driver/mongocrypt/mongocrypt.go#L11&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/blob/33c65f5f06d172aa2425932e76c75932ea5f58dd/x/mongo/driver/mongocrypt/mongocrypt.go#L11&lt;/a&gt;. Would that be a reasonable way to enable this feature?&lt;/p&gt;</comment>
                            <comment id="3374367" author="divjot.arora" created="Thu, 3 Sep 2020 14:53:03 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ido%40ido50.net&quot; class=&quot;user-hover&quot; rel=&quot;ido@ido50.net&quot;&gt;ido@ido50.net&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Apologies for the delay on our end. Just wanted to let you know that I&apos;m actively looking into this. As you can imagine, this is a pretty complex issue and is difficult to prototype/test because we&apos;re dependent on an external libmongocrypt library so even small changes require some time to test. I&apos;m talking to the team that maintains libmongocrypt and is responsible for building and distributing the packages for it to see if we can figure out a path forward. I should have an update for you next week.&lt;/p&gt;

&lt;p&gt;&amp;#8211; Divjot&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1465784">MONGOCRYPT-277</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY24Q1</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6jqv:s00029</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>