Skip to content

Commit f186595

Browse files
authored
Ghc 9.4.8 (#1357)
* Haskell 9.4.8 * Try split-sections on windows. * Experimental stan config to ask it to not report StrictData. * Use 9.4.8 in lint and benchmarks. * Fix lint. * Update cabal version. * Satisfy hlint/fourmolu. * Clean up split-sections message.
1 parent 37928a0 commit f186595

File tree

17 files changed

+51
-58
lines changed

17 files changed

+51
-58
lines changed

.github/workflows/bench.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
benchmarks:
66
name: benchmarks
77
runs-on: ubuntu-latest
8-
container: fossa/haskell-static-alpine:ghc-9.4.7
8+
container: fossa/haskell-static-alpine:ghc-9.4.8
99

1010
steps:
1111
- uses: dtolnay/rust-toolchain@stable

.github/workflows/build-all.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
container: ${{ matrix.container }}
1212
env:
13-
GHC_VERSION: '9.4.7'
13+
GHC_VERSION: '9.4.8'
1414

1515

1616
defaults:
@@ -23,19 +23,19 @@ jobs:
2323
include:
2424
- os: ubuntu-latest
2525
os-name: Linux
26-
container: fossa/haskell-static-alpine:ghc-9.4.7
26+
container: fossa/haskell-static-alpine:ghc-9.4.8
2727
project-file: cabal.project.ci.linux
28-
ghc: '9.4.7'
28+
ghc: '9.4.8'
2929

3030
- os: macos-latest
3131
os-name: macOS
3232
project-file: cabal.project.ci.macos
33-
ghc: '9.4.7'
33+
ghc: '9.4.8'
3434

3535
- os: windows-latest
3636
os-name: Windows
3737
project-file: cabal.project.ci.windows
38-
ghc: '9.4.7'
38+
ghc: '9.4.8'
3939

4040
steps:
4141

@@ -56,7 +56,7 @@ jobs:
5656
if: ${{ !contains(matrix.os, 'ubuntu') }}
5757
with:
5858
ghc-version: ${{ matrix.ghc }}
59-
cabal-version: '3.8.1.0'
59+
cabal-version: '3.10.2.1'
6060

6161
# Set up Rust.
6262
# This action installs the 'minimal' profile.

.github/workflows/integrations-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on:
1515
group: "FOSSA CLI Runner"
1616
# Be sure to update the env below too
17-
container: fossa/haskell-static-alpine:ghc-9.4.7
17+
container: fossa/haskell-static-alpine:ghc-9.4.8
1818

1919
env:
20-
GHC_VERSION: '9.4.7'
20+
GHC_VERSION: '9.4.8'
2121

2222
steps:
2323
- uses: dtolnay/rust-toolchain@stable

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
linter-check:
77
name: linter-check
88
runs-on: ubuntu-latest
9-
container: ghcr.io/fossas/haskell-dev-tools:9.4.7
9+
container: ghcr.io/fossas/haskell-dev-tools:9.4.8
1010

1111
steps:
1212
- uses: dtolnay/rust-toolchain@stable
@@ -39,7 +39,7 @@ jobs:
3939
format-check:
4040
name: formatter-check
4141
runs-on: ubuntu-latest
42-
container: ghcr.io/fossas/haskell-dev-tools:9.4.7
42+
container: ghcr.io/fossas/haskell-dev-tools:9.4.8
4343

4444
steps:
4545
- uses: dtolnay/rust-toolchain@stable
@@ -56,7 +56,7 @@ jobs:
5656
cabal-format-check:
5757
name: cabal-format-check
5858
runs-on: ubuntu-latest
59-
container: ghcr.io/fossas/haskell-dev-tools:9.4.7
59+
container: ghcr.io/fossas/haskell-dev-tools:9.4.8
6060

6161
steps:
6262
- uses: actions/checkout@v4

.stan.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore = [{ id = "STAN-0206" }]

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ current_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
33

44
FMT_OPTS := -co -XTypeApplications -o -XImportQualifiedPost
55
FIND_OPTS := src test integration-test -type f -name '*.hs'
6-
GHC_VERSION := 9.4.7
6+
GHC_VERSION := 9.4.8
77
DEV_TOOLS := ghcr.io/fossas/haskell-dev-tools:${GHC_VERSION}
88
MOUNTED_DEV_TOOLS_OPTS := --rm
99
MOUNTED_DEV_TOOLS_OPTS += --mount "type=bind,source=${current_dir},target=/fossa-cli"

cabal.project.ci.windows

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
executable-static: True
2-
-- -split-sections causes errors on Windows with GHC 9.4 and is off by default.
3-
-- I filed a bug about it here: https://gitlab.haskell.org/ghc/ghc/-/issues/23961
4-
-- -split-sections are meant to reduce executable size: https://downloads.haskell.org/ghc/9.4.7/docs/users_guide/phases.html?highlight=split%20sections#ghc-flag--split-sections
5-
-- The binaries made in CI without this were ~122 MB to ~116 MB with this option.
6-
-- Compressed, the differences is < 1 MB so I don't think holding off the upgrade for this is worthwhile.
7-
-- It may be worth looking into in the future to see if this can be turned back on though.
8-
split-sections: False
2+
split-sections: True
93
tests: True
104
optimization: 2
115
jobs: $ncpus

src/App/Fossa/Analyze/Filter.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ checkForEmptyUpload includeAll discovered filtered additionalUnits firstPartySca
3232
(_, _, Just licenseSourceUnit) -> CountedScanUnits $ SourceAndLicenseUnits discoveredUnits licenseSourceUnit
3333
(_, _, Nothing) -> CountedScanUnits . SourceUnitOnly $ discoveredUnits
3434
else -- If we have a additional source units, then there's always something to upload.
35-
case licensesMaybeFound of
36-
Nothing -> CountedScanUnits . SourceUnitOnly $ additionalUnits ++ discoveredUnits
37-
Just licenseSourceUnit -> CountedScanUnits $ SourceAndLicenseUnits (additionalUnits ++ discoveredUnits) licenseSourceUnit
35+
case licensesMaybeFound of
36+
Nothing -> CountedScanUnits . SourceUnitOnly $ additionalUnits ++ discoveredUnits
37+
Just licenseSourceUnit -> CountedScanUnits $ SourceAndLicenseUnits (additionalUnits ++ discoveredUnits) licenseSourceUnit
3838
where
3939
discoveredLen = length discovered
4040
filteredLen = length filtered

src/App/Fossa/Config/ConfigFile.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,8 @@ instance FromJSON ExperimentalGradleConfigs where
359359

360360
instance FromJSON MavenScopeConfig where
361361
parseJSON = withObject "MavenScopeConfig" $ \obj ->
362-
MavenScopeOnlyConfig
363-
<$> (Set.fromList <$> obj .: "scope-only" .!= [])
364-
<|> MavenScopeExcludeConfig <$> (Set.fromList <$> obj .:? "scope-exclude" .!= [])
362+
MavenScopeOnlyConfig . Set.fromList <$> (obj .: "scope-only" .!= [])
363+
<|> MavenScopeExcludeConfig . Set.fromList <$> (obj .:? "scope-exclude" .!= [])
365364

366365
instance FromJSON ConfigTelemetry where
367366
parseJSON = withObject "ConfigTelemetry" $ \obj ->

src/Container/Docker/OciManifest.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ data OciManifestLayer = OciManifestLayer
7272

7373
instance FromJSON OciManifestLayer where
7474
parseJSON = withObject "LayerEntry" $ \o ->
75-
OciManifestLayer
76-
<$> (RepoDigest <$> o .: "digest")
75+
OciManifestLayer . RepoDigest
76+
<$> (o .: "digest")
7777
<*> o .: "mediaType"
7878

7979
data LayerKind

src/Data/Rpm/DbHeaderBlob/Internal.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ readHeaderBlobTagData :: BLS.ByteString -> HeaderBlob -> Either String [TagValue
305305
readHeaderBlobTagData bs HeaderBlob{..} = do
306306
let firstEntry = NonEmpty.head entryMetadatas
307307
if tag firstEntry >= TagHeaderI18nTable
308-
then -- v3 entries, these seem to be uncommon. They are distinct from > v4
309-
-- entries in that they don't have a specialized region for v3 data, which
310-
-- is why the function doesn't skip the first element of entryMetadatas
311-
308+
then
309+
-- v3 entries, these seem to be uncommon. They are distinct from > v4
310+
-- entries in that they don't have a specialized region for v3 data, which
311+
-- is why the function doesn't skip the first element of entryMetadatas
312312
bimap
313313
("Failed to parse legacy index entries: " <>)
314314
fst

src/Fossa/API/Types.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,8 @@ data UploadResponse = UploadResponse
674674

675675
instance FromJSON UploadResponse where
676676
parseJSON = withObject "UploadResponse" $ \obj ->
677-
UploadResponse
678-
<$> (parseLocator <$> obj .: "locator")
677+
UploadResponse . parseLocator
678+
<$> (obj .: "locator")
679679
<*> obj .:? "error"
680680
<*> obj .:? "warnings"
681681

src/Strategy/Maven/PluginTree.hs

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ parseArtifactChild prefixCount =
6868
pos <- currentColumn
6969
if pos == prefixCount
7070
then -- The parser is where we expect a child of its parent to be positioned
71-
7271
lexeme (string "+-" <|> string "\\-")
7372
*> parseTextArtifactAndChildren False
7473
else fail "can't parse child"

src/Strategy/Python/Pip.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pipShowParser = many (try parseMetadata <|> try parseSection)
9090
parseMetadata = do
9191
name <- parseField "Name"
9292
version <- parseField "Version"
93-
requires <- filter (/= "") <$> (Text.splitOn ", " <$> parseField "Requires")
93+
requires <- filter (/= "") . Text.splitOn ", " <$> (parseField "Requires")
9494
pure $ PackageMetadata name version requires
9595

9696
parseField :: Text -> Parser Text

src/Strategy/R/Renv.hs

+19-19
Original file line numberDiff line numberDiff line change
@@ -166,27 +166,27 @@ buildGraph description renvLock = run . evalGrapher $ do
166166
let allDirectPkgs = allPkgNames description
167167

168168
if null $ Map.toList allLockPackages
169-
then -- We have empty lock file, and only description manifest
170-
-- create direct dependencies
169+
then
170+
-- We have empty lock file, and only description manifest
171+
-- create direct dependencies
172+
for_ (toList allDirectPkgs) $ \pkgReq -> do
173+
direct $ toCranDependency pkgReq
174+
else
175+
-- We have non-empty lock file, and description manifest
176+
-- create complete dependency graph. Any dependency that
177+
-- is mentioned in description is considered to be direct
178+
for_ (Map.toList allLockPackages) $ \(_, pkgMetadata) -> do
179+
let currentDep = toDependency allRepositories pkgMetadata
180+
let childDeps =
181+
map (toDependency allRepositories) $
182+
mapMaybe (`Map.lookup` allLockPackages) (pkgRequirements pkgMetadata)
171183

172-
for_ (toList allDirectPkgs) $ \pkgReq -> do
173-
direct $ toCranDependency pkgReq
174-
else -- We have non-empty lock file, and description manifest
175-
-- create complete dependency graph. Any dependency that
176-
-- is mentioned in description is considered to be direct
184+
if Set.member (pkgName pkgMetadata) allDirectPkgs
185+
then direct currentDep
186+
else deep currentDep
177187

178-
for_ (Map.toList allLockPackages) $ \(_, pkgMetadata) -> do
179-
let currentDep = toDependency allRepositories pkgMetadata
180-
let childDeps =
181-
map (toDependency allRepositories) $
182-
mapMaybe (`Map.lookup` allLockPackages) (pkgRequirements pkgMetadata)
183-
184-
if Set.member (pkgName pkgMetadata) allDirectPkgs
185-
then direct currentDep
186-
else deep currentDep
187-
188-
for_ childDeps $
189-
edge currentDep
188+
for_ childDeps $
189+
edge currentDep
190190

191191
toCranDependency :: Text -> Dependency
192192
toCranDependency pkg = Dependency CranType pkg Nothing mempty mempty mempty

src/Strategy/Swift/Xcode/PbxprojParser.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ parseAsciiValue :: Parser AsciiValue
118118
parseAsciiValue = try parseAsciiDict <|> try parseAsciiList <|> parseAsciiText
119119

120120
parseAsciiDict :: Parser AsciiValue
121-
parseAsciiDict = ADict <$> (Map.fromList <$> lexeme (betweenCurlyBrackets $ sepEndBy (try parseAsciiKeyValue) (symbol ";")))
121+
parseAsciiDict = ADict . Map.fromList <$> (lexeme (betweenCurlyBrackets $ sepEndBy (try parseAsciiKeyValue) (symbol ";")))
122122

123123
parseAsciiKeyValue :: Parser (Text, AsciiValue)
124124
parseAsciiKeyValue = do

test/App/Fossa/Report/AttributionSpec.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ defaultRange = Range.linear 0 50
1717

1818
genLicense :: Gen License
1919
genLicense =
20-
License
21-
<$> (LicenseName <$> arbitraryText)
20+
License . LicenseName
21+
<$> arbitraryText
2222
<*> Gen.maybe (LicenseContents <$> arbitraryText)
2323

2424
genProject :: Gen Project

0 commit comments

Comments
 (0)