Skip to content

nixos-rebuild-ng: use os.statx and stx_btime when available - #547136

Closed
thiagokokada wants to merge 1 commit into
NixOS:staging-nixosfrom
thiagokokada:btime-or-ctime
Closed

thiagokokada wants to merge 1 commit into
NixOS:staging-nixosfrom
thiagokokada:btime-or-ctime

Conversation

@thiagokokada

Copy link
Copy Markdown
Contributor

Python 3.15's has a new os.statx call that maps stx_btime on Linux. This should fix the issues we are seeing when the user runs nix-collect-garbage to delete old generations, since Nix updates the ctime of the generation symlinks but not the btime.

Things done

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 2.status: merge conflict This PR has merge conflicts with the target branch labels Jul 29, 2026
Python 3.15's has a new `os.statx` call that maps `stx_btime` on Linux.
This should fix the issues we are seeing when the user runs
`nix-collect-garbage` to delete old generations, since Nix updates the
ctime of the generation symlinks but not the btime.
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 31, 2026
@thiagokokada

Copy link
Copy Markdown
Contributor Author

So I got the issue that made using nix-env --list-generations fixed at nix: NixOS/nix#16523.

I assume we will get this fixed in the next nix release. Once this is done and the new nix version becomes the default I can remove the nix.get_generations() and keep just nix.get_generations_from_nix_env() only.

@thiagokokada
thiagokokada deleted the btime-or-ctime branch September 26, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant