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

snakeoil.tar is no longer needed #102

Open
ferringb opened this issue Jan 28, 2024 · 1 comment
Open

snakeoil.tar is no longer needed #102

ferringb opened this issue Jan 28, 2024 · 1 comment

Comments

@ferringb
Copy link
Contributor

The module snakeoil.tar was created to basically clone python's tarfile logic while monkeypatching __slots__ into the clone; that slots usage knocked >33% of memory usage off for any tar interaction, which was an issue for dealing in binpkgs and merging. These days, upstream caught up to our work and now has the same sort of memory optimizations.

Within the pkgcore stack, the only user of this module is the binpkg repository in pkgcore, and the usages of that are primarily folks doing pquery --contents rather than pmerge -kK binpkg merging (pmerge isn't fully functional now afaik).

Our version of tar has a couple of extras wired in- support for our 'data source' interface that was used to abstract around local/remote/in memory files. That needs to be resolved before this can be deprecated and then removed.

My suggestion for the pathway here is thus:

  1. rewrite pkgcore's usage of snakeoil.tar to use tarfile. Potentially split out any shims (or wrapper of tarfile) to handle the data source thing, assuming those components still live in snakeoil.
  2. Shove a deprecation notice into the module scope of snakeoil.tar. As an aside, that deprecation notice should be wired so it throws an exception if this code isn't removed in the next major semver bump.
  3. Remove the module at the next semver bump.
@arthurzam
Copy link
Member

I think your plan is great. Maybe we could "troll" a bit, and wire up _version.py into the warning/error condition.

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

2 participants