<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.2.4</td>
</tr>
</tbody>
</table>
<p dir="auto">Taking from this ticket : <a href="https://github.com/symfony/assetic-bundle/issues/428">https://github.com/symfony/assetic-bundle/issues/428</a><br>
Have the same problem.</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.2.x</td>
</tr>
</tbody>
</table>
<p dir="auto">This problem occurs after an upgrade to symfony 3.2.x if you use <a href="https://github.com/kriswallsmith/assetic/blob/master/src/Assetic/Filter/BaseProcessFilter.php#L51-L56">kriswallsmith/assetic</a> and have exported bash functions in your current environment variables. In previous versions they were ignored by <code class="notranslate">proc_open</code> but in the 3.2 branch they are added using a self built environment string which tries to load these functions into <code class="notranslate">sh</code> which respectfully declines. This causes a bc break.</p>
<p dir="auto">Results per <a href="https://github.com/symfony/process">symfony/process</a> version when adding a bash function environment variable:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Installed 3.1.*
========================================
hello world

Installed 3.2.0
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name

Installed *
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name

Installed 3.2.x-dev
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name

Installed dev-master
========================================
hello world"><pre lang="text" class="notranslate"><code class="notranslate">Installed 3.1.*
========================================
hello world

Installed 3.2.0
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name

Installed *
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name

Installed 3.2.x-dev
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name

Installed dev-master
========================================
hello world
</code></pre></div>
<p dir="auto">The script to check:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#!/usr/bin/env bash                                                                                                                                                                                                  
# Create and export bash function                                                                                                                                                                                    
foo() { echo 'bar'; }                                                                                                                                                                                                
export -f foo                                                                                                                                                                                                        
                                                                                                                                                                                                                     
# Load bash function foo and add it to a process                                                                                                                                                                     
# using a process builder, run it and show output.                                                                                                                                                                   
PHPCODE='                                                                                                                                                                                                            
require __DIR__ . &quot;/vendor/autoload.php&quot;;                                                                                                                                                                            
                                                                                                                                                                                                                     
$foo = getenv(&quot;BASH_FUNC_foo%%&quot;);                                                                                                                                                                                    
$pb = new \Symfony\Component\Process\ProcessBuilder([&quot;echo&quot;, &quot;hello world&quot;]);                                                                                                                                        
$pb-&gt;setEnv(&quot;BASH_FUNC_foo%%&quot;, $foo);                                                                                                                                                                                
$p = $pb-&gt;getProcess();                                                                                                                                                                                              
$p-&gt;run();                                                                                                                                                                                                           
                                                                                                                                                                                                                     
echo $p-&gt;getErrorOutput() . $p-&gt;getOutput() . PHP_EOL;                                                                                                                                                               
'                                                                                                                                                                                                                    
                                                                                                                                                                                                                     
# Try multiple versions of the symfony/process component                                                                                                                                                             
for VERSION in '3.1.*' '3.2.0' '*' '3.2.x-dev' 'dev-master'; do                                                                                                                                                      
    composer -q require symfony/process &quot;$VERSION&quot;                                                                                                                                                                   
    echo &quot;Installed $VERSION&quot;                                                                                                                                                                                        
    echo '=================='                                                                                                                                                                                        
    php -r &quot;$PHPCODE&quot;                                                                                                                                                                                                
done  "><pre class="notranslate"><span class="pl-c"><span class="pl-c">#!</span>/usr/bin/env bash                                                                                                                                                                                                  </span>
<span class="pl-c"><span class="pl-c">#</span> Create and export bash function                                                                                                                                                                                    </span>
<span class="pl-en">foo</span>() { <span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">'</span>bar<span class="pl-pds">'</span></span><span class="pl-k">;</span> }                                                                                                                                                                                                
<span class="pl-k">export</span> -f foo                                                                                                                                                                                                        
                                                                                                                                                                                                                     
<span class="pl-c"><span class="pl-c">#</span> Load bash function foo and add it to a process                                                                                                                                                                     </span>
<span class="pl-c"><span class="pl-c">#</span> using a process builder, run it and show output.                                                                                                                                                                   </span>
PHPCODE=<span class="pl-s"><span class="pl-pds">'</span>                                                                                                                                                                                                            </span>
<span class="pl-s">require __DIR__ . "/vendor/autoload.php";                                                                                                                                                                            </span>
<span class="pl-s">                                                                                                                                                                                                                     </span>
<span class="pl-s">$foo = getenv("BASH_FUNC_foo%%");                                                                                                                                                                                    </span>
<span class="pl-s">$pb = new \Symfony\Component\Process\ProcessBuilder(["echo", "hello world"]);                                                                                                                                        </span>
<span class="pl-s">$pb-&gt;setEnv("BASH_FUNC_foo%%", $foo);                                                                                                                                                                                </span>
<span class="pl-s">$p = $pb-&gt;getProcess();                                                                                                                                                                                              </span>
<span class="pl-s">$p-&gt;run();                                                                                                                                                                                                           </span>
<span class="pl-s">                                                                                                                                                                                                                     </span>
<span class="pl-s">echo $p-&gt;getErrorOutput() . $p-&gt;getOutput() . PHP_EOL;                                                                                                                                                               </span>
<span class="pl-s"><span class="pl-pds">'</span></span>                                                                                                                                                                                                                    
                                                                                                                                                                                                                     
<span class="pl-c"><span class="pl-c">#</span> Try multiple versions of the symfony/process component                                                                                                                                                             </span>
<span class="pl-k">for</span> <span class="pl-smi">VERSION</span> <span class="pl-k">in</span> <span class="pl-s"><span class="pl-pds">'</span>3.1.*<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>3.2.0<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>3.2.x-dev<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>dev-master<span class="pl-pds">'</span></span><span class="pl-k">;</span> <span class="pl-k">do</span>                                                                                                                                                      
    composer -q require symfony/process <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">$VERSION</span><span class="pl-pds">"</span></span>                                                                                                                                                                   
    <span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">"</span>Installed <span class="pl-smi">$VERSION</span><span class="pl-pds">"</span></span>                                                                                                                                                                                        
    <span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">'</span>==================<span class="pl-pds">'</span></span>                                                                                                                                                                                        
    php -r <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">$PHPCODE</span><span class="pl-pds">"</span></span>                                                                                                                                                                                                
<span class="pl-k">done</span>  </pre></div>