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

Add support for bsdtar #169

Closed
tpgxyz opened this issue Mar 10, 2018 · 19 comments
Closed

Add support for bsdtar #169

tpgxyz opened this issue Mar 10, 2018 · 19 comments
Labels
enhancement feature request, rfe

Comments

@tpgxyz
Copy link

tpgxyz commented Mar 10, 2018

Short description of the problem

Currently mock supports tar from GNU, while bsdtar from libarchive is not supported

Output of rpm -q mock

Steps to reproduce issue

  1. Set up bsdtar as default tar
  2. Observe mock failure

Do not forget to mention full commandline with the mock command you executed.

Any additional notes

Consider adding output of mock --debug-config this can help developers to reproduce the issue.

@xsuchy xsuchy added the enhancement feature request, rfe label Mar 10, 2018
@xsuchy
Copy link
Member

xsuchy commented Mar 10, 2018

What would be the benefit? I am afraid that this is soooo low prio, that it will not happen unless someone (you) send a patch.

@praiskup
Copy link
Member

GNU tar is supposed to be the default on GNU/Linux distro. Btw.:

$ rpm -q mock
mock-1.4.9-1.fc27.noarch

@praiskup
Copy link
Member

Is this issue related to mock scm plugin?

@tpgxyz
Copy link
Author

tpgxyz commented Mar 19, 2018

@xsuchy @praiskup All calls to tar inside mock code are not compatible with bsdtar https://github.com/libarchive/libarchive

@Conan-Kudo
Copy link
Member

To give a more detailed explanation here:

OpenMandriva is in the process of switching to rpm.org rpm and DNF. As a part of this, their build system build engine is changing to mock. However, they replaced GNU tar with libarchive's tar back in OpenMandriva Lx 3, and libarchive's tar works slightly differently.

A proper patch for this would probably involve making it configurable to use either tar (expecting GNU tar) or bsdtar for libarchive's tar. What would be required for that, I don't yet know, but that's what I think would be required.

@praiskup
Copy link
Member

Thanks @Conan-Kudo, it is starting to make sense. As a sum-up, those are the missing bits

  • what are the concrete differences in behavior between tar and bsdtar we face here
  • how OpenMandriva replaced package named 'tar' with 'bsdtar', who provides /bin/tar there
  • what it means "configurable" to use either tar or bsdtar (on mock.spec level, or ./configure?,
    it's no longer there..)

What would be required for that, I don't yet know, but that's what I think would be required.

Where this is discussed?

@Conan-Kudo
Copy link
Member

@praiskup

what it means "configurable" to use either tar or bsdtar (on mock.spec level, or ./configure?,
it's no longer there..)

This probably would be a switch in the site-defaults.cfg/mock target config, since we don't have any other configuration mechanism.

Where this is discussed?

I'm not sure what you mean?

@praiskup
Copy link
Member

praiskup commented Apr 24, 2018 via email

@Conan-Kudo
Copy link
Member

No, this was discussed on IRC in #OpenMandriva-Cooker some time ago. The switch to bsdtar occurred two years ago, and GNU tar is no longer in the base system package set at all.

There was an attempt to patch mock to forcibly switch it to bsdtar, but it didn't work, so currently we have a relatively unmaintained version of the gnutar package providing it as gtar (like on macOS and BSD) and we patch mock to use gtar instead of tar.

@praiskup
Copy link
Member

praiskup commented Apr 24, 2018 via email

@Conan-Kudo
Copy link
Member

I think so. @berolinux and @tpgxyz can give more details. I wasn't really there for most of it, as we operate in different time zones.

@praiskup
Copy link
Member

It would answer the question I asked before, that this is related only to scm plugin.
This makes me feel that 'mock' should runtime depend on 'gtar' on such architectures,
and that the scm plugin should just go and use /bin/gtar instead of /bin/tar. I can
invent some more magic solution, but this should be just enough..

@Conan-Kudo
Copy link
Member

@praiskup
Copy link
Member

praiskup commented Apr 24, 2018 via email

@tpgxyz
Copy link
Author

tpgxyz commented Apr 24, 2018

@praiskup @xsuchy Yes @Conan-Kudo well descibed what i had on my mind, when i filled this issue.

Problem is that mock uses switches from gnu's version of tar. Unfortunately these options does not exists in BSD's (or POSIX compiliant) tar from libarchive (https://www.libarchive.org/)

Mostly libarchive's tar does not support exclude-foo-bar. Instead of this option is support excludes pattern i.e
--exclude='*foo*'

Currently gtar compatible options were found in mock's root_cache.py

praiskup added a commit to praiskup/mock that referenced this issue Apr 24, 2018
This helps OpenMandriva where /bin/tar is equivalent for
/bin/bsdtar .  That setup is somewhat unexpected on GNU/Linux
distro, but anyway, it doesn't hurt Fedora/RHEL/CentOS where we
symlink gtar to tar.

As original issue suggests, we could implement everything using
the POSIX tar options (+ helper scripting); but that would be just
too much work which is not worth spending ATM, at least as long as
it is safe to expect that 'gtar' is in PATH and that it really is
GNU tar.

Resolves: rpm-software-management#169
@praiskup
Copy link
Member

Thanks, that makes it clear now. I forgot about root_cache.py. Please consider
whether #180 fix is enough.

praiskup added a commit to praiskup/mock that referenced this issue Apr 24, 2018
This helps OpenMandriva where /bin/tar is equivalent for
/bin/bsdtar.  Such setup is somewhat unexpected on GNU/Linux
distro, but anyway - the fix doesn't hurt Fedora/RHEL/CentOS where
we symlink gtar to tar since ever.

As original issue suggests, we could implement everything using
the POSIX tar options (+ helper scripting); but that would be just
too much work which is not worth wasting ATM, at least as long as
it is safe to expect that 'gtar' is in PATH and that it really is
GNU tar.

Resolves: rpm-software-management#169
@xsuchy
Copy link
Member

xsuchy commented Apr 24, 2018

@praiskup bsdtar exists even in fedora:
https://apps.fedoraproject.org/packages/bsdtar

so you can try it yourself (or compare man pages)

@praiskup
Copy link
Member

praiskup commented Apr 24, 2018 via email

@xsuchy
Copy link
Member

xsuchy commented Apr 24, 2018

oops, I did not realized :))

xsuchy added a commit to xsuchy/mock that referenced this issue Apr 24, 2018
xsuchy added a commit to xsuchy/mock that referenced this issue Apr 24, 2018
xsuchy added a commit to xsuchy/mock that referenced this issue Apr 24, 2018
xsuchy added a commit to xsuchy/mock that referenced this issue May 22, 2018
xsuchy added a commit to xsuchy/mock that referenced this issue May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request, rfe
Projects
None yet
Development

No branches or pull requests

4 participants