Skip to content

Commit a2990b6

Browse files
committed
Merge remote-tracking branch 'origin/master' into release
2 parents 741d007 + 698c143 commit a2990b6

File tree

7 files changed

+31
-362
lines changed

7 files changed

+31
-362
lines changed

booster/tools/rpc-client/RpcClient.hs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module RpcClient (
1515
) where
1616

1717
import Codec.Archive.Tar qualified as Tar
18-
import Codec.Archive.Tar.Check qualified as Tar
18+
import Codec.Archive.Tar.Entry qualified as Tar
1919
import Codec.Compression.BZip qualified as BZ2
2020
import Codec.Compression.GZip qualified as GZip
2121
import Control.Exception
@@ -505,20 +505,24 @@ runTarball common (Just sock) tarFile keepGoing runOnly compareDetails = do
505505
| ".tar.bz2" `isSuffixOf` takeExtensions tarFile = Tar.read . BZ2.decompress
506506
| otherwise = Tar.read
507507

508-
containedFiles <- unpackTar <$> BS.readFile tarFile
509-
let checked = Tar.checkSecurity containedFiles
508+
entries <- Tar.decodeLongNames . unpackTar <$> BS.readFile tarFile
510509
-- probe server connection before doing anything, display
511510
-- instructions unless server was found.
512-
runAllRequests checked sock
511+
runAllRequests entries sock
513512
where
514513
runAllRequests ::
515-
Tar.Entries (Either Tar.FormatError Tar.FileNameError) -> Socket -> IO ()
514+
Tar.GenEntries
515+
FilePath
516+
a
517+
(Either Tar.FormatError Tar.DecodeLongNamesError) ->
518+
Socket ->
519+
IO ()
516520
runAllRequests checked skt = cancelIfInterrupted skt $ do
517521
withTempDir $ \tmp -> withLogLevel common.logLevel $ do
518522
-- unpack relevant tar files (rpc_* directories only)
519523
logInfo_ $ unwords ["unpacking json files from tarball", tarFile, "into", tmp]
520524
(jsonFiles, sequenceMap) <-
521-
liftIO $ Tar.foldEntries (unpackIfRpc tmp) (pure mempty) throwAnyError checked
525+
liftIO $ Tar.foldEntries (unpackIfRpc tmp) (pure mempty) (error . show) checked
522526
logInfo_ $ "RPC data:" <> show jsonFiles
523527
logInfo_ $ "Sequence data:" <> show sequenceMap
524528

@@ -543,10 +547,6 @@ runTarball common (Just sock) tarFile keepGoing runOnly compareDetails = do
543547
liftIO $ shutdown skt ShutdownReceive
544548
liftIO $ exitWith (if all isNothing results then ExitSuccess else ExitFailure 2)
545549

546-
-- complain on any errors in the tarball
547-
throwAnyError :: Either Tar.FormatError Tar.FileNameError -> IO a
548-
throwAnyError = either throwIO throwIO
549-
550550
compareSequence :: Ord a => Ord b => Map.Map a b -> a -> a -> Ordering
551551
compareSequence seqMap a b = case (Map.lookup a seqMap, Map.lookup b seqMap) of
552552
(Nothing, Nothing) -> compare a b
@@ -557,11 +557,11 @@ runTarball common (Just sock) tarFile keepGoing runOnly compareDetails = do
557557
-- unpack all */*.json files into dir and return their names
558558
unpackIfRpc ::
559559
FilePath ->
560-
Tar.Entry ->
560+
Tar.GenEntry FilePath a ->
561561
IO ([FilePath], Map.Map FilePath Int) ->
562562
IO ([FilePath], Map.Map FilePath Int)
563563
unpackIfRpc tmpDir entry acc = do
564-
case splitFileName (Tar.entryPath entry) of
564+
case splitFileName (Tar.entryTarPath entry) of
565565
-- unpack all directories "<something>" containing "*.json" files
566566
(dir, "") -- directory
567567
| Tar.Directory <- Tar.entryContent entry -> do

cabal.project.freeze

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ constraints: any.Cabal ==3.10.3.0,
3737
any.bytesmith ==0.3.11.1,
3838
any.bytestring ==0.11.5.3,
3939
any.bz2 ==1.0.1.2,
40-
any.cabal-doctest ==1.0.9,
40+
any.cabal-doctest ==1.0.10,
4141
any.call-stack ==0.4.0,
4242
any.case-insensitive ==1.2.1.0,
4343
any.casing ==0.1.4.1,
@@ -81,6 +81,7 @@ constraints: any.Cabal ==3.10.3.0,
8181
any.extra ==1.7.16,
8282
any.fast-logger ==3.2.3,
8383
any.fgl ==5.8.2.0,
84+
any.file-embed ==0.0.11.2,
8485
any.filepath ==1.4.300.1,
8586
any.free ==5.2,
8687
any.generic-lens ==2.2.2.0,
@@ -91,6 +92,7 @@ constraints: any.Cabal ==3.10.3.0,
9192
any.ghc-compact ==0.1.0.0,
9293
any.ghc-events ==0.19.0.1,
9394
any.ghc-prim ==0.10.0,
95+
any.ghc-prof ==1.4.1.12,
9496
any.ghc-trace-events ==0.1.2.9,
9597
any.gitrev ==1.3.1,
9698
any.graphviz ==2999.20.2.0,
@@ -117,6 +119,7 @@ constraints: any.Cabal ==3.10.3.0,
117119
any.integer-logarithms ==1.0.3.1,
118120
any.intern ==0.9.5,
119121
any.invariant ==0.6.3,
122+
any.js-jquery ==3.3.1,
120123
any.json-rpc ==1.0.4,
121124
any.junit-xml ==0.1.0.3,
122125
any.kan-extensions ==5.2.6,
@@ -148,6 +151,7 @@ constraints: any.Cabal ==3.10.3.0,
148151
any.old-locale ==1.0.0.7,
149152
any.old-time ==1.1.0.4,
150153
any.optparse-applicative ==0.18.1.0,
154+
any.os-string ==2.0.2.2,
151155
any.parallel ==3.2.2.0,
152156
any.parsec ==3.1.16.1,
153157
any.parser-combinators ==1.3.0,
@@ -162,6 +166,8 @@ constraints: any.Cabal ==3.10.3.0,
162166
any.primitive-offset ==0.2.0.1,
163167
any.primitive-unlifted ==2.1.0.0,
164168
any.process ==1.6.19.0,
169+
any.profiteur ==0.4.7.0,
170+
profiteur +embed-data-files,
165171
any.profunctors ==5.6.2,
166172
any.quickcheck-instances ==0.3.30,
167173
quickcheck-instances -bytestring-builder,
@@ -198,7 +204,7 @@ constraints: any.Cabal ==3.10.3.0,
198204
any.string-conversions ==0.4.0.1,
199205
any.syb ==0.7.2.4,
200206
any.tagged ==0.8.8,
201-
any.tar ==0.5.1.1,
207+
any.tar ==0.6.3.0,
202208
any.tasty ==1.4.3,
203209
tasty +unix,
204210
any.tasty-discover ==5.0.0,
@@ -254,4 +260,4 @@ constraints: any.Cabal ==3.10.3.0,
254260
any.yaml ==0.11.11.2,
255261
any.zigzag ==0.0.1.0,
256262
any.zlib ==0.6.3.0
257-
index-state: hackage.haskell.org 2024-05-24T09:11:31Z
263+
index-state: hackage.haskell.org 2024-07-22T06:21:59Z

dev-tools/package.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -173,33 +173,6 @@ executables:
173173
- hs-backend-booster
174174
ghc-options:
175175
- -rtsopts
176-
tarball-compare:
177-
source-dirs: tarball-compare
178-
main: Main
179-
dependencies:
180-
- aeson
181-
- aeson-pretty
182-
- base
183-
- bytestring
184-
- bz2
185-
- clock
186-
- containers
187-
- directory
188-
- extra
189-
- filepath
190-
- hs-backend-booster
191-
- kore-rpc-types
192-
- monad-logger
193-
- optparse-applicative
194-
- prettyprinter
195-
- recursion-schemes
196-
- tar
197-
- text
198-
- transformers
199-
- vector
200-
- zlib
201-
ghc-options:
202-
- -rtsopts
203176
kore-rpc-dev:
204177
source-dirs: kore-rpc-dev
205178
main: Server.hs

0 commit comments

Comments
 (0)