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

Setting Fake.Core.Process.setKillCreatedProcesses to false is ignored? #1814

Closed
richardjharding opened this issue Mar 9, 2018 · 1 comment
Labels

Comments

@richardjharding
Copy link
Contributor

Description

I'm using 5.0.0-beta023 to start a docker process and not wait for it to complete, I don't want the process to be killed by the FAKE clean up so I have set

Process.setKillCreatedProcesses false

Here is the target:

arget.Create "Docker run" (fun _ ->     
    printfn "docker path to %s" dockerPath
    Process.setKillCreatedProcesses false   

    let imageIdString = File.readLine (System.IO.Path.Combine(__SOURCE_DIRECTORY__,  "image.txt")) 
    printfn "%s" imageIdString
    let iamgeId = String.split ':' imageIdString |> Seq.last    
    printfn "kill set to %b" (Process.shouldKillCreatedProcesses())
    Process.Start (fun startInfo ->   {startInfo with FileName = dockerPath; Arguments = (sprintf "run -p 5000:5000 %s" iamgeId) } )    
)

and here is part of the output from the run

Starting Target: Docker run (==> Docker build)
  NoDescription
docker path to C:\Program Files\Docker\Docker\Resources\bin\docker.EXE
sha256:a25d945bfbf23cfbbca334a91df0e97c2e2f092552a5d7acc835f986105f40d4
kill set to false
Finished Target: Docker run

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target                 Duration
------                 --------
GenerateAssemblyInfo   00:00:01.1856364
Publish API Project    00:00:06.9323049
Docker build           00:00:06.2952326
Docker run             00:00:00.0528839
Total:                 00:00:14.4960976
Status:                Ok
---------------------------------------------------------------------
Killing all processes that are created by FAKE and are still running.
Trying to kill docker
Trying to kill process docker (Id = 16400)

I had expected the process to be left running having set the flag on Process ?

Is this a bug or am I misunderstanding how its designed to work?

@matthid
Copy link
Member

matthid commented Mar 14, 2018

Yes this is a bug, thanks for reporting this. Will be fixed with beta025.

@matthid matthid added the bug label Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants