Additionally removes the passthrough of fsnotifier and libdbm from the binary IDEs.
This means the binary IDEs now no longer depend on the source IDE build files.
this creates some eval errors that will be fixed in the next commit
done with the following script:
```fish
\#!/usr/bin/env fish
set packagesjson (nix eval --impure --json --expr '
let
lib = import ./lib;
in
import pkgs/servers/x11/xorg/default.nix (lib.mapAttrs (
name: _:
if name == "lib" then
lib
else if name == "config" then
{ allowAliases = false; }
else
name
) (__functionArgs (import pkgs/servers/x11/xorg/default.nix))) { }
' | jq)
set one (grep '^ [A-Za-z0-9_-]*$' pkgs/servers/x11/xorg/default.nix | string trim | string replace -r '$' Z | sort | string sub -e -1)
set two (grep '^ [A-Za-z0-9_-]* = [A-Za-z0-9_-]*;$' pkgs/servers/x11/xorg/default.nix | cut -d= -f1 | string trim | string replace -r '$' Z | sort | string sub -e -1)
for arg in $one $two
set oname $arg
set nname (echo $packagesjson | jq -r .$oname)
if test $nname = null
echo (set_color red)warn:(set_color normal) unknown package xorg.$oname >&2
continue
end
echo $oname "->" $nname
# replace basic xorg.$name references
for file in (rg -F "xorg.$oname" --files-with-matches pkgs)
# special cases
sd -F "$oname = xorg.$oname;" "$nname = $nname;" $file
# replace
sd -F "xorg.$oname" "$nname" $file
# fixup function arguments
# prevent duplicate function args
if grep -E " ($oname|$nname),\$" $file >/dev/null
continue
end
if grep 'xorg\..' $file >/dev/null # case1: there is more so we can't just remove the function arg
if grep ' xorg,$' $file >/dev/null
sd ' xorg,$' " xorg,
$nname," $file
else if grep ' xorg ? .*,$' $file >/dev/null
sd 'xorg( ? .*),$' "xorg\$1,
$nname," $file
else
sd -F 'xorg,' "$nname,
xorg," $file
end
else # case there is no more xorg..* so we can just replace the function arg
sd 'xorg(| ? .*),.*$' "$nname," $file
end
end
end
nix fmt
```
This adds `passthru.updateScript` to the IDEs for automatic updates and
rewrites all existing update scripts into one Python CLI app. This app
is re-using most of the existing scripts in some way:
- Most of `bin/update_bin.py` has been moved to
`updater/jetbrains_nix_updater/fetcher.py`
- Most of `source/update.py` has been moved to
`updater/jetbrains_nix_updater/update_src.py`
- `source/build_maven.py` has been moved almost as-is to
`updater/jetbrains_nix_updater/update_src_maven.py`
Since we are now no longer using JSON files but Nix files directly, I
opted to use a simple "marker" approach for replacing things like
versions and URLs in the files. I didn't want to implement complicated
regex patterns like the `update-source-version` script does, it seemed
overkill and I wanted to keep things as simple as possible.
Co-Authored-By: Matt Sturgeon <matt@sturgeon.me.uk>
This splits each IDE into its own `.nix` file and refactors all related
build machinery to support this.
Motivations (in order of priority):
- Fixing reviews for update PRs: Currently update PRs get no maintainers
assigned, since the `versions.json` was changed. Due to the way CI
works, packages outside of `by-name` only have their maintainers added
to PRs if the file that contains the derivation (`meta.position`) is
changed.
- Reducing the size of `default.nix` and making the differences &
patches required for each IDE more clear and with that also actually
cutting the code into separately maintainable chunks
- Overall improving readability and code structure
This commit was half-automatically generated by a script I wrote:
https://gist.github.com/theCapypara/2939ff9f83a5f30f1d3dff74d725a9bf
**Note that this commit itself does not cause any rebuilds. This is
important. It is just a refactoring without any functional changes.**
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
Cargo 1.84.0 seems to have changed the output format of cargo vendor
again, once again invalidating fetchCargoTarball FOD hashes. It's
time to fix this once and for all, switching across the board to
fetchCargoVendor, which is not dependent on cargo vendor's output
format.