Skip to content

Allow running updateScript of package sets#2154

Open
jian-lin wants to merge 1 commit intongi-nix:mainfrom
linj-fork:pr/updateScript-package-set-nixpkgs
Open

Allow running updateScript of package sets#2154
jian-lin wants to merge 1 commit intongi-nix:mainfrom
linj-fork:pr/updateScript-package-set-nixpkgs

Conversation

@jian-lin
Copy link
Contributor

@jian-lin jian-lin commented Feb 12, 2026

When reviewing #2063, I realize that the current package update CI does not work for package sets. This PR fixes that.

Without this patch, package sets, such as bonfire1, cannot be updated in PRs created by .github/workflows/update-packages.yaml.

Before, update and update-all commands relied on flakes. This patch also lifts that restriction.

a follow-up of #1699
cc @eljamm for review


With this patch, disabled package sets can be enabled for update. That can be done in future PRs.

@jian-lin jian-lin force-pushed the pr/updateScript-package-set-nixpkgs branch from 78d2420 to 565d2ce Compare February 12, 2026 00:34
@jian-lin jian-lin force-pushed the pr/updateScript-package-set-nixpkgs branch from 565d2ce to af63a3e Compare February 12, 2026 00:54
@eljamm eljamm self-requested a review February 12, 2026 11:13
@jian-lin
Copy link
Contributor Author

I plan to compare the update result of update-all with and without this patch. Mark this as draft before I finish the comparison.

@jian-lin jian-lin marked this pull request as draft February 12, 2026 15:25
@ju1m ju1m mentioned this pull request Feb 13, 2026
4 tasks
@jian-lin jian-lin force-pushed the pr/updateScript-package-set-nixpkgs branch from af63a3e to e6bb561 Compare February 15, 2026 23:09
@jian-lin jian-lin marked this pull request as ready for review February 15, 2026 23:09
Without this patch, package sets, such as bonfire[1], cannot be
updated in PRs created by .github/workflows/update-packages.yaml.

Before, `update` and `update-all` commands relied on flakes.  This
patch also lifts that restriction.

[1]: ngi-nix#1984
@jian-lin jian-lin force-pushed the pr/updateScript-package-set-nixpkgs branch from e6bb561 to 58f0bc4 Compare February 15, 2026 23:09
@jian-lin
Copy link
Contributor Author

nix-update -> update.nix of Nixpkgs

After ignoring bonfire package set (update is very slow and should work, see here), adding log for successful updates and adding a few updateScript fixes, we have the following comparison.

success -> failure

  • inventaire-unwrapped: no updateScript
  • kip: no updateScript
  • mcaptcha: no updateScript
  • mcaptcha-cache: no updateScript
  • meta-press: no updateScript
  • openfire-unwrapped: no updateScript
  • tlspool-gui: no updateScript
  • atomic-server: no updateScript

failure -> success

  • anastasis-gtk: not exposed as flake output packages.x86_64-linux.anastasis-gtk because it is broken
  • dnsvizor: not exposed as flake output packages.x86_64-linux.dnsvizor because it is a package set
  • peertube-plugins: not exposed as flake output packages.x86_64-linux.peertube-plugins because it is a package set

@jian-lin
Copy link
Contributor Author

This is ready for review @eljamm

@jian-lin
Copy link
Contributor Author

BTW, during comparison, I find a seemingly wrong update of funkwhale. cc @JuneStepp

funkwhale: 2.0.0-alpha.2 -> 1.4.1

@JuneStepp
Copy link
Member

BTW, during comparison, I find a seemingly wrong update of funkwhale. cc @JuneStepp

funkwhale: 2.0.0-alpha.2 -> 1.4.1

It might be easiest to just leave it; they're on release candidate 17 now, so 2.0 probably isn't far away.

@eljamm
Copy link
Contributor

eljamm commented Feb 17, 2026

By itself, this change is great and allows us to update packages inside scopes, but this PR actually does more than this, namely replacing nix-update with the Nixpkgs maintainers script. The issue for us here is that we can no longer update packages that don't have an explicit update script, which is a desirable feature for us.

Could we perhaps introduce a default/fallback updater as well?

@jian-lin
Copy link
Contributor Author

Currently, there are only 8 packages without a updateScript. Adding updateScript for them is not a big deal.

Not a fan of nix-update. Feel free to close this PR and experiment with nix-update.

@ju1m
Copy link

ju1m commented Feb 17, 2026

Currently, there are only 8 packages without a updateScript. Adding updateScript for them is not a big deal.

Thanks for working on this nice feature @jian-lin, from what you already did, do you already know if it would be equivalent to add the following to the 8 packages?

passthru.updateScript = nix-update-script { };

@jian-lin
Copy link
Contributor Author

@jian-lin Not a fan of nix-update.

Let me elaborate this.

@ju1m if it would be equivalent to add the following to the 8 packages?
passthru.updateScript = nix-update-script { };

Yes. But apparently it is not always correct. For example, some packages need to update to unstable versions and some need to update to latest commit.

@eljamm we can no longer update packages that don't have an explicit update script, which is a desirable feature for us.

This is a misfeature. I just explained why it is not always correct.

@eljamm Could we perhaps introduce a default/fallback updater as well?

We can. It can be done by customizing get-script parameter of update.nix.

@jian-lin
Copy link
Contributor Author

Let me add one point.

For package sets sharing the same src, there can be race condition if we run updateScript multiple times. @ju1m proposes that we create a dummy package in the package set to run updateScript once.

To express that we do not want to run updateScript on other packages in those package sets, we can not add updateScript to them, which is clear and simple.

If we implement the misfeature, i.e., adding a default updateScript for packages not having one, we have to use another way to express not running updateScript for some packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants

Comments