Skip to content

Commit ec45aab

Browse files
authored
Merge pull request #1341 from haskell/master2central-nov2024
master -> central-server 11/2024
2 parents c4f3640 + 4b11c7a commit ec45aab

27 files changed

+475
-226
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
2+
name: Dependabot auto-approve
3+
on: pull_request
4+
5+
permissions:
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: github.actor == 'dependabot[bot]'
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v2
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
- name: Approve a PR
19+
run: gh pr review --approve "$PR_URL"
20+
env:
21+
PR_URL: ${{github.event.pull_request.html_url}}
22+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/haskell-ci.yml

+19-15
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/andreasabel/haskell-ci
1010
#
11-
# version: 0.17.20231012
11+
# version: 0.19.20240630
1212
#
13-
# REGENDATA ("0.17.20231012",["github","hackage-server.cabal"])
13+
# REGENDATA ("0.19.20240630",["github","hackage-server.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -32,19 +32,24 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.8.1
35+
- compiler: ghc-9.10.1
3636
compilerKind: ghc
37-
compilerVersion: 9.8.1
37+
compilerVersion: 9.10.1
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.6.3
40+
- compiler: ghc-9.8.2
4141
compilerKind: ghc
42-
compilerVersion: 9.6.3
42+
compilerVersion: 9.8.2
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.4.7
45+
- compiler: ghc-9.6.5
4646
compilerKind: ghc
47-
compilerVersion: 9.4.7
47+
compilerVersion: 9.6.5
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.4.8
51+
compilerKind: ghc
52+
compilerVersion: 9.4.8
4853
setup-method: ghcup
4954
allow-failure: false
5055
- compiler: ghc-9.2.8
@@ -74,11 +79,10 @@ jobs:
7479
apt-get update
7580
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
7681
mkdir -p "$HOME/.ghcup/bin"
77-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
82+
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
7883
chmod a+x "$HOME/.ghcup/bin/ghcup"
79-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
8084
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
81-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
85+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
8286
apt-get update
8387
apt-get install -y libbrotli-dev libgd-dev
8488
env:
@@ -98,7 +102,7 @@ jobs:
98102
echo "HC=$HC" >> "$GITHUB_ENV"
99103
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
100104
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
101-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
105+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
102106
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
103107
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
104108
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi
@@ -183,15 +187,15 @@ jobs:
183187
echo " ghc-options: -Werror=missing-methods" >> cabal.project
184188
cat >> cabal.project <<EOF
185189
EOF
186-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(Cabal|Cabal-syntax|hackage-server|parsec|process|text)$/; }' >> cabal.project.local
190+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(Cabal|Cabal-syntax|hackage-server|parsec|process|text)$/; }' >> cabal.project.local
187191
cat cabal.project
188192
cat cabal.project.local
189193
- name: dump install plan
190194
run: |
191195
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
192196
cabal-plan
193197
- name: restore cache
194-
uses: actions/cache/restore@v3
198+
uses: actions/cache/restore@v4
195199
with:
196200
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
197201
path: ~/.cabal/store
@@ -221,7 +225,7 @@ jobs:
221225
rm -f cabal.project.local
222226
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
223227
- name: save cache
224-
uses: actions/cache/save@v3
228+
uses: actions/cache/save@v4
225229
if: always()
226230
with:
227231
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

.github/workflows/nix-flake.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
nix:
1111
strategy:
12-
fail-fast: false
12+
fail-fast: true
1313
matrix:
1414
os:
1515
- ubuntu-latest
@@ -18,16 +18,23 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
steps:
2020
- uses: actions/checkout@v4
21-
- uses: cachix/install-nix-action@v23
21+
- uses: cachix/install-nix-action@v30
2222
with:
2323
extra_nix_config: |
24-
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hackage-server.cachix.org-1:iw0iRh6+gsFIrxROFaAt5gKNgIHejKjIfyRdbpPYevY=
25-
substituters = https://hydra.iohk.io https://cache.nixos.org/ https://hackage-server.cachix.org/
26-
- uses: cachix/cachix-action@v12
24+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hackage-server.cachix.org-1:iw0iRh6+gsFIrxROFaAt5gKNgIHejKjIfyRdbpPYevY=
25+
substituters = https://cache.nixos.org/ https://hackage-server.cachix.org/
26+
- uses: cachix/cachix-action@v15
2727
with:
2828
# https://nix.dev/tutorials/continuous-integration-github-actions#setting-up-github-actions
2929
name: hackage-server
3030
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
31+
32+
- name: "Check `nix develop` shell"
33+
run: nix develop --check
34+
35+
- name: "Check `nix develop` shell can run command"
36+
run: nix develop --command "echo"
37+
3138
- run: nix build
3239

3340
- continue-on-error: false

README.md

-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
11
central-server branch: the hackage.haskell.org instance
22
=======================================================
3-
4-
This is the branch for the "official" Hackage server at hackage.haskell.org. Most changes should not be here, but should be made to master.
5-
6-
# General Documentation
7-
=======
8-
[![Build Status](https://travis-ci.org/haskell/hackage-server.png?branch=master)](https://travis-ci.org/haskell/hackage-server)
9-
[![Build status](https://github.com/haskell/hackage-server/actions/workflows/haskell-ci.yml/badge.svg)](https://github.com/haskell/hackage-server/actions/workflows/haskell-ci.yml)
10-
[![Build status](https://github.com/haskell/hackage-server/actions/workflows/nix-shell.yml/badge.svg)](https://github.com/haskell/hackage-server/actions/workflows/nix-shell.yml)

cabal.project

-20
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,6 @@ packages:
66

77
-- This project config requires cabal 2.4 or later
88

9-
-- If in doubt, use GHC 8.8 to build hackage-server; see
10-
-- 'tested-with' in 'hackage-server.cabal' for a list of currently
11-
-- CI-validated GHC versions
12-
--
13-
-- with-compiler: ghc-8.8
14-
15-
16-
allow-newer: rss:time, rss:base
17-
18-
-- Andreas, 2022-10-28: `Cabal-3.8.1.0` wants `process >= 1.6.14`
19-
-- which is too new for the `ghc < 9.4` package that is pulled in
20-
-- by `doctest-parallel`.
21-
-- Since, Cabal-3.8.1.0 has no reason to want such a new version
22-
-- of process, we can solve the conflict here by allowing
23-
-- `Cabal` to use the shipped version of `process`.
24-
-- This workaround can be removed once `Cabal-3.8` drops
25-
-- its (unreasonable) constraint on `process`.
26-
-- See: https://github.com/haskell/cabal/issues/8554
27-
allow-older: Cabal:process
28-
299
-----------------------------------------------------------------------------
3010
-- Anti-constraints
3111

datafiles/static/hackage.css

+42-4
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,28 @@ h4 { font-size: 100%; /* 13px */ }
117117
h5 { font-size: 100%; /* 13px */ }
118118
h6 { font-size: 100%; /* 13px */ }
119119

120-
select, input, button, textarea {
120+
select, input, button, textarea, input::file-selector-button {
121121
font-size: 1rem;
122122
margin: 0.5em;
123-
padding: 0.1em;
123+
padding: 0.5em 0.8em;
124+
border: 1px solid #444;
125+
border-radius: 3px;
126+
background: #eee;
127+
}
128+
129+
select:hover, input:hover, button:hover, textarea:hover, input::file-selector-button:hover {
130+
background: #dcdcdc;
131+
}
132+
133+
input[type=file] {
134+
background: none;
135+
border: 0;
136+
}
137+
138+
@media (prefers-color-scheme: dark) {
139+
select, input, button, textarea, input::file-selector-button {
140+
border: 0;
141+
}
124142
}
125143

126144
table {
@@ -267,9 +285,21 @@ pre + pre {
267285
margin-top: 0.5em;
268286
}
269287

288+
@media (prefers-color-scheme: dark) {
289+
blockquote {
290+
border-left: 3px solid #2f2842;
291+
background-color: #4c4771;
292+
}
293+
}
294+
295+
@media (prefers-color-scheme: light) {
296+
blockquote {
297+
border-left: 3px solid #c7a5d3;
298+
background-color: #eee4f1;
299+
}
300+
}
301+
270302
blockquote {
271-
border-left: 3px solid #c7a5d3;
272-
background-color: #eee4f1;
273303
margin: 0.5em;
274304
padding: 0.0005em 0.3em 0.5em 0.5em;
275305
}
@@ -1147,6 +1177,14 @@ a.deprecated[href]:visited {
11471177
color: #61B01E;
11481178
}
11491179

1180+
.lib-contents {
1181+
margin-left: 20px;
1182+
}
1183+
1184+
.lib-contents > h3 {
1185+
margin: 0.7em 0;
1186+
}
1187+
11501188
/* Paginator */
11511189
#paginatorContainer {
11521190
display: flex;

datafiles/templates/Html/package-page.html.st

+10
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<div style="font-size: small">
3333
[ $tags$ ]
3434
[ <a href="/package/$package.name$/tags/edit">Propose Tags</a> ]
35+
[ <a href="https://github.com/haskell/security-advisories/blob/main/CONTRIBUTING.md">Report a vulnerability</a> ]
3536
</div>
3637

3738
$if(isDeprecated)$
@@ -139,6 +140,15 @@
139140
<td>$package.buildDepends$</td>
140141
</tr>
141142

143+
$if(package.optional.hasTestedWith)$
144+
<tr>
145+
<th>Tested with</th>
146+
<td class="word-wrap">
147+
$package.optional.testedWith$
148+
</td>
149+
</tr>
150+
$endif$
151+
142152
<tr>
143153
<th>License</th>
144154
<td class="word-wrap">$package.license$</td>

exes/Main.hs

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
{-# LANGUAGE CPP #-}
2+
13
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}
4+
25
module Main where
36

47
import qualified Distribution.Server as Server
@@ -65,7 +68,11 @@ main :: IO ()
6568
main = topHandler $ do
6669
hSetBuffering stdout LineBuffering
6770
args <- getArgs
71+
#if !MIN_VERSION_Cabal(3,12,0)
6872
case commandsRun (globalCommand commands) commands args of
73+
#else
74+
commandsRun (globalCommand commands) commands args >>= \case
75+
#endif
6976
CommandHelp help -> printHelp help
7077
CommandList opts -> printOptionsList opts
7178
CommandErrors errs -> printErrors errs
@@ -79,6 +86,7 @@ main = topHandler $ do
7986

8087
where
8188
printHelp help = getProgName >>= putStr . help
89+
printOptionsList :: [String] -> IO ()
8290
printOptionsList = putStr . unlines
8391
printErrors errs = do
8492
putStr (intercalate "\n" errs)
@@ -154,7 +162,11 @@ optionVerbosity getter setter =
154162
"Control verbosity (n is 0--3, default verbosity level is 1)"
155163
getter setter
156164
(optArg "n" (fmap Flag Verbosity.flagToVerbosity)
157-
(Flag Verbosity.verbose)
165+
(
166+
#if MIN_VERSION_Cabal(3,12,0)
167+
show Verbosity.verbose,
168+
#endif
169+
Flag Verbosity.verbose)
158170
(fmap (Just . showForCabal) . flagToList))
159171

160172
optionStateDir :: (a -> Flag FilePath)

flake.lock

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)