Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,6 @@ jobs:
- name: prepare for constraint sets
run: |
rm -f cabal.project.local
- name: constraint set no-lukko
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hackage-security -lukko' all --dry-run
cabal-plan topo | sort
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hackage-security -lukko' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hackage-security -lukko' all
- name: save cache
if: always()
uses: actions/cache/save@v5
Expand Down
3 changes: 0 additions & 3 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ raw-project
constraints:
base-compat >= 0.12.2

constraint-set no-lukko
constraints: hackage-security -lukko
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was probably the wrong way round: since lukko was off by default, this constraint-set did not test anything (I suppose the intention was to actually test lukko). This explains why CI on GHC 9.14 did not fail despite lukko not being available.


-- constraint-set containers-0.7
-- -- Andreas, 2024-03-19: possibly we will have to turn off the constraint set
-- -- for the head.hackage build with GHC 9.10.0
Expand Down
2 changes: 0 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ packages: hackage-security

package hackage-security
tests: true

-- constraints: hackage-security -lukko
5 changes: 5 additions & 0 deletions hackage-security/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
See also http://pvp.haskell.org/faq

Unreleased
-------
* Remove `lukko` package flag. Now we unconditionally use `GHC.IO.Handle.Lock`
instead of the [`lukko` package](https://hackage.haskell.org/package/lukko).

0.6.3.2
-------

Expand Down
10 changes: 0 additions & 10 deletions hackage-security/hackage-security.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ flag Cabal-syntax
manual: False
default: False

flag lukko
description: Use @lukko@ for file-locking, otherwise use @GHC.IO.Handle.Lock@
manual: False
default: False

library
-- Most functionality is exported through the top-level entry points .Client
-- and .Server; the other exported modules are intended for qualified imports.
Expand Down Expand Up @@ -133,11 +128,6 @@ library
-- whatever versions are bundled with ghc:
ghc-prim >= 0.5.2 && < 0.14

if flag(lukko)
build-depends: lukko >= 0.1 && < 0.2
else
build-depends: base >= 4.11

if flag(Cabal-syntax)
build-depends: Cabal-syntax >= 3.7 && < 3.18
else
Expand Down
40 changes: 1 addition & 39 deletions hackage-security/src/Hackage/Security/Util/IO.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE CPP #-}
module Hackage.Security.Util.IO (
-- * Miscelleneous
getFileSize
Expand All @@ -18,14 +17,7 @@ import System.IO.Error

import Hackage.Security.Util.Path

#ifdef MIN_VERSION_lukko
import Lukko (FD, fileLockingSupported, fdOpen, fdClose, fdLock, fdUnlock, LockMode(ExclusiveLock))
#else
import GHC.IO.Handle.Lock (hLock, LockMode(ExclusiveLock), FileLockingNotSupported)
#if MIN_VERSION_base(4,11,0)
import GHC.IO.Handle.Lock (hUnlock)
#endif
#endif
import GHC.IO.Handle.Lock (hLock, hUnlock, LockMode(ExclusiveLock), FileLockingNotSupported)

{-------------------------------------------------------------------------------
Miscelleneous
Expand Down Expand Up @@ -85,33 +77,6 @@ withDirLock logger dir
logger (WithDirLockEventPost lock)
return h

#ifdef MIN_VERSION_lukko
takeLock :: IO FD
takeLock
| fileLockingSupported = do
h <- fdOpen lock'
wrapLog (fdLock h ExclusiveLock `onException` fdClose h)
return h
| otherwise = wrapLog takeDirLock
where
takeDirLock :: IO FD
takeDirLock = handle onCreateDirError $ do
createDirectory lock
return (undefined :: FD)

onCreateDirError :: IOError -> IO FD
onCreateDirError ioe
| isAlreadyExistsError ioe = threadDelay (1*1000*1000) >> takeDirLock
| otherwise = fail (me++"error creating directory lock: "++show ioe)

releaseLock h
| fileLockingSupported = do
fdUnlock h
fdClose h
| otherwise =
removeDirectory lock

#else
takeLock = do
h <- openFile lock' ReadWriteMode
wrapLog $ handle (fallbackToDirLock h) $ do
Expand Down Expand Up @@ -142,12 +107,9 @@ withDirLock logger dir
(me++"cannot remove lock file before directory lock fallback")

releaseLock (Just h) =
#if MIN_VERSION_base(4,11,0)
hUnlock h >>
#endif
hClose h
releaseLock Nothing = removeDirectory lock
#endif

{-------------------------------------------------------------------------------
Debugging
Expand Down
3 changes: 0 additions & 3 deletions stack-8.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ flags:
cabal-syntax: false
hackage-security:
cabal-syntax: false
lukko: false
# LTS 12 does not have lukko yet

extra-deps:
- Cabal-syntax-3.6.0.0
- aeson-1.4.3.0
## aeson-1.4.3.0 is the newest that works with the other deps in LTS 12
## aeson-1.4.4.0 asks for time-compat >= 1.9.2.2
# - lukko-0.1.1.3
3 changes: 0 additions & 3 deletions stack-8.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ flags:
cabal-syntax: false
hackage-security:
cabal-syntax: false
lukko: false
# LTS 14 does not have lukko yet

extra-deps:
- Cabal-syntax-3.6.0.0
# - lukko-0.1.1.3
Loading