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

Synlinks: error when extracting archives built with --dereference #19

Closed
jwaldmann opened this issue May 30, 2016 · 6 comments
Closed

Comments

@jwaldmann
Copy link

When I build an archive with gnu tar, using --dereference, it cannot be unpacked by haskell-tar.

Simple test case is here: https://gitlab.imn.htwk-leipzig.de/waldmann/check-tar

This is creating a problem with keter, cf. snoyberg/keter#146

@jwaldmann
Copy link
Author

jwaldmann commented May 30, 2016

Ah, keter is not using the bundled extract function but rolls its own which silently ignores links: https://github.com/snoyberg/keter/blob/1b10ffabe436e67e51b4a0e4153740d085483239/Codec/Archive/TempTarball.hs#L87

So, that should be fixed on keter's side, but the bug here still stands. Perhaps it is a documentation bug.

@dcoutts
Copy link
Contributor

dcoutts commented Jun 1, 2016

The tar package does not create symlinks (partly because this is not supported on other systems and it's not supported by the directory package). It emulates them in a way that's portable to other platforms like windows by copying the files that are the target of the symlink but this does depend on the order of the files within the archive. If the symlink target is unpacked first then it's ok, but if it's unpacked later then it fails.

What would you suggest? That we emulate it better by maintaining a map of symlinks as we unpack and copy once at the end? Or that we use genuine symlinks on platforms that support it and do what on windows?

Up to know the tar package has mainly been there to support portable archives, rather than arbitrary platform-specific archives.

@dcoutts
Copy link
Contributor

dcoutts commented Sep 7, 2016

@jwaldmann ping ^^ if you have any opinion on this, that'd be most welcome.

@ivanperez-keera
Copy link

ivanperez-keera commented May 31, 2017

Symlinks have been supported by directory since 1.3.1.0:

https://hackage.haskell.org/package/directory-1.3.1.1/docs/System-Directory.html#v:createFileLink

@vmchale
Copy link

vmchale commented Aug 2, 2020

Up to know the tar package has mainly been there to support portable archives, rather than arbitrary platform-specific archives.

Such things are allowed, no? I mean it's a bit silly perhaps but I think one can e.g. put a file before the directory containing it.

@Bodigrim Bodigrim changed the title error when extracting archives built with --dereference Synlinks: error when extracting archives built with --dereference Nov 18, 2023
@Bodigrim
Copy link
Contributor

Probably fixed in #77, at least the reproducer does not fail any more for me.

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

No branches or pull requests

5 participants