-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
cpython: provide libuuid for the _uuid module #377458
base: staging
Are you sure you want to change the base?
Conversation
d6ba642
to
be95d08
Compare
I think I misled you in Matrix chat. What's actually happening is that Popen() is called once per process, so it's not a big deal performance-wise. Actually, the in-python implementation using clock source is more performant than calling to _uuid -> libuuid. See:
But: it looks like unless _uuid module is used to generate UUID, it will be marked as is_safe=unknown, as per https://docs.python.org/3/library/uuid.html#uuid.SafeUUID which may be important to users of the module if they want to guarantee uniqueness for uuid across processes (which makes sense, since clock is used as the source of "randomness" otherwise). So maybe for the sake of safety - and to align with other platforms like RHEL (UPD: Looks like while Darwin nixpkgs build ships _uuid, the platform does not support _safe variant of the uuid_generate_time function, so it's not an example to emulate.) |
be95d08
to
77be369
Compare
Yes, let's do it (on staging, obviously). 🙏 |
Doing some test builds on my hydra and using master as a base for comparisons. Not sure if the util-linuxMinimal changes are fine. |
These depend on python via audit preventing the use of libuuid from util-linux in python builds.
Relying on libuuid offers synchronization primitives, so that "no two processes can obtain the same UUID"¹. [1] https://docs.python.org/3/library/uuid.html#module-uuid
77be369
to
94e717e
Compare
Relying on libuuid offers synchronization primitives, so that "no two
processes can obtain the same UUID"¹.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.