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

Zip.zip removes all file permissions on linux/mac #2019

Closed
sriv opened this issue Jul 9, 2018 · 5 comments
Closed

Zip.zip removes all file permissions on linux/mac #2019

sriv opened this issue Jul 9, 2018 · 5 comments
Labels

Comments

@sriv
Copy link

sriv commented Jul 9, 2018

Description

Creating an archive using Zip.zip api, causes all file permissions to be lost on linux/macos.

Repro steps

Build Target source:

Target.create "Package" (fun _ ->
    !! ("artifacts/gauge-csharp/**/*")
    -- ("artifacts/gauge-csharp/tests/**/*")
    -- ("artifacts/gauge-csharp/itests/**/*")
    -- ("**/*.zip")
    |> Zip.zip "artifacts/gauge-csharp/" (sprintf @"artifacts/gauge-csharp/gauge-csharp-%s.zip" version)
)

Travis Build Logs:

https://travis-ci.org/getgauge/gauge-csharp/builds/401621274

Observe the below:

  1. ls original content: https://travis-ci.org/getgauge/gauge-csharp/jobs/401621276#L3066

  2. create the archive: https://travis-ci.org/getgauge/gauge-csharp/jobs/401621276#L3065

  3. extract archive: https://travis-ci.org/getgauge/gauge-csharp/jobs/401621276#L3080

  4. inspect extracted files: https://travis-ci.org/getgauge/gauge-csharp/jobs/401621276#L3141

Please provide the steps required to reproduce the problem

On Linux/macOS :

  1. git clone https://github.com/getgauge/gauge-csharp -b 137

  2. ./build.sh -t Package

  3. check original permissions: ls -al artifacts/gauge-csharp

  4. unzip artifacts/gauge-csharp/gauge-csharp-0.10.5.zip -d artifacts/gauge-csharp/out

  5. ls -al artifacts/gauge-csharp/out

Expected behavior

The file permissions should be the same before and after archiving.

Actual behavior

Extracted contents lose all file permissions:

drwxrwxr-x  4 travis travis 4096 Jul  9 05:43 .
drwxrwxr-x  7 travis travis 4096 Jul  9 05:43 ..
drwxrwxr-x 16 travis travis 4096 Jul  9 05:43 bin
----------  1 travis travis  550 Jul  9 05:42 csharp.json
----------  1 travis travis   58 Jul  9 05:42 run.sh
drwxrwxr-x  4 travis travis 4096 Jul  9 05:43 skel

Known workarounds

None, I am happy to try any suggestions.

Related information

  • Operating system : Ubuntu / macOS
  • Branch
  • Mono 5.0.0
  • .NET SDK: 2.1.301
@matthid
Copy link
Member

matthid commented Jul 9, 2018

Sadly this is afaik a limitation of the .net core framework. And I think there is an issue open for it.

I'm not 100% sure, but I think there is nothing we can do besides using 3rd party libs or our own zip reader/writer...

@sriv
Copy link
Author

sriv commented Jul 9, 2018

Thanks @matthid - I was going through the code of Fake.IO.Zip and figured that this is probably an upstream issue. I am temporarily resorting to using native zip invocation via the Process api. Not optimal, but it seems to be working.

I think I can close this issue, unless you need it to be tracked.

BTW, thanks for all the hard work. I just moved to Fake5 and I am impressed in the amount of details that you have put for migration. Cheers!

@matthid
Copy link
Member

matthid commented Jul 22, 2018

@sriv Yes we can close this here, but we should at least find the correct issue where this is tracked and link it here (or create a new one in the corefx repository if none exists).

@matthid matthid added the extern label Jul 22, 2018
@matthid matthid closed this as completed Jul 29, 2018
@matthid
Copy link
Member

matthid commented Jul 29, 2018

While I closed this: Changing the underlying implementation to one that supports this scenario is welcome and a PR would be merged. However it is out of scope for myself, but we can re-open if anyone starts to volunteer.

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