Skip to content

Commit

Permalink
zfs_2_1: remove
Browse files Browse the repository at this point in the history
With the release of 2.3.0-rc, we know that 2.3.0 will be coming sometime
soon. Per the [ZFS release policy][1], only the current and previous
releases are expected to be supported, so 2.1.x will become unsupported.
Unfortunately upstream does not have any specific timelines, so we do
not know when it will become unsupported, but when it does we will
likely backport the removal. As such, begin warning of imminent removal.

[1]: https://github.com/openzfs/zfs/blob/6187b194349c5a728c9df8c6842f1866d5c9782a/RELEASES.md
  • Loading branch information
amarshall authored and Mic92 committed Nov 24, 2024
1 parent b14b105 commit 453fa80
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 14 deletions.
85 changes: 85 additions & 0 deletions ci/foo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Filtering error messages we don't like
nixf_wrapper(){
nixf-tidy --variable-lookup < "$1" | jq -r '
[
"sema-escaping-with"
]
as $ignored_errors|[.[]|select(.sname as $s|$ignored_errors|index($s)|not)]
'
}

failedFiles=()

# Don't report errors to file overview
# to avoid duplicates when editing title and description
if [[ "______" ]]; then
DONT_REPORT_ERROR=1
else
DONT_REPORT_ERROR=
fi
# TODO: Make this more parallel

# Loop through all Nix files touched by the PR
while readarray -d '' -n 2 entry && (( ${#entry[@]} != 0 )); do
type=${entry[0]}
file=${entry[1]}
case $type in
A*)
source=""
dest=$file
;;
M*)
source=$file
dest=$file
;;
C*|R*)
source=$file
read -r -d '' dest
;;
*)
echo "Ignoring file $file with type $type"
continue
esac

if [[ -n "$source" ]] && [[ "$(nixf_wrapper ______/"$source")" != '[]' ]] 2>/dev/null; then
echo "Ignoring file $file because it doesn't pass nixf-tidy in the base commit"
echo # insert blank line
else
nixf_report="$(nixf_wrapper "$dest")"
if [[ "$nixf_report" != '[]' ]]; then
echo "$dest doesn't pass nixf-tidy. Reported by nixf-tidy:"
errors=$(echo "$nixf_report" | jq -r --arg dest "$dest" '
def getLCur: "line=" + (.line+1|tostring) + ",col=" + (.column|tostring);
def getRCur: "endLine=" + (.line+1|tostring) + ",endColumn=" + (.column|tostring);
def getRange: "file=\($dest)," + (.lCur|getLCur) + "," + (.rCur|getRCur);
def getBody: . as $top|(.range|getRange) + ",title="+ .sname + "::" +
(.message|sub("{}" ; ($top.args.[]|tostring)));
def getNote: "\n::notice " + (.|getBody);
def getMessage: "::error " + (.|getBody) + (if (.notes|length)>0 then
([.notes.[]|getNote]|add) else "" end);
.[]|getMessage
')
if [[ -z "$DONT_REPORT_ERROR" ]]; then
echo "$errors"
else
# just print in plain text
echo "$errors" | sed 's/^:://'
echo # add one empty line
fi
failedFiles+=("$dest")
fi
fi
done < <(git diff -z --name-status ______ -- '*.nix')

if [[ -n "$DONT_REPORT_ERROR" ]]; then
echo "Edited the PR but didn't change the base branch, only the description/title."
echo "Not reporting errors again to avoid duplication."
echo # add one empty line
fi

if (( "${#failedFiles[@]}" > 0 )); then
echo "Some new/changed Nix files don't pass nixf-tidy."
echo "See ______/files for reported errors."
echo "If you believe this is a false positive, ping @Aleksanaa and @inclyc in this PR."
exit 1
fi
6 changes: 0 additions & 6 deletions nixos/tests/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ let

in {

# maintainer: @raitobezarius
series_2_1 = makeZfsTest {
zfsPackage = pkgs.zfs_2_1;
kernelPackages = pkgs.linuxPackages;
};

series_2_2 = makeZfsTest {
zfsPackage = pkgs.zfs_2_2;
kernelPackages = pkgs.linuxPackages;
Expand Down
4 changes: 0 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12924,17 +12924,13 @@ with pkgs;

inherit
({
zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix {
configFile = "user";
};
zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix {
configFile = "user";
};
zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix {
configFile = "user";
};
})
zfs_2_1
zfs_2_2
zfs_unstable;
zfs = zfs_2_2;
Expand Down
4 changes: 0 additions & 4 deletions pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,6 @@ in {

zenpower = callPackage ../os-specific/linux/zenpower { };

zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix {
configFile = "kernel";
inherit pkgs kernel;
};
zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix {
configFile = "kernel";
inherit pkgs kernel;
Expand Down

0 comments on commit 453fa80

Please sign in to comment.