-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Skiplist.hs
240 lines (219 loc) · 8.68 KB
/
Skiplist.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Skiplist
( packageName,
content,
attrPath,
checkResult,
python,
skipOutpathCalc,
)
where
import Data.Char (isDigit)
import Data.Foldable (find)
import qualified Data.Text as T
import OurPrelude
import Text.Regex.Applicative.Text (RE', few, psym, string, (=~))
type Skiplist = [(Text -> Bool, Text)]
type TextSkiplister m =
(MonadError Text m) =>
Text ->
m ()
attrPath :: TextSkiplister m
attrPath = skiplister attrPathList
packageName :: TextSkiplister m
packageName name =
if name == "elementary-xfce-icon-theme" -- https://github.com/ryantm/nixpkgs-update/issues/63
then return ()
else skiplister nameList name
content :: TextSkiplister m
content = skiplister contentList
checkResult :: TextSkiplister m
checkResult = skiplister checkResultList
skipOutpathCalc :: TextSkiplister m
skipOutpathCalc = skiplister skipOutpathCalcList
attrPathList :: Skiplist
attrPathList =
[ prefix
"lua"
"Packages for lua are currently skipped. https://github.com/NixOS/nixpkgs/pull/37501#issuecomment-375169646",
prefix "lxqt" "Packages for lxqt are currently skipped.",
prefix
"altcoins.bitcoin"
"@roconnor asked for a skip on this until something can be done with GPG signatures https://github.com/NixOS/nixpkgs/commit/77f3ac7b7638b33ab198330eaabbd6e0a2e751a9",
eq "sqlite-interactive" "it is an override",
eq "harfbuzzFull" "it is an override",
prefix
"mate"
"mate packages are upgraded in lockstep https://github.com/NixOS/nixpkgs/pull/50695#issuecomment-441338593",
prefix
"deepin"
"deepin packages are upgraded in lockstep https://github.com/NixOS/nixpkgs/pull/52327#issuecomment-447684194",
prefix
"monero-"
"monero-cli and monero-gui packages are upgraded in lockstep",
prefix
"element-desktop"
"@Ma27 asked to skip",
prefix
"element-web"
"has to be updated along with element-desktop",
prefix
"keybinder"
"it has weird tags. see nixpkgs-update#232",
infixOf
"pysc2"
"crashes nixpkgs-update",
infixOf
"tornado"
"python updatescript updates pinned versions",
prefix
"spire-"
"spire-server and spire-agent are different outputs for spire package",
eq "imagemagick_light" "same file and version as imagemagick",
eq "imagemagickBig" "same file and version as imagemagick",
eq "libheimdal" "alias of heimdal",
eq "minio_legacy_fs" "@bachp asked to skip",
eq "flint" "update repeatedly exceeded the 6h timeout",
eq "keepmenu" "update repeatedly exceeded the 6h timeout",
eq "klee" "update repeatedly exceeded the 6h timeout",
eq "vmagent" "updates via victoriametrics package",
eq "ollama-rocm" "only `ollama` is explicitly updated (defined in the same file)",
eq "ollama-cuda" "only `ollama` is explicitly updated (defined in the same file)",
regex
(string "python" *> few (psym isDigit) *> string "Packages.mmengine")
"takes way too long to build",
prefix
"linuxKernel"
"creates too many duplicate PRs",
prefix
"postgresql"
"creates too many duplicate PRs",
prefix
-- bump this when the default version is changed
"python311Packages"
"isn't the default python version"
]
nameList :: Skiplist
nameList =
[ prefix "r-" "we don't know how to find the attrpath for these",
infixOf "jquery" "this isn't a real package",
infixOf "google-cloud-sdk" "complicated package",
infixOf "github-release" "complicated package",
infixOf "perl" "currently don't know how to update perl",
infixOf "cdrtools" "We keep downgrading this by accident.",
infixOf "gst" "gstreamer plugins are kept in lockstep.",
infixOf "electron" "multi-platform srcs in file.",
infixOf
"linux-headers"
"Not updated until many packages depend on it (part of stdenv).",
infixOf "xfce" "@volth asked to not update xfce",
infixOf "cmake-cursesUI-qt4UI" "Derivation file is complicated",
infixOf "iana-etc" "@mic92 takes care of this package",
infixOf
"checkbashism"
"needs to be fixed, see https://github.com/NixOS/nixpkgs/pull/39552",
eq "isl" "multi-version long building package",
infixOf "qscintilla" "https://github.com/ryantm/nixpkgs-update/issues/51",
eq "itstool" "https://github.com/NixOS/nixpkgs/pull/41339",
infixOf
"virtualbox"
"nixpkgs-update cannot handle updating the guest additions https://github.com/NixOS/nixpkgs/pull/42934",
eq
"avr-binutils"
"https://github.com/NixOS/nixpkgs/pull/43787#issuecomment-408649537",
eq
"iasl"
"two updates had to be reverted, https://github.com/NixOS/nixpkgs/pull/46272",
eq
"meson"
"https://github.com/NixOS/nixpkgs/pull/47024#issuecomment-423300633",
eq
"burp"
"skipped until better versioning schema https://github.com/NixOS/nixpkgs/pull/46298#issuecomment-419536301",
eq "chromedriver" "complicated package",
eq
"gitlab-shell"
"@globin asked to skip in https://github.com/NixOS/nixpkgs/pull/52294#issuecomment-447653417",
eq
"gitlab-workhorse"
"@globin asked to skip in https://github.com/NixOS/nixpkgs/pull/52286#issuecomment-447653409",
eq
"gitlab-elasticsearch-indexer"
"@yayayayaka asked to skip in https://github.com/NixOS/nixpkgs/pull/244074#issuecomment-1641657015",
eq "reposurgeon" "takes way too long to build",
eq "kodelife" "multiple system hashes need to be updated at once",
eq "openbazaar" "multiple system hashes need to be updated at once",
eq "eaglemode" "build hangs or takes way too long",
eq "autoconf" "@prusnak asked to skip",
eq "abseil-cpp" "@andersk asked to skip"
]
contentList :: Skiplist
contentList =
[ infixOf "nixpkgs-update: no auto update" "Derivation file opts-out of auto-updates",
infixOf "DO NOT EDIT" "Derivation file says not to edit it",
infixOf "Do not edit!" "Derivation file says not to edit it",
-- Skip packages that have special builders
infixOf "buildRustCrate" "Derivation contains buildRustCrate",
infixOf "buildRubyGem" "Derivation contains buildRubyGem",
infixOf "bundlerEnv" "Derivation contains bundlerEnv",
infixOf "buildPerlPackage" "Derivation contains buildPerlPackage",
-- Specific skips for classes of packages
infixOf "teams.gnome.members" "Do not update GNOME during a release cycle",
infixOf "https://downloads.haskell.org/ghc/" "GHC packages are versioned per file"
]
checkResultList :: Skiplist
checkResultList =
[ infixOf
"busybox"
"- busybox result is not automatically checked, because some binaries kill the shell",
infixOf
"gjs"
"- gjs result is not automatically checked, because some tests take a long time to run",
infixOf
"casperjs"
"- casperjs result is not automatically checked, because some tests take a long time to run",
binariesStickAround "kicad",
binariesStickAround "fcitx",
binariesStickAround "x2goclient",
binariesStickAround "gpg-agent",
binariesStickAround "dirmngr",
binariesStickAround "barrier",
binariesStickAround "fail2ban",
binariesStickAround "zed",
binariesStickAround "haveged"
]
skipOutpathCalcList :: Skiplist
skipOutpathCalcList =
[ eq "firefox-beta-bin-unwrapped" "master",
eq "firefox-devedition-bin-unwrapped" "master"
-- "firefox-release-bin-unwrapped" is unneeded here because firefox-bin is a dependency of other packages that Hydra doesn't ignore.
]
binariesStickAround :: Text -> (Text -> Bool, Text)
binariesStickAround name =
infixOf name ("- " <> name <> " result is not automatically checked because some binaries stick around")
skiplister :: Skiplist -> TextSkiplister m
skiplister skiplist input = forM_ result throwError
where
result = snd <$> find (\(isSkiplisted, _) -> isSkiplisted input) skiplist
prefix :: Text -> Text -> (Text -> Bool, Text)
prefix part reason = ((part `T.isPrefixOf`), reason)
infixOf :: Text -> Text -> (Text -> Bool, Text)
infixOf part reason = ((part `T.isInfixOf`), reason)
eq :: Text -> Text -> (Text -> Bool, Text)
eq part reason = ((part ==), reason)
regex :: RE' a -> Text -> (Text -> Bool, Text)
regex pat reason = (isJust . (=~ pat), reason)
python :: Monad m => Int -> Text -> ExceptT Text m ()
python numPackageRebuilds derivationContents =
tryAssert
( "Python package with too many package rebuilds "
<> (T.pack . show) numPackageRebuilds
<> " > "
<> tshow maxPackageRebuild
)
(not isPython || numPackageRebuilds <= maxPackageRebuild)
where
isPython = "buildPythonPackage" `T.isInfixOf` derivationContents
maxPackageRebuild = 100