Build process doesn't have access to modified PATH

pzixel's Avatar


04 Sep, 2018 10:59 AM

I'm trying to test some codegen solution which uses external tool to build (solc in my case). It work like a charm locally, but when I'm trying to setup the build process it really doesn't.

I have following install section

  - mkdir C:\Solidity
  - ps: Invoke-WebRequest -OutFile C:\Solidity\
  - 7z e C:\Solidity\
  - SET PATH=C:\Solidity;%PATH%
  - solc --version

It works fine and output the correct version, so I see that PATH was modified successfully and it should be globally available.

Then I'm running the build which fails because of following guard check:

var process = new Process
    StartInfo = new ProcessStartInfo
        FileName = "solc",
        Arguments = "--version",
        UseShellExecute = false,
        RedirectStandardOutput = true,
        CreateNoWindow = true
    throw new InvalidOperationException("System doesn't have solc available in PATH.");

How could I make this exe be available when solution is building?

Here is example of failed build:

  1. Support Staff 1 Posted by Owen McDonnell on 04 Sep, 2018 10:34 PM

    Owen McDonnell's Avatar

    Setting the path that way only works for that session. To set in on the machine level try

    - ps: [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";C:\Solidity", "Machine")
    in place of the SET PATH command you now have.
  2. 2 Posted by pzixel on 05 Sep, 2018 10:53 AM

    pzixel's Avatar
    1. This code doesn't work because it leads to YML parsing error (see )
    2. If I move it to the powershell script it still not work (see )
  3. Support Staff 3 Posted by Owen McDonnell on 05 Sep, 2018 05:04 PM

    Owen McDonnell's Avatar

    Can you try adding this to the top of your appveyor.yml install: section

      - ps: |
          [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";C:\Solidity", "Machine")
      - ps: Restart-Computer
      - ps: Start-Sleep -s 10
  4. 4 Posted by pzixel on 07 Sep, 2018 09:23 AM

    pzixel's Avatar
  5. Support Staff 5 Posted by Owen McDonnell on 07 Sep, 2018 04:46 PM

    Owen McDonnell's Avatar

    Can you try also adding start-sleep before restart

     - ps: |
          [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";C:\Solidity", "Machine")
      - ps: Start-Sleep -s 10
      - ps: Restart-Computer
      - ps: Start-Sleep -s 10
  6. 6 Posted by pzixel on 09 Sep, 2018 08:07 PM

    pzixel's Avatar

    Build hangs after reboot anyway.

  7. Support Staff 7 Posted by Owen McDonnell on 10 Sep, 2018 06:04 AM

    Owen McDonnell's Avatar

    Can you share some more details (configuration file, build log, etc.)?
    Below are three builds in which I had no trouble restarting the build machine.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac