-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
The api of that predates subprocess (literally, py2.2 or py2.3); there are things I did in there that subprocess still lacks (the FD juggling for pipes for example) that will require extending the subprocess.Popen api, but the spawn API , now, is extremely high friction. The only things that use it are snakeoil and pkgcore.
Things it needs:
- remapping of FDs from host to specific FD's within the child
- ability to change UID/GID. A way to relay the failure to do so back to the parent in a clean manner for throwing a seperate exception- or detecting that it'll fail up front (ambient capabilities)- should be integrated
- The
split_linesthing is layer violation; remove it. If it's in heavy use, come up w/ a solution that wraps rather than embeds it into the core logic. spawn_typeroughly was a way to do an injection of desired execution; IE, whatever the command you're told to run, I want you to sandbox it, thus wrap it in this. That dep injection pattern may be worth preserving, but if so, it must have atyping.Protocol. I suspect desiging an overridable class can address this.
Things to consider before implementing this:
- Should this just be moved fully into pkgcore? Snakeoil has uses of it, but that's for
ArCompwhich needs to be rewritten to modern standards. I don't think anything remains that would use theprocess.spawnapi's in snakeoil, and nothing outside of pkgcore uses it. - IE, if that's true, either write somethign anew in pkgcore, or bulk lift it all into pkgcore and deal w/ that refactoring as an internal (non semver visible) thing.