Skip to content

Symlinks are extracted as absolute paths instead of relative paths #202

Closed
@nichmor

Description

@nichmor

Describe the bug
When extracting a zip archive containing symlinks using the zip-rs library, the symlinks are extracted as absolute paths instead of relative paths. This behavior is different from the default behavior observed when using other extraction tools like the macOS Archive Utility.

To Reproduce
Steps to reproduce the behavior:

  • Create a zip archive containing a binary and symlinks to that binary.
  • Extract the zip archive using the zip-rs library.
  • Compare the symlinks in the extracted content with the original symlinks.

zip-rs symlinks:

-rwxr-xr-x@ 1 graf  staff  182121136 Jun 26 13:40 pandoc
lrwxr-xr-x@ 1 graf  staff         48 Jun 26 13:40 pandoc-lua -> /Users/graf/projects/oss/rattler-build/examples/
lrwxr-xr-x@ 1 graf  staff         48 Jun 26 13:40 pandoc-server -> /Users/graf/projects/oss/rattler-build/examples/

Expected symlinks:

drwxr-xr-x  4 graf  staff        128 May 11 23:49 ..
-rwxr-xr-x  1 graf  staff  182121136 May 11 23:50 pandoc
lrwxr-xr-x  1 graf  staff          6 May 11 23:50 pandoc-lua -> pandoc
lrwxr-xr-x  1 graf  staff          6 May 11 23:50 pandoc-server -> pandoc

You can also test it directly by using this zip:
https://github.com/jgm/pandoc/releases/download/3.2/pandoc-3.2-arm64-macOS.zip

Expected behavior
The symlinks should be extracted with the same relative paths as in the original archive:

Desktop (please complete the following information):

  • OS: macos
  • Version 13.4

Additional context
This branch contain a test that show the issue and .sh script that pass same situation

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions