Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FAKE 5.8.4] PATH environment variable overwritten in DotNet.build #2134

Closed
SteveGilham opened this issue Oct 9, 2018 · 5 comments
Closed

Comments

@SteveGilham
Copy link
Contributor

Description

I have a program pre-build step which invokes pwsh, which is on the PATH; this step works fine in Visual Studio, and when built through a FAKE target that invokes DotNet.build on the relevant solution in FAKE <= 5.7.2; but on upgrading to 5.8.4 this step fails with

'pwsh' is not recognized as an internal or external command,
  operable program or batch file.

Repro steps

  1. Create a .net core project with the target
  <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="echo %PATH%" />
  </Target>
  1. build with Fake 5.8.4

Expected behavior

the value of PATH is as it would be outside the Fake script, as was the case with Fake 5.7.2, and in particular to still include C:\Program Files\PowerShell\6\

Actual behavior

In the build with Fake 5.8.4, this emits only

  C:\Program Files\dotnet;

Known workarounds

Currently, I've just reverted to 5.7.2
It would be possible to do the same work within the FAKE script, at the cost of making this particular project require building through Fake and not the IDE

Related information

  • Operating system -- WinX Home
  • Branch -- NuGet packages for 5.8.4
  • .NET Runtime, CoreCLR or Mono Version -- .net core 2.1.402
  • Indications of severity -- this is a significant, and possibly unintentional, change in behaviour at a minor release
  • Version of FAKE (4.X, 5.X) -- 5.8.4
@matthid
Copy link
Member

matthid commented Oct 9, 2018

Any chance for me to reproduce this?

@matthid
Copy link
Member

matthid commented Oct 9, 2018

Ah you say it reproduces with the minimal project file & usind dotnet build?

@SteveGilham
Copy link
Contributor Author

Yes, nothing fancy is involved in the build; in particular no environment mapping. If you have problems, then I'll do the cutting down of the real case.

@matthid
Copy link
Member

matthid commented Oct 10, 2018

@SteveGilham Should be fixed now with 5.8.5

@SteveGilham
Copy link
Contributor Author

@matthid -- Works like a charm. Thanks once again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants