<table><tr><td style="">mwolff requested changes to this revision.<br />mwolff added inline comments.<br />This revision now requires changes to proceed.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D5447">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113561">View Inline</a><span style="color: #4b4d51; font-weight: bold;">runtimecontroller.cpp:56</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QString</span> <span class="n">findExecutable</span><span class="p">(</span><span style="color: #aa4000">const</span> <span class="n">QString</span><span style="color: #aa2211">&</span> <span class="n">executableName</span><span class="p">,</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                           <span style="color: #aa4000">const</span> <span class="n">QStringList</span><span style="color: #aa2211">&</span> <span class="n">paths</span> <span style="color: #aa2211">=</span> <span class="n">QStringList</span><span class="p">())</span> <span style="color: #aa4000">const</span> <span style="color: #aa4000">override</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">return</span> <span class="n">QStandardPaths</span><span style="color: #aa2211">::</span><span class="n">findExecutable</span><span class="p">(</span><span class="n">executableName</span><span class="p">,</span> <span class="n">paths</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">brace on its own line please</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113562">View Inline</a><span style="color: #4b4d51; font-weight: bold;">androidruntime.cpp:98</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">if</span><span class="p">(</span><span class="n">paths</span><span class="p">.</span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">auto</span> <span class="n">envPaths</span> <span style="color: #aa2211">=</span> <span class="n">getenv</span><span class="p">(</span><span style="color: #766510">"PATH"</span><span class="p">).</span><span class="n">split</span><span class="p">(</span><span style="color: #766510">':'</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">std</span><span style="color: #aa2211">::</span><span class="n">transform</span><span class="p">(</span><span class="n">envPaths</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">envPaths</span><span class="p">.</span><span class="n">end</span><span class="p">(),</span> <span class="n">rtPaths</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;"><a href="https://phabricator.kde.org/p/arrowd/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@arrowd</a> the PATH list here should still be going through <tt style="background: #ebebeb; font-size: 13px;">pathInHost</tt>, otherwise it will point to the wrong directories. so it would be something like:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">QStringList rtPaths = paths;
if (rtPaths.isEmpty()) {
    // transform "PATH" env var values into rtPaths
}
// lookup using rtPaths</pre></div>

<p style="padding: 0; margin: 8px;"><a href="https://phabricator.kde.org/p/apol/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@apol</a> how would you implement this?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113563">View Inline</a><span style="color: #4b4d51; font-weight: bold;">compilerfactories.cpp:51</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="bright"></span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span class="n"><span class="bright">QString</span></span><span class="bright"> </span><span class="n"><span class="bright">clang</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span class="n"><span class="bright">QStringLiteral</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"clang"</span></span><span class="bright"></span><span class="p"><span class="bright">);</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="bright"></span><span style="color: #74777d"><span class="bright">// no need to check the result, we already do this is CompilerProvider::CompilerProvider()</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">const</span> <span class="n">QString</span> <span class="n">clang</span> <span style="color: #aa2211">=</span> <span class="n">QStandardPaths</span><span style="color: #aa2211">::</span><span class="n">findExecutable</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"clang"</span><span class="p">));</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">shouldn't be required, we find the executable internally by name after all</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113564">View Inline</a><span style="color: #4b4d51; font-weight: bold;">compilerfactories.cpp:74</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span style="color: #aa4000">const</span> <span class="n">QString</span> <span class="n">gcc</span> <span style="color: #aa2211">=</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"gcc"</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">const</span> <span class="n">QString</span> <span class="n">gcc</span> <span style="color: #aa2211">=</span> <span class="n">QSt<span class="bright">andardPaths</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">findExecutable</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">QSt</span>ringLiteral</span><span class="p">(</span><span style="color: #766510">"gcc"<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">dito</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113565">View Inline</a><span style="color: #4b4d51; font-weight: bold;">compilerfactories.cpp:92</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="n">provider</span><span style="color: #aa2211">-></span><span class="n">registerCompiler</span><span class="p">(</span><span class="n">createCompiler</span><span class="p">(</span><span class="n">name</span><span class="p">(),</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"cl.exe"</span><span class="p">),</span> <span style="color: #304a96">false</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">provider</span><span style="color: #aa2211">-></span><span class="n">registerCompiler</span><span class="p">(</span><span class="n">createCompiler</span><span class="p">(</span><span class="n">name</span><span class="p">(),</span> <span class="n">QSt<span class="bright">andardPaths</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">findExecutable</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">QSt</span>ringLiteral</span><span class="p">(</span><span style="color: #766510">"cl.exe"<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">)</span>),</span> <span style="color: #304a96">false</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; "><span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">dito</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113566">View Inline</a><span style="color: #4b4d51; font-weight: bold;">compilerprovider.cpp:264</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">    <span style="color: #aa4000">for</span> <span class="p">(</span> <span style="color: #aa4000">const</span> <span class="n">CompilerPointer</span><span style="color: #aa2211">&</span> <span style="color: #a0a000">compiler</span> <span class="p">:</span> <span class="n">m_compilers</span> <span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="bright"></span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">bool</span></span><span class="bright"> </span><span class="n"><span class="bright">absolutePath</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span class="n"><span class="bright">QDir</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">::</span></span><span class="bright"></span><span class="n"><span class="bright">isAbsolutePath</span></span><span class="p">(</span><span class="n">compiler</span><span style="color: #aa2211">-></span><span class="n">path</span><span class="p">())<span class="bright">;</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span style="color: #aa4000">if</span> <span class="p">((</span><span class="n">absolutePath</span> <span style="color: #aa2211">&&</span> <span class="n">QFileInfo</span><span style="color: #aa2211">::</span><span class="n">exists</span><span class="p">(</span><span class="n">rt</span><span style="color: #aa2211">-></span><span class="n">pathInHost</span><span class="p">(</span><span class="n">Path</span><span class="p">(</span><span class="n">compiler</span><span style="color: #aa2211">-></span><span class="n">path</span><span class="p">())).</span><span class="n">toLocalFile</span><span class="p">()))</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">            <span style="color: #aa2211">||</span> <span class="n">QStandardPaths</span><span style="color: #aa2211">::</span><span class="n">findExecutable</span><span class="p">(</span> <span class="n">compiler</span><span style="color: #aa2211">-></span><span class="n">path</span><span class="p">(),</span> <span class="n">path</span><span class="p">).</span><span class="n">isEmpty</span><span class="p">()</span> <span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="bright"></span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">rt</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">-></span></span><span class="bright"></span><span class="n"><span class="bright">findExecutable</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">QFileInfo</span></span><span class="p">(</span><span class="n">compiler</span><span style="color: #aa2211">-></span><span class="n">path</span><span class="p">())<span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">fileName</span></span><span class="bright"></span><span class="p"><span class="bright">()).</span></span><span class="bright"></span><span class="n"><span class="bright">isEmpty</span></span><span class="bright"></span><span class="p"><span class="bright">())</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa4000">continue</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">remove the <tt style="background: #ebebeb; font-size: 13px;">QFileInfo</tt> and <tt style="background: #ebebeb; font-size: 13px;">.fileName()</tt> here, just use the path like previously. note how the path could be an absolute path not inside the PATH, your patch would break this</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113567">View Inline</a><span style="color: #4b4d51; font-weight: bold;">dockerruntime.cpp:256</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">if</span><span class="p">(</span><span class="n">paths</span><span class="p">.</span><span class="n">empty</span><span class="p">())</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">auto</span> <span class="n">envPaths</span> <span style="color: #aa2211">=</span> <span class="n">getenv</span><span class="p">(</span><span style="color: #766510">"PATH"</span><span class="p">).</span><span class="n">split</span><span class="p">(</span><span style="color: #766510">':'</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">all I said in the android runtime applies here too I believe</p>

<p style="padding: 0; margin: 8px;">also, the code is identical, so share it trough some "runtime helper header"</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D5447#inline-113568">View Inline</a><span style="color: #4b4d51; font-weight: bold;">flatpakruntime.cpp:235</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                                       <span style="color: #aa4000">const</span> <span class="n">QStringList</span><span style="color: #aa2211">&</span> <span class="n">paths</span><span class="p">)</span> <span style="color: #aa4000">const</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QStringList</span> <span class="n">rtPaths</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">dito</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5447">https://phabricator.kde.org/D5447</a></div></div><br /><div><strong>To: </strong>arrowd, mwolff, arichardson<br /><strong>Cc: </strong>skalinichev, apol, kdevelop-devel<br /></div>