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
```
`webkitgtk_4_0` was already transitively insecure because of `libsoup_2_4` and it will be removed soon.
Ideally, we would just replace it with `libsoup_3`-based `webkitgtk_4_1`
but it is unclear if they would work with the 4.1 ABI. At best, the programs
would only be looking for 4.0, failing to build or start, at worst there
might be conflicts with libsoup 2 symbols if that is pulled in by anything
or crashes that will only happen after certain action.
Let’s mark the packages as broken to ensure human intervention.
The llama egg declares a dependency on srfi-4 which is actually part of CHICKEN itself and not an
egg. To salvage it, we remove such bogus dependencies now.
Most eggs in the canonical repository don't declare a `version` property in their `.egg` files. This
is because it's provided implicitly when using `chicken-install` to retrieve them. Quoting from [the
manual](https://wiki.call-cc.org/man/5/Egg%20specification%20format#version):
> Eggs from remote egg servers are automatically versioned - the version is part of the protocol to
retrieve the egg and does not have to be specified in the .egg file.
Since we don't use `chicken-install` to retrieve eggs, this leaves us with a version of "unknown" in
most cases, e.g.:
$ nix-shell -p chickenPackages.chickenEggs.json-abnf chickenPackages.chicken --run chicken-status
abnf ...................................................... version: unknown
iset ...................................................... version: unknown
json-abnf ................................................. version: unknown
lexgen .................................................... version: unknown
regex ......................................................... version: 2.0
srfi-1 .................................................... version: unknown
srfi-127 .................................................. version: unknown
srfi-69 ................................................... version: unknown
utf8 ...................................................... version: unknown
This is usually not an issue unless another egg declares a minimum required version dependency on an
egg with missing version info. In this case, `chicken-install` will fill in "0.0.0" as a fallback
and the check will fail. This has so far been worked around patches (see e.g. #346004 or #358455).
This patch addresses the root cause by following the documentation's recommendation:
> Eggs installed from local directories (see below) should explicitly specify a version.
To do that, `eggDerivation` now simply always adds the version to the generated `.egg-info`
file. This has the added benefit of correcting potentially inconsistent version declarations in
`.egg` files. Note that we cannot patch the original `.egg` file because not all released egg
versions match [the stricter version format validation which currently applies
there](https://bugs.call-cc.org/ticket/1855).
The patch also changes the signature of `eggDerivation` to allow passing in `pname` and `version`
instead of `name` to allow for easy access to the egg version. However, for backwards compatibility,
the old `name` argument is also still supported.
As a result, the aforementioned overrides are removed again and some additional eggs can be marked
as unbroken again.
And finally, this is the output of the above `chicken-status` call with the patch applied:
$ nix-shell -p chickenPackages.chickenEggs.json-abnf chickenPackages.chicken --run chicken-status
abnf .......................................................... version: 8.3
iset .......................................................... version: 2.2
json-abnf ..................................................... version: 7.0
lexgen ........................................................ version: 8.2
regex ......................................................... version: 2.0
srfi-1 ...................................................... version: 0.5.1
srfi-127 ...................................................... version: 1.3
srfi-69 ..................................................... version: 0.4.3
utf8 ........................................................ version: 3.6.3
Many of these packages that are now failing had `-Wno-error=` on clang.
Gcc 14 now also treats incompatible pointer type as errors.
The logical fix is to ignore these errors independent of compiler.
They are not doing anything right now. This is in preparation for their
complete removal from the tree.
Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.
Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This reverts commit 65a333600d.
This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.
It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).
A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.
[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
It's hard to put the sourcing of ./.attrs.sh into all builder
consistently - mistakes will happen. Thus, load structured attrs once in
make-derivation and then source the remaining builder on top.
This should fix quite a few builders with structured attributes in
principle. Most importantly it helps substitute / substituteAll, which
are required for bootstrap on some platforms.
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 57b193d8dd
result/bin/apply-formatting $NIXPKGS_PATH