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

FakeLib - ZipHelper tries to add it's own zip file to the zip #1346

Closed
metromg opened this issue Aug 5, 2016 · 1 comment
Closed

FakeLib - ZipHelper tries to add it's own zip file to the zip #1346

metromg opened this issue Aug 5, 2016 · 1 comment

Comments

@metromg
Copy link

metromg commented Aug 5, 2016

Description

When calling the Zip function and the workingDir matches with the target zip file directory, the ZipHelper tries to add the zip it is creating, to the zip.

This throws in a System.IO.IOException:
System.IO.IOException: The process cannot access the file '...' because it is being used by another process.

Repro steps

  1. Call the zip function with the zip file specified in the same directory as the working dir
Target "ZipOutputDir" (fun _ ->
    !! "./**/*"
      |> SetBaseDir build.OutputDir
      |> Zip build.OutputDir (build.OutputDir @@ solutionName + "." + build.Environment.``build.number`` + ".zip")
  )

Expected behavior

The Zip function should not try to add the zip file to the zip file and exclude it from the file sequence.

Actual behavior

The Zip function tries to add the zip file into the zip file, which throws the specified exception.

Known workarounds

A know workaround is to exclude the zip file from the files externally:

Target "ZipOutputDir" (fun _ ->
    !! "./**/*"
    -- "./*.zip"
      |> SetBaseDir build.OutputDir
      |> Zip build.OutputDir (build.OutputDir @@ solutionName + "." + build.Environment.``build.number`` + ".zip")
  )

Related information

  • Operating system: Windows 10
  • Branch: master 4.27.0
@matthid
Copy link
Member

matthid commented Feb 11, 2018

Honestly I'm not sure about this. What we can do is to use a temporary file, but that way the new zip-file will contain the old zip-file and it will just work. But that is not what you want, right?
I'll close this as "wont-fix" for now (as it is old) but feel free to discuss this further.

@matthid matthid closed this as completed Feb 11, 2018
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