summaryrefslogtreecommitdiff
path: root/maintainers/scripts/update.nix (follow)
Commit message (Expand)AuthorAgeFilesLines
* maintainers/scripts/update: Allow updating in (reverse) topological order•••Previously, when updating multiple packages, we just updated them in arbitrary order. However, when some of those packages depended on each other, it could happen that some of the intermediary commits would not build because of version constraints on dependencies. If we want each commit in the history to build when feasible, we need to consider four different scenarios: 1. Updated dependant is compatible with both the old and the new version of the dependency. Order of commits does not matter. But updating dependents first (i.e. reverse topological order) is useful since it allows building each package on the commit that updates it with minimal rebuilds. 2. Updated dependant raises the minimal dependency version. Dependency needs to be updated first (i.e. topological order). 3. Old dependant sets the maximal dependency version. Dependant needs to be updated first (i.e. reverse topological order). 4. Updated dependant depends on exact version of dependency and they are expected to be updated in lockstep. The earlier commit will be broken no matter the order. This change allows selecting the order of updates to facilitate the first three scenarios. Since most package sets only have loose version constraints, the reverse topological order will generally be the most convenient. In major package set updates like bumping GNOME release, there will be exceptions (e.g. libadwaita typically requires GTK 4 from the same release) but those were probably in broken order before as well. The downside of this feature is that it is quite slow – it requires instantiating each package and then querying Nix store for requisites. It may also fail to detect dependency if there are multiple variants of the package and dependant uses a different one than the canonical one. Testing with: env GNOME_UPDATE_STABILITY=unstable NIX_PATH=nixpkgs=$HOME/Projects/nixpkgs nix-shell maintainers/scripts/update.nix --arg predicate '(path: pkg: path == ["gnome-shell"] || path == ["mutter"] || path == ["glib"] || path == ["gtk3"] || path == ["pango"] || path == ["gnome-text-editor"])' --argstr order reverse-topological --argstr commit true --argstr max-workers 4 Jan Tojnar2025-03-031-1/+15
* treewide: format all inactive Nix files•••After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \ --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7 result/bin/apply-formatting $NIXPKGS_PATH Silvan Mosberger2024-12-101-96/+131
* maintainers/scripts/update: add dependencies to nativeBuildInputs•••This allows update.nix to work with a pure shell. David McFarland2024-11-171-0/+1
* maintainers/scripts/update-dotnet-lockfiles.nix: use update.nixDavid McFarland2024-11-171-8/+9
* maintainers/scripts/update: disable aliasesDavid McFarland2024-11-171-2/+2
* treewide: remove executable bit from .nix files•••??? Alyssa Ross2024-09-141-0/+0
* Merge pull request #319860 from superherointj/update-script-skip-prompt•••maintainers/scripts/update: support skipping prompts❄️2024-07-121-1/+7
|\
| * maintainers/scripts/update.py: support skipping promptssuperherointj2024-06-141-1/+7
* | nautilus: Move from gnome scope to top-levelJan Tojnar2024-07-011-1/+1
|/
* maintainers/scripts/update.nix: Add comment, remove TODORobert Hensing2023-02-261-2/+7
* Merge pull request #160453 from jtojnar/upd-nix-unstable-git•••maintainers/scripts/update.nix: Fix deduplication for unstableGitUpdaterJosé Romildo Malaquias2022-10-221-1/+11
|\
| * maintainers/scripts/update.nix: Fix deduplication for unstableGitUpdater•••Some updaters like `unstableGitUpdater` rely solely `UPDATE_NIX_ATTR_PATH` environment variable to find out package attribute so they all have the same `passthru.updateScript`. This means we cannot rely on that attribute to filter out aliased packages because it would consider all packages using `unstableGitUpdater` the same. We need to use different criterion to distinguish them. `meta.position` is a reasonable candidate but we cannot always utilize it since it might not be available or it might be shared among multiple packages (e.g. when using custom mkDerivation wrapper). Combination of the two attributes should distinguish most cases. Fixes: https://github.com/NixOS/nixpkgs/issues/112583 Jan Tojnar2022-02-171-1/+11
* | gnome.updateScript: Use experimental support for custom commit messagesJan Tojnar2022-02-211-1/+1
|/
* treewide: "does not exists" -> "does not exist"•••I noticed this minor grammar mistake when running update.nix, and then while grepping to find the source I noticed we had it a few times in Nixpkgs. Just as easy to fix treewide as it was to fix the one occurrence I noticed. Alyssa Ross2021-09-091-2/+2
* gnome: rename from gnome3•••Since GNOME version is now 40, it no longer makes sense to use the old attribute name. Jan Tojnar2021-05-081-2/+2
* maintainers/scripts/update.nix: Add support for filtering pkgs by predicate•••Arbitrary predicate is useful for updating decentralised package sets like GNOME. Jan Tojnar2021-05-051-1/+13
* maintainers/scripts/update.nix: Do not traverse lists•••Lists items are not directly accessible like attributes in attrsets are. This makes it hard to represent their address in `UPDATE_NIX_ATTR_PATH` environment variable passed to update scripts. Given that I only introduced list support for `gnome3` attribute set and we stopped using them there, let’s remove the list support again. NixOS modules are better place for package collections anyway. This was meant to go in with https://github.com/NixOS/nixpkgs/pull/98304 but got accidentally omitted somehow. Jan Tojnar2020-12-161-3/+1
* maintainers/scripts/update.nix: Clean up•••- Make some arguments more fitting (the path is actually full, not just relative to prefix…). - Increase the purity of packages* functions (they now take pkgs from argument, not from scope). - Add some documentation comments. Jan Tojnar2020-09-201-29/+51
* maintainers/scripts/update.nix: auto-detect attrPathJan Tojnar2020-09-201-25/+28
* maintainers/scripts/update.nix: support auto-committing by passing attrPath•••Instead of having the updateScript support returning JSON object, it should be sufficient to specify attrPath in passthru.updateScript. It is much easier to use. The former is now considered experimental. Jan Tojnar2020-09-201-0/+2
* maintainers/scripts/update.nix: Add support for auto-commiting changes•••Update scripts can now declare features using passthru.updateScript = { command = [ ../../update.sh pname ]; supportedFeatures = [ "commit" ]; }; A `commit` feature means that when the update script finishes successfully, it will print a JSON list like the following: [ { "attrPath": "volume_key", "oldVersion": "0.3.11", "newVersion": "0.3.12", "files": [ "/path/to/nixpkgs/pkgs/development/libraries/volume-key/default.nix" ] } ] and data from that will be used when update.nix is run with --argstr commit true to create commits. We will create a new git worktree for each thread in the pool and run the update script there. Then we will commit the change and cherry pick it in the main repo, releasing the worktree for a next change. Jan Tojnar2020-09-201-2/+10
* update.nix: Allow passing overlays•••Previously, we relied on NIX_PATH for passing overlays but with flakes, we should pass them explicitly. Jan Tojnar2020-07-071-1/+7
* maintainers/scripts/update.nix: refactor package collector•••The `packagesWith` function expected an attrSet but `packagesWithUpdateScript` could be passing it a derivation or a list when the attribute path supplied by user through the `--argstr path` argument pointed to one. It only worked because derivations are also attrSets and contain their outputs as attributes, and did not work for lists at all. Additionally, the improper handling would cause the `src` attribute to be built in some rare cases (`mkYarnPackage` seems to trigger this). Rewriting the `packagesWith` function to be inductive with a derivation as a base case and attrSets and lists as inductive steps is much cleaner and also fixes the unnecessary build. Jan Tojnar2020-05-131-27/+30
* maintainers/scripts/update.nix: derivation is the final station•••It does not make sense to look for derivations within derivations, not even when `recurseForDerivations` is true. Nix does not do that either: https://github.com/NixOS/nix/blob/ebc024df2287085d48ed6194aa756fd70c07f76c/src/libexpr/get-drvs.cc#L346-L355 Jan Tojnar2020-05-131-2/+2
* maintainers/scripts/update.nix: Import lib into scope•••This will make it easier to change it if we want to decouple from pkgs. Jan Tojnar2020-05-131-15/+17
* maintainers/scripts/update.nix: allow updating overlaysJan Tojnar2020-02-191-3/+2
* maintainers update.nix: fix typo in script helpdanbst2019-12-201-1/+1
* update.nix: fix evalworldofpeace2019-11-251-1/+1
* treewide: Get rid of most `parseDrvName` without breaking compat•••That is because this commit should be merged to both master and release-19.09. John Ericson2019-11-241-1/+1
* maintainers/scripts/update.nix: Clean up•••Make calling update.py a little nicer Jan Tojnar2019-06-021-1/+9
* maintainers/scripts/update.nix: handle null paths•••Previously we did not handle non-existant paths making the program crash. Let’s show a proper error. Jan Tojnar2019-06-021-3/+6
* maintainers/scripts/update.nix: ignore overlays•••It makes little sense for update.nix to try to update overlays; for most people, they will point to a read-only repository most of the cases. Jan Tojnar2019-06-021-1/+3
* maintainers/scripts/update.nix: Do not store updateScripts•••For update script parallelization, we have started calling builtins.toJSON on updateScripts, which triggers evaluation of paths and therefore their copying to Nix store. This breaks update scripts that assume that they exist in nixpkgs like dwarf-fortress. https://github.com/NixOS/nixpkgs/issues/61935 Let’s stringify the paths before JSONification to prevent the evaluation. Jan Tojnar2019-06-021-1/+1
* update.nix: Run update scripts in parallel•••To make updating large attribute sets faster, the update scripts are now run in parallel. Please note the following changes in semantics: - The string passed to updateScript needs to be a path to an executable file. - The updateScript can also be a list: the tail elements will then be passed to the head as command line arguments. Jan Tojnar2018-12-011-34/+19
* meta: fix fallout from #36275Matthew Bauer2018-03-181-1/+1
* maintainers/scripts/update.nix: use saner nubbingJan Tojnar2018-03-131-1/+12
* maintainers/scripts/update.nix: fix error messageJan Tojnar2018-03-131-1/+1
* maintainers/scripts/update.nix: allow updating package collectionsJan Tojnar2018-03-011-1/+16
* maintainers/scripts/update.nix: deduplicate packages•••Lot of my GNOME packages have several legacy aliases, which causes them to be updated multiple times. This patch uses lib.unique to remove the duplicates. Jan Tojnar2018-03-011-14/+16
* update.nix moved to maintainers/scripts/update.nixRok Garbas2016-12-181-0/+131