Make the package importable outside FreeBSD - #11
Merged
Conversation
Importing the package executed a sysctl, which failed anywhere outside FreeBSD and blocked the unit tests off the platform. The jail(2) family now carries ctypes prototypes, resolved lazily like in freebsd_sysctl, and use_errno on the libc handle prepares errno reporting. JAIL_MAX_AF_IPS keeps its name through a module __getattr__ and caches the first read.
The marshalling tests need no FreeBSD kernel now that the package imports everywhere. freebsd-sysctl installs from the upstream git main until 0.1.0 is published on PyPI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing jail executed a sysctl, so the package only loaded on FreeBSD and no unit test could run anywhere else.
JAIL_MAX_AF_IPSis read on first access and cached, keeping its public name.jail(2)functions get ctypes prototypes with errno support, resolved on first use like in freebsd_sysctl — groundwork for raising OSError on failures in a follow-up.JAIL_MAX_AF_IPSand rawjail.dllaccess work as before.