<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Rust for closed-source projects	</title>
	<atom:link href="https://ntcore.com/rust-for-closed-source-projects/feed/" rel="self" type="application/rss+xml" />
	<link>https://ntcore.com/rust-for-closed-source-projects/</link>
	<description></description>
	<lastBuildDate>Wed, 17 Jul 2019 17:34:33 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>
		By: This Week In Rust: This Week In Rust 292 - RSSFeeds		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-364</link>

		<dc:creator><![CDATA[This Week In Rust: This Week In Rust 292 - RSSFeeds]]></dc:creator>
		<pubDate>Wed, 17 Jul 2019 17:34:33 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-364</guid>

					<description><![CDATA[[&#8230;] Rust for closed-source projects. [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Rust for closed-source projects. [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Erik Pistelli		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-363</link>

		<dc:creator><![CDATA[Erik Pistelli]]></dc:creator>
		<pubDate>Sat, 29 Jun 2019 05:41:19 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-363</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://ntcore.com/rust-for-closed-source-projects/#comment-362&quot;&gt;Stephan Sokolow&lt;/a&gt;.

There are some cases in which that is indeed a deal-breaker or, at least, wouldn&#039;t be practical. Take for instance a binary which needs to be injected into the address space of other processes, having external dependencies would require to map those first and it would pollute the address space. It certainly wouldn&#039;t be pretty. :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://ntcore.com/rust-for-closed-source-projects/#comment-362">Stephan Sokolow</a>.</p>
<p>There are some cases in which that is indeed a deal-breaker or, at least, wouldn&#8217;t be practical. Take for instance a binary which needs to be injected into the address space of other processes, having external dependencies would require to map those first and it would pollute the address space. It certainly wouldn&#8217;t be pretty. 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Stephan Sokolow		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-362</link>

		<dc:creator><![CDATA[Stephan Sokolow]]></dc:creator>
		<pubDate>Thu, 27 Jun 2019 18:46:41 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-362</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://ntcore.com/rust-for-closed-source-projects/#comment-361&quot;&gt;Erik Pistelli&lt;/a&gt;.

&lt;blockquote&gt;Well, there are some software solutions for which it is necessary to deploy a monolithic executable. These could be, for instance, utilities for forensic purposes, like evidence gathering. Having dependencies would be terrible if the solution needs to be made simple to deploy. Of course, with Qt DLLs it would be possible to write a self-extracting executable, but that wouldn’t be efficient neither in size nor performance.&lt;/blockquote&gt;

I could understand needing no external dependencies for a self-extractor stub, but I hadn&#039;t thought that, for the kinds of applications you mention, having a few DLLs next to the EXE would be a deal-breaker.

(Whether downloaded as a Zip file or an installer, that&#039;s how applications meant to run off flash drives or optical media work.)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://ntcore.com/rust-for-closed-source-projects/#comment-361">Erik Pistelli</a>.</p>
<blockquote><p>Well, there are some software solutions for which it is necessary to deploy a monolithic executable. These could be, for instance, utilities for forensic purposes, like evidence gathering. Having dependencies would be terrible if the solution needs to be made simple to deploy. Of course, with Qt DLLs it would be possible to write a self-extracting executable, but that wouldn’t be efficient neither in size nor performance.</p></blockquote>
<p>I could understand needing no external dependencies for a self-extractor stub, but I hadn&#8217;t thought that, for the kinds of applications you mention, having a few DLLs next to the EXE would be a deal-breaker.</p>
<p>(Whether downloaded as a Zip file or an installer, that&#8217;s how applications meant to run off flash drives or optical media work.)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Erik Pistelli		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-361</link>

		<dc:creator><![CDATA[Erik Pistelli]]></dc:creator>
		<pubDate>Thu, 27 Jun 2019 14:56:58 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-361</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://ntcore.com/rust-for-closed-source-projects/#comment-360&quot;&gt;Stephan Sokolow&lt;/a&gt;.

No problem. :)

Well, there are some software solutions for which it is necessary to deploy a monolithic executable. These could be, for instance, utilities for forensic purposes, like evidence gathering. Having dependencies would be terrible if the solution needs to be made simple to deploy. Of course, with Qt DLLs it would be possible to write a self-extracting executable, but that wouldn&#039;t be efficient neither in size nor performance. In some of these projects security and privacy are critical and building ones own compiler is quite common, for instance to introduce compiler-level obfuscation. That&#039;s why this article should be seen more as a starting point for these kind of projects.

The -s thing you mentioned is interesting. To be honest I haven&#039;t yet played much with Rust on Linux, but will keep this in mind when having to do so!

I agree it&#039;s important to mention official ways. I wrote this article (code + text) in less than a day and not surprisingly forgot to mention certain aspects. I&#039;ll elaborate in the article on the aspects you rightly mentioned in the upcoming days (as soon as I find some free time :).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://ntcore.com/rust-for-closed-source-projects/#comment-360">Stephan Sokolow</a>.</p>
<p>No problem. 🙂</p>
<p>Well, there are some software solutions for which it is necessary to deploy a monolithic executable. These could be, for instance, utilities for forensic purposes, like evidence gathering. Having dependencies would be terrible if the solution needs to be made simple to deploy. Of course, with Qt DLLs it would be possible to write a self-extracting executable, but that wouldn&#8217;t be efficient neither in size nor performance. In some of these projects security and privacy are critical and building ones own compiler is quite common, for instance to introduce compiler-level obfuscation. That&#8217;s why this article should be seen more as a starting point for these kind of projects.</p>
<p>The -s thing you mentioned is interesting. To be honest I haven&#8217;t yet played much with Rust on Linux, but will keep this in mind when having to do so!</p>
<p>I agree it&#8217;s important to mention official ways. I wrote this article (code + text) in less than a day and not surprisingly forgot to mention certain aspects. I&#8217;ll elaborate in the article on the aspects you rightly mentioned in the upcoming days (as soon as I find some free time :).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Stephan Sokolow		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-360</link>

		<dc:creator><![CDATA[Stephan Sokolow]]></dc:creator>
		<pubDate>Thu, 27 Jun 2019 11:27:24 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-360</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://ntcore.com/rust-for-closed-source-projects/#comment-359&quot;&gt;Erik Pistelli&lt;/a&gt;.

First, I&#039;d like to apologize. I just realized that I was probably subconsciously thinking of you as a script kiddie because you wrote that &quot;a C++ developer can easily program in any C-dialect (Java, C#, Go, JS, etc.)&quot;. (None of those languages are C dialects, any more than French is a dialect of Latin. Heck, French is more closely related to Latin than those languages are to C and it&#039;s still not a dialect of Latin.)

That said, maintaining a patched in-house build of a compiler which sees releases every six weeks does still feel excessive to me, especially with the work done on &lt;code&gt;--remap-path-prefix&lt;/code&gt; to cover the most glaring privacy leak.

Maybe I&#039;m missing something, but, to me, it sounds like pouring in far too much effort for the reward you&#039;ll get out out it, like executives spending massive sums to license DRM which just gets cracked within the first week anyway or technicians putting black tape over the status lights on the network switches in their data centers to protect customer privacy.

Also, I was a bit disappointed that you didn&#039;t elaborate on &lt;em&gt;why&lt;/em&gt; statically linking Qt was the only viable option, as opposed to dynamically linking against the LGPLed version.

Second, regarding my earlier comment, I experimented a bit and discovered that adding &lt;code&gt;-C link-arg=&#039;-s&#039;&lt;/code&gt; to &lt;code&gt;RUSTFLAGS&lt;/code&gt; to strip build symbols on a GNU toolchain without a separate &lt;code&gt;strip&lt;/code&gt; run can sometimes cause build failures depending on how the project is set up. The workaround is to compile the project with &lt;code&gt;cargo rustc -- -C link-arg=&#039;-s&#039;&lt;/code&gt; instead of relying on &lt;code&gt;RUSTFLAGS&lt;/code&gt;.

&lt;blockquote&gt;You’re right about the compatibility for XP, it can be specified as option for the linker. I usually don’t care about this, because I run a post-build script to check for non-XP-compatible APIs and provide an emulation layer for them as described in one of my previous articles.&lt;/blockquote&gt;

The reason I advise the linker option is that it&#039;s always good practice to encourage people toward the officially supported option, since that&#039;s what gets the testing and what any new team member or potential successor will be more familiar with, regardless of how much infrastructure you&#039;ve built for verifying that the output is still correct. Otherwise, it&#039;s like gratuitous use of &lt;code&gt;unsafe&lt;/code&gt; just because you find the Rust idioms unappealing in some way. (And someone is liable to wander in off Google who &lt;em&gt;won&#039;t&lt;/em&gt; be as thorough as you.)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://ntcore.com/rust-for-closed-source-projects/#comment-359">Erik Pistelli</a>.</p>
<p>First, I&#8217;d like to apologize. I just realized that I was probably subconsciously thinking of you as a script kiddie because you wrote that &#8220;a C++ developer can easily program in any C-dialect (Java, C#, Go, JS, etc.)&#8221;. (None of those languages are C dialects, any more than French is a dialect of Latin. Heck, French is more closely related to Latin than those languages are to C and it&#8217;s still not a dialect of Latin.)</p>
<p>That said, maintaining a patched in-house build of a compiler which sees releases every six weeks does still feel excessive to me, especially with the work done on <code>--remap-path-prefix</code> to cover the most glaring privacy leak.</p>
<p>Maybe I&#8217;m missing something, but, to me, it sounds like pouring in far too much effort for the reward you&#8217;ll get out out it, like executives spending massive sums to license DRM which just gets cracked within the first week anyway or technicians putting black tape over the status lights on the network switches in their data centers to protect customer privacy.</p>
<p>Also, I was a bit disappointed that you didn&#8217;t elaborate on <em>why</em> statically linking Qt was the only viable option, as opposed to dynamically linking against the LGPLed version.</p>
<p>Second, regarding my earlier comment, I experimented a bit and discovered that adding <code>-C link-arg='-s'</code> to <code>RUSTFLAGS</code> to strip build symbols on a GNU toolchain without a separate <code>strip</code> run can sometimes cause build failures depending on how the project is set up. The workaround is to compile the project with <code>cargo rustc -- -C link-arg='-s'</code> instead of relying on <code>RUSTFLAGS</code>.</p>
<blockquote><p>You’re right about the compatibility for XP, it can be specified as option for the linker. I usually don’t care about this, because I run a post-build script to check for non-XP-compatible APIs and provide an emulation layer for them as described in one of my previous articles.</p></blockquote>
<p>The reason I advise the linker option is that it&#8217;s always good practice to encourage people toward the officially supported option, since that&#8217;s what gets the testing and what any new team member or potential successor will be more familiar with, regardless of how much infrastructure you&#8217;ve built for verifying that the output is still correct. Otherwise, it&#8217;s like gratuitous use of <code>unsafe</code> just because you find the Rust idioms unappealing in some way. (And someone is liable to wander in off Google who <em>won&#8217;t</em> be as thorough as you.)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Erik Pistelli		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-359</link>

		<dc:creator><![CDATA[Erik Pistelli]]></dc:creator>
		<pubDate>Thu, 27 Jun 2019 06:31:30 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-359</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://ntcore.com/rust-for-closed-source-projects/#comment-357&quot;&gt;Stephan Sokolow&lt;/a&gt;.

It&#039;s true that there&#039;s a linker option to stop the generation of debug information. I don&#039;t use that option simply because if for some reason there&#039;s a crash, the user can send me the crash dump and I have a PDB (debug symbols) to work with for the release executable. So if I just strip the debug path as a post build step, I don&#039;t lose this capability. I always do that for all my builds, no matter the language. But the removal of the debug path is just a side-note in the article, not the main topic and the script for it is like 10 lines of code, so not really a big effort there. :) However, I should have pointed out the reason for doing this.

You&#039;re right about the compatibility for XP, it can be specified as option for the linker. I usually don&#039;t care about this, because I run a post-build script to check for non-XP-compatible APIs and provide an emulation layer for them as described in one of my previous articles. But it&#039;s good to point it out!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://ntcore.com/rust-for-closed-source-projects/#comment-357">Stephan Sokolow</a>.</p>
<p>It&#8217;s true that there&#8217;s a linker option to stop the generation of debug information. I don&#8217;t use that option simply because if for some reason there&#8217;s a crash, the user can send me the crash dump and I have a PDB (debug symbols) to work with for the release executable. So if I just strip the debug path as a post build step, I don&#8217;t lose this capability. I always do that for all my builds, no matter the language. But the removal of the debug path is just a side-note in the article, not the main topic and the script for it is like 10 lines of code, so not really a big effort there. 🙂 However, I should have pointed out the reason for doing this.</p>
<p>You&#8217;re right about the compatibility for XP, it can be specified as option for the linker. I usually don&#8217;t care about this, because I run a post-build script to check for non-XP-compatible APIs and provide an emulation layer for them as described in one of my previous articles. But it&#8217;s good to point it out!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Erik Pistelli		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-358</link>

		<dc:creator><![CDATA[Erik Pistelli]]></dc:creator>
		<pubDate>Thu, 27 Jun 2019 06:28:35 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-358</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://ntcore.com/rust-for-closed-source-projects/#comment-356&quot;&gt;Anonymous&lt;/a&gt;.

Yes, why not. :) Thank you for pointing it out.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://ntcore.com/rust-for-closed-source-projects/#comment-356">Anonymous</a>.</p>
<p>Yes, why not. 🙂 Thank you for pointing it out.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Stephan Sokolow		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-357</link>

		<dc:creator><![CDATA[Stephan Sokolow]]></dc:creator>
		<pubDate>Wed, 26 Jun 2019 22:18:43 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-357</guid>

					<description><![CDATA[If it&#039;s just getting rid of embedded debugging information that you want, then you wasted a lot of time re-implementing an inferior alternative to the official solution.

For the MSVC version of the Windows toolchain, see &lt;a href=&quot;https://users.rust-lang.org/t/compile-in-release-mode-without-debugging-symbols/19764&quot; rel=&quot;nofollow ugc&quot;&gt;this thread&lt;/a&gt;.

(And, if you ever decide to use the GNU version of the Windows toolchain, add &lt;code&gt;-C link-arg=&#039;-s&#039;&lt;/code&gt; to your &lt;code&gt;RUSTFLAGS&lt;/code&gt; or run &lt;code&gt;strip&lt;/code&gt; on the binary after compiling it. (You can find an EXE-capable copy of strip in &lt;a href=&quot;http://mingw.org/&quot; rel=&quot;nofollow ugc&quot;&gt;MinGW&lt;/a&gt; or &lt;a href=&quot;https://www.cygwin.com/&quot; rel=&quot;nofollow ugc&quot;&gt;Cygwin&lt;/a&gt;.)

As for targeting Windows XP, the proper way is to ask for it in the linking phase by passing through &lt;code&gt;/SUBSYSTEM:CONSOLE,5.01&lt;/code&gt;.

I don&#039;t have a Windows machine handy to confirm, but I think the proper way to do what you wrote in this blog post is to set &lt;code&gt;RUSTFLAGS&lt;/code&gt; to &lt;code&gt;-C link-args=&quot;/DEBUG:NONE /SUBSYSTEM:CONSOLE,5.01&quot;&lt;/code&gt;.]]></description>
			<content:encoded><![CDATA[<p>If it&#8217;s just getting rid of embedded debugging information that you want, then you wasted a lot of time re-implementing an inferior alternative to the official solution.</p>
<p>For the MSVC version of the Windows toolchain, see <a href="https://users.rust-lang.org/t/compile-in-release-mode-without-debugging-symbols/19764" rel="nofollow ugc">this thread</a>.</p>
<p>(And, if you ever decide to use the GNU version of the Windows toolchain, add <code>-C link-arg='-s'</code> to your <code>RUSTFLAGS</code> or run <code>strip</code> on the binary after compiling it. (You can find an EXE-capable copy of strip in <a href="http://mingw.org/" rel="nofollow ugc">MinGW</a> or <a href="https://www.cygwin.com/" rel="nofollow ugc">Cygwin</a>.)</p>
<p>As for targeting Windows XP, the proper way is to ask for it in the linking phase by passing through <code>/SUBSYSTEM:CONSOLE,5.01</code>.</p>
<p>I don&#8217;t have a Windows machine handy to confirm, but I think the proper way to do what you wrote in this blog post is to set <code>RUSTFLAGS</code> to <code>-C link-args="/DEBUG:NONE /SUBSYSTEM:CONSOLE,5.01"</code>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anonymous		</title>
		<link>https://ntcore.com/rust-for-closed-source-projects/#comment-356</link>

		<dc:creator><![CDATA[Anonymous]]></dc:creator>
		<pubDate>Wed, 26 Jun 2019 19:33:48 +0000</pubDate>
		<guid isPermaLink="false">https://ntcore.com/?p=641#comment-356</guid>

					<description><![CDATA[If you&#039;re going to compile out all of that metadata, why not switch to panic=abort, which makes smaller binaries as well?]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re going to compile out all of that metadata, why not switch to panic=abort, which makes smaller binaries as well?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
