Skip to content

Commit 8abff4e

Browse files
committed
Remove possibility to create external binding specs from TH mode
1 parent 074d5fa commit 8abff4e

File tree

6 files changed

+10
-30
lines changed

6 files changed

+10
-30
lines changed

hs-bindgen/app/HsBindgen/App.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ parseConfig = Config
161161
<*> parseSelectPredicate
162162
<*> parseProgramSlicing
163163
<*> parsePathStyle
164-
<*> optional parseGenBindingSpec
165164

166165
{-------------------------------------------------------------------------------
167166
Binding specifications

hs-bindgen/app/HsBindgen/Cli/Preprocess.hs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ info = progDesc "Generate Haskell module from C headers"
3939
-------------------------------------------------------------------------------}
4040

4141
data Opts = Opts {
42-
config :: Config
43-
, uniqueId :: UniqueId
44-
, hsModuleName :: Hs.ModuleName
45-
, hsOutputDir :: FilePath
46-
, outputDirPolicy :: OutputDirPolicy
42+
config :: Config
43+
, uniqueId :: UniqueId
44+
, hsModuleName :: Hs.ModuleName
45+
, hsOutputDir :: FilePath
46+
, outputDirPolicy :: OutputDirPolicy
47+
, outputBindingSpec :: Maybe FilePath
4748
-- NOTE: Inputs (arguments) must be last, options must go before it.
48-
, inputs :: [UncheckedHashIncludeArg]
49+
, inputs :: [UncheckedHashIncludeArg]
4950
}
5051
deriving (Generic)
5152

@@ -57,6 +58,7 @@ parseOpts =
5758
<*> parseHsModuleName
5859
<*> parseHsOutputDir
5960
<*> parseOutputDirPolicy
61+
<*> optional parseGenBindingSpec
6062
<*> parseInputs
6163

6264
{-------------------------------------------------------------------------------
@@ -85,7 +87,7 @@ exec GlobalOpts{..} Opts{..} = do
8587
artefacts :: Artefact ()
8688
artefacts = do
8789
writeBindingsMultiple hsOutputDir
88-
forM_ config.outputBindingSpec writeBindingSpec
90+
forM_ outputBindingSpec writeBindingSpec
8991

9092
{-------------------------------------------------------------------------------
9193
Exception

hs-bindgen/fixtures/simple-binding-spec.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

hs-bindgen/src-internal/HsBindgen/Config.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ data Config_ path = Config {
4747

4848
-- * Backend
4949
, haddockPathStyle :: PathStyle
50-
51-
-- * Binding specifications
52-
, outputBindingSpec :: Maybe path
5350
}
5451
deriving stock (Show, Eq, Generic)
5552
deriving stock (Functor, Foldable, Traversable)

hs-bindgen/src-internal/HsBindgen/TH/Internal.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ withHsBindgen config ConfigTH{..} hashIncludes = do
9797
artefact = do
9898
deps <- Dependencies
9999
decls <- FinalDecls
100-
case config.outputBindingSpec of
101-
Nothing -> pure ()
102-
Just rfp -> writeBindingSpec (toFilePath packageRoot rfp)
103100
pure (deps, mergeDecls safety decls)
104101

105102
(deps, decls) <- liftIO $

hs-bindgen/test/th/Test/TH/Simple.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
module Test.TH.Simple where
1313

14-
import Optics ((%), (&), (.~), (?~))
14+
import Optics ((%), (&), (.~))
1515

1616
import HsBindgen.Runtime.Prelude qualified
1717

@@ -22,7 +22,6 @@ let cfg :: Config
2222
& #clang % #extraIncludeDirs .~ [
2323
Pkg "examples"
2424
]
25-
& #outputBindingSpec ?~ Pkg "fixtures/simple-binding-spec.yaml"
2625
cfgTH :: ConfigTH
2726
cfgTH = def
2827
& #verbosity .~ Verbosity Warning

0 commit comments

Comments
 (0)