<p dir="auto">Hello Julia-ers!</p>
<p dir="auto">When adding remote workers with <code class="notranslate">addprocs()</code>, I would really love to be able to send my current working environment along for the new Julia workers. Currently this does not happen for workers added using an <code class="notranslate">SSHManager</code>, though local workers do seem to inherit the same environment.</p>
<p dir="auto">After browsing the repo, I think that this behavior could (gulp) easily be added by extending the code in <a href="https://github.com/JuliaLang/julia/blob/0d7248e2ff65bd6886ba3f003bf5aeab929edab5/base/distributed/managers.jl#L177">managers.jl</a> to set all, or some specified subset, of the current environment variables in the same way that <code class="notranslate">JULIA_WORKER_TIMEOUT</code> is set. Of course that might not be the default behavior, but maybe an option? Maybe something like (but not identical to):</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    # the default worker timeout
    tval = haskey(ENV, &quot;JULIA_WORKER_TIMEOUT&quot;) ?
        `export JULIA_WORKER_TIMEOUT=$(ENV[&quot;JULIA_WORKER_TIMEOUT&quot;])\;` : ``

    envvals = map(key-&gt;`export $(key)=$(ENV[key])\;`, keys(ENV))

    # Julia process with passed in command line flag arguments
    cmd = `cd $dir '&amp;&amp;' $tval $envvals $exename $exeflags`"><pre class="notranslate">    <span class="pl-c"><span class="pl-c">#</span> the default worker timeout</span>
    tval <span class="pl-k">=</span> <span class="pl-c1">haskey</span>(<span class="pl-c1">ENV</span>, <span class="pl-s"><span class="pl-pds">"</span>JULIA_WORKER_TIMEOUT<span class="pl-pds">"</span></span>) <span class="pl-k">?</span>
        <span class="pl-s"><span class="pl-pds">`</span>export JULIA_WORKER_TIMEOUT=$(ENV["JULIA_WORKER_TIMEOUT"])<span class="pl-cce">\;</span><span class="pl-pds">`</span></span> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">`</span><span class="pl-pds">`</span></span>

    envvals <span class="pl-k">=</span> <span class="pl-en">map</span>(key<span class="pl-k">-&gt;</span><span class="pl-s"><span class="pl-pds">`</span>export $(key)=$(ENV[key])<span class="pl-cce">\;</span><span class="pl-pds">`</span></span>, <span class="pl-c1">keys</span>(<span class="pl-c1">ENV</span>))

    <span class="pl-c"><span class="pl-c">#</span> Julia process with passed in command line flag arguments</span>
    cmd <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">`</span>cd $dir '&amp;&amp;' $tval $envvals $exename $exeflags<span class="pl-pds">`</span></span></pre></div>
<p dir="auto">Is this a reasonable thing to propose? Please let me know if this is a terrible idea! Otherwise I will be happy to attempt to implement this. I just wanted to float the idea here first.</p>
<p dir="auto">Thanks!</p>
<p dir="auto">Making the documentation omits <code class="notranslate">dates.rst</code> since it is not included in the main <code class="notranslate">index.rst</code> file.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ make html
...
/Users/jiahao/local/src/julia/doc/manual/dates.rst:5: WARNING: Duplicate explicit target name: &quot;here&quot;.
looking for now-outdated files... none found
pickling environment... done
checking consistency... /Users/jiahao/local/src/julia/doc/manual/dates.rst:: WARNING: document isn't included in any toctree
/Users/jiahao/local/src/julia/doc/stdlib/dates.rst:: WARNING: document isn't included in any toctree
..."><pre class="notranslate">$ make html
...
/Users/jiahao/local/src/julia/doc/manual/dates.rst:5: WARNING: Duplicate explicit target name: <span class="pl-s"><span class="pl-pds">"</span>here<span class="pl-pds">"</span></span>.
looking <span class="pl-k">for</span> now-outdated files... none found
pickling environment... <span class="pl-k">done</span>
checking consistency... /Users/jiahao/local/src/julia/doc/manual/dates.rst:: WARNING: document isn<span class="pl-s"><span class="pl-pds">'</span>t included in any toctree</span>
<span class="pl-s">/Users/jiahao/local/src/julia/doc/stdlib/dates.rst:: WARNING: document isn<span class="pl-pds">'</span></span>t included <span class="pl-k">in</span> any toctree
...</pre></div>
<p dir="auto">The fix is easy; just include the line <code class="notranslate">manual/dates</code> somewhere in <code class="notranslate">index.rst</code>, but I'm not sure what order the chapters should be in.</p>
<p dir="auto">cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/quinnj/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/quinnj">@quinnj</a></p>