tag:help.appveyor.com,2012-11-13:/discussions/suggestions/183-request-set-homedrive-and-homepath-environment-variables-by-defaultAppVeyor: Discussion 2018-08-25T01:37:39Ztag:help.appveyor.com,2012-11-13:Comment/319344622014-03-05T17:12:08Z2014-03-05T17:12:08ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Hi Tony,</p>
<p>Thanks for the kind words! I'm glad you like the service.</p>
<p>Sure, we will add HOME, HOMEDRIVE and HOMEPATH variables to
default environment.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-05T20:03:07Z2014-03-05T20:03:07ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Great, thanks! Look forward to being able to remove some clutter
from my appveyor.yml.</p>
<p>To clarify, I think it’s better if HOME remains unset,
only setting HOMEDRIVE and HOMEPATH by default. I believe
that’s the most common setup on Windows systems. The reason
Julia’s package manager looks in HOME first is for *nix
OS’es, so it’s actually good to test that the fallback
is working in a way that will be representative of user
systems.</p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-05T21:46:39Z2014-03-05T21:46:39ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Thanks for clarification!</p>
<p>HOME variable is anyway set when cloning private repositories -
it's needed for SSH to work.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-07T17:33:17Z2014-03-07T17:33:17ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Apparently, HOMEDRIVE and HOMEPATH are set by default on Windows
Server :)</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-08T10:12:30Z2014-03-08T10:12:30ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Really? I'm still not seeing them defined: <a href=
"https://ci-beta.appveyor.com/project/tkelman/json-jl/build/1.0.23">
https://ci-beta.appveyor.com/project/tkelman/json-jl/build/1.0.23</a><br>
(ignore the warning about CPU_CORES, that's happening inside
Julia)</p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-08T16:19:21Z2014-03-08T16:19:21ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Sure, will take a look.</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T00:32:23Z2014-03-11T00:32:23ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>This is now live and working, thanks!</p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T00:36:28Z2014-03-11T00:36:28ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Wow, it was deployed 5 minutes ago and I was going to update you
:)</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T00:58:24Z2014-03-11T00:59:00ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Cool. I was doing some other work and noticed something had
changed between builds - <code>git clone</code> gives progress
messages now which it didn't do before, and <code>if</code> doesn't
seem to work in cmd script lines any more?<br>
<code>'if' is not recognized as an internal or external command,
operable program or batch file.</code></p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:05:40Z2014-03-11T01:05:40ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>It was changed how AppVeyor calls batch commands - now every
command runs in external process, not in PS runspace (StdErr is
redirected to StdOur, that's why git clone shows progress - I was
doing that to make node.js working nicely in AppVeyor
environment).</p>
<p>However, the way script blocks are interpreted was not changed.
As before "cmd" script is broken into lines and each line is run as
separate command; "ps" blocks run entirely.</p>
<p>If you need control-flow logic use PowerShell.</p>
<p>Can you paste a script that was working before update?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:12:46Z2014-03-11T01:13:46ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>That makes sense, I was already redirecting stderr to stdout
myself so fewer normal messages showed up in red as
NativeCommandError from PowerShell.</p>
<p>Relevant pieces of what I was doing:<br></p>
<pre>
<code>environment:
matrix:
- XC_HOST: "i686-w64-mingw32"
- XC_HOST: "x86_64-w64-mingw32"
install:
- "cinst cyg-get > cyg-get.log"
- set PATH=%PATH%;C:\cygwin
- "if %XC_HOST% == x86_64-w64-mingw32 (cyg-get mingw64-x86_64-gcc-g++) else (cyg-get mingw64-i686-gcc-g++)"</code>
</pre>
<p>I'll work out how to do the same thing in PowerShell, it was
just a bit more concise this way.</p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:24:15Z2014-03-11T01:24:15ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Oh, I see.</p>
<p>In the latest update command is pre-pended with "call " - this
is to make guys like <code>npm</code>, <code>gem</code> and
apparently child batch scripts do not aborting the batch (more info
here: <a href=
"http://stackoverflow.com/questions/9773486/batch-file-closes-before-completing-all-lines">
http://stackoverflow.com/questions/9773486/batch-file-closes-before...</a>),
so your command becomes "call if ...".</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:28:51Z2014-03-11T01:29:10ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>UPDATE: Working on recent support requests showed that for
people is more natural to write in appveyor.yml <code>gem update
--system</code> or <code>myscript.cmd</code> versus <code>call gem
update --system</code> or <code>call myscript.cmd</code>.</p>
<p>Maybe we can do kinda hard-code for 'if' batch clause? ;)</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:39:05Z2014-03-11T01:39:05ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>OK, added exceptions for <code>IF</code> and <code>FOR</code>.
Will deploy shortly.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:44:33Z2014-03-11T01:51:08ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>It was pretty trivial to use powershell instead:<br>
<code>ps: if ($env:XC_HOST -eq "x86_64-w64-mingw32") {cyg-get
mingw64-x86_64-gcc-g++} else {cyg-get
mingw64-i686-gcc-g++}</code></p>
<p>I was using some output redirection to a file because cyg-get is
very noisy, I'm figuring out if I can still do that easily.</p>
<p>Yep, worked fine as<br>
<code>ps: 'if ($env:XC_HOST -eq "x86_64-w64-mingw32") {cyg-get
mingw64-x86_64-gcc-g++ >> cyg-get.log} else {cyg-get
mingw64-i686-gcc-g++ >> cyg-get.log}'</code> Extra quotes
just for good measure since >> can occasionally confuse the
YAML parsing.</p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:45:21Z2014-03-11T01:45:21ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>OK, nice.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:48:59Z2014-03-11T01:48:59ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>While you're tweaking things, <code>-q</code> on the initial
clone will be nice to make logs shorter now that stderr messages
are showing up there.</p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T01:57:51Z2014-03-11T01:57:51ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>OK, makes sense.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T05:21:58Z2014-03-11T05:21:58ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>You mean you see those <code>Checking out files</code> in the
log? Can you send an example?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T05:29:51Z2014-03-11T05:29:51ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Sure, see <a href=
"https://ci-beta.appveyor.com/project/tkelman/julia/build/1.0.205">https://ci-beta.appveyor.com/project/tkelman/julia/build/1.0.205</a></p>
<p>I think it needs to be a relatively large repo to notice.</p></div>tonytag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T05:32:51Z2014-03-11T05:32:51ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Indeed, I see now. Thanks!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/319344622014-03-11T06:10:34Z2014-03-11T06:10:34ZRequest: set HOMEDRIVE and HOMEPATH environment variables by default<div><p>Fixed, will be deployed shortly.</p></div>Feodor Fitsner