Skip to content

Commit 2d345df

Browse files
committed
doen
1 parent 5dc8ff0 commit 2d345df

6 files changed

Lines changed: 23 additions & 36 deletions

File tree

nix/outputs.nix

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,19 @@ let
7777
project-variants-hydra-jobs = {
7878
ghc96 = (project.flake { }).hydraJobs.ghc96;
7979
ghc912 = (project.flake { }).hydraJobs.ghc912;
80+
ghc96-profiled = (project.flake { }).hydraJobs.ghc96-profiled;
81+
ghc912-profiled = (project.flake { }).hydraJobs.ghc912-profiled;
8082
};
8183

8284
project-variants-roots-and-plan-nix = {
8385
ghc96.roots = project-variants-hydra-jobs.ghc96.roots;
8486
ghc96.plan-nix = project-variants-hydra-jobs.ghc96.plan-nix;
8587
ghc912.roots = project-variants-hydra-jobs.ghc912.roots;
8688
ghc912.plan-nix = project-variants-hydra-jobs.ghc912.plan-nix;
89+
ghc96-profiled.roots = project-variants-hydra-jobs.ghc96-profiled.roots;
90+
ghc96-profiled.plan-nix = project-variants-hydra-jobs.ghc96-profiled.plan-nix;
91+
ghc912-profiled.roots = project-variants-hydra-jobs.ghc912-profiled.roots;
92+
ghc912-profiled.plan-nix = project-variants-hydra-jobs.ghc912-profiled.plan-nix;
8793
};
8894

8995
packages =
@@ -104,8 +110,8 @@ let
104110
devShells = rec {
105111
default = ghc96;
106112
ghc96 = mkShell "ghc96";
107-
ghc96-profiled = mkShell "ghc96-profiled";
108113
ghc912 = mkShell "ghc912";
114+
ghc96-profiled = mkShell "ghc96-profiled";
109115
ghc912-profiled = mkShell "ghc912-profiled";
110116
metatheory-jailbreak = metatheory-jailbreak-shell;
111117
};
@@ -116,15 +122,23 @@ let
116122
(packages) //
117123
{ ghc96 = project-variants-hydra-jobs.ghc96; } //
118124
{ ghc912 = project-variants-hydra-jobs.ghc912; } //
125+
{ ghc96-profiled = project-variants-hydra-jobs.ghc96-profiled; } //
126+
{ ghc912-profiled = project-variants-hydra-jobs.ghc912-profiled; } //
119127
{ devShells.ghc96 = devShells.ghc96; } //
120128
{ devShells.ghc912 = devShells.ghc912; } //
129+
{ devShells.ghc96-profiled = devShells.ghc96-profiled; } //
130+
{ devShells.ghc912-profiled = devShells.ghc912-profiled; } //
121131
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
122132
{ required = hydra-required-job; };
123133
"x86_64-darwin" =
124134
{ ghc96 = project-variants-hydra-jobs.ghc96; } //
125135
{ ghc912 = project-variants-hydra-jobs.ghc912; } //
136+
{ ghc96-profiled = project-variants-hydra-jobs.ghc96-profiled; } //
137+
{ ghc912-profiled = project-variants-hydra-jobs.ghc912-profiled; } //
126138
{ devShells.ghc96 = devShells.ghc96; } //
127139
{ devShells.ghc912 = devShells.ghc912; } //
140+
{ devShells.ghc96-profiled = devShells.ghc96-profiled; } //
141+
{ devShells.ghc912-profiled = devShells.ghc912-profiled; } //
128142
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
129143
{ required = hydra-required-job; };
130144
"aarch64-linux" =
@@ -133,6 +147,8 @@ let
133147
(project-variants-roots-and-plan-nix) //
134148
{ devShells.ghc96 = devShells.ghc96; } //
135149
{ devShells.ghc912 = devShells.ghc912; } //
150+
{ devShells.ghc96-profiled = devShells.ghc96-profiled; } //
151+
{ devShells.ghc912-profiled = devShells.ghc912-profiled; } //
136152
{ devShells.metatheory-jailbreak = metatheory-jailbreak-shell; } //
137153
{ required = hydra-required-job; };
138154
};

plutus-metatheory/plutus-metatheory.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ common lang
4848

4949
common ghc-version-support
5050
-- See the section on GHC versions in CONTRIBUTING
51-
if (impl(ghc <9.6) || impl(ghc >=9.7))
51+
if !((impl(ghc >=9.6) && impl(ghc <9.7)) || (impl(ghc >=9.12) && impl(ghc <9.13)))
5252
buildable: False
5353

5454
-- GHC 9.6 and 9.8 have a bug where profiling ticks cause a panic in

plutus-metatheory/src/FFI/Untyped.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module FFI.Untyped where
77
import PlutusCore.Default
88
import UntypedPlutusCore
99

10-
import Data.Text as T hiding (map)
10+
import Data.Text qualified as T hiding (map)
1111
import GHC.Exts (IsList (..))
1212

1313
-- Untyped (Raw) syntax

plutus-tx-plugin/plutus-tx-plugin.cabal

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ common os-support
5050
if (impl(ghcjs) || os(windows))
5151
buildable: False
5252

53-
flag certify
54-
default: False
55-
manual: True
56-
description: Build with the Agda-based compiler certification tool.
57-
5853
library
5954
import: lang, ghc-version-support, os-support
6055
hs-source-dirs: src
@@ -88,23 +83,18 @@ library
8883
, extra
8984
, ghc
9085
, lens
86+
, megaparsec
9187
, mtl
9288
, plutus-core ^>=1.58
9389
, plutus-core:flat
9490
, plutus-core:plutus-ir
91+
, plutus-metatheory ^>=1.58
9592
, plutus-tx ^>=1.58
9693
, prettyprinter
9794
, template-haskell
9895
, text
9996
, uniplate
10097

101-
if flag(certify)
102-
build-depends:
103-
, megaparsec
104-
, plutus-metatheory ^>=1.58
105-
106-
cpp-options: -DCERTIFY
107-
10898
executable gen-plugin-opts-doc
10999
import: lang, ghc-version-support, os-support
110100
main-is: GeneratePluginOptionsDoc.hs

plutus-tx-plugin/src/PlutusTx/Options.hs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
-- editorconfig-checker-disable-file
32
{-# LANGUAGE CPP #-}
43
{-# LANGUAGE GADTs #-}
@@ -42,14 +41,10 @@ import Data.Text qualified as Text
4241
import Data.Type.Equality
4342
import GHC.Plugins qualified as GHC
4443
import Prettyprinter
45-
4644
import Text.Read (readMaybe)
4745
import Type.Reflection
48-
49-
#ifdef CERTIFY
5046
import Text.Megaparsec.Char (alphaNumChar, char, upperChar)
5147
import Control.Applicative (many, optional, (<|>))
52-
#endif
5348

5449
data PluginOptions = PluginOptions
5550
{ _posPlcTargetVersion :: PLC.Version
@@ -89,9 +84,7 @@ data PluginOptions = PluginOptions
8984
-- Which effectively ignores the trace text.
9085
_posRemoveTrace :: Bool
9186
, _posDumpCompilationTrace :: Bool
92-
#ifdef CERTIFY
9387
, _posCertify :: Maybe String
94-
#endif
9588
}
9689

9790
makeLenses ''PluginOptions
@@ -324,7 +317,6 @@ pluginOptions =
324317
, let k = "dump-compilation-trace"
325318
desc = "Dump compilation trace for debugging"
326319
in (k, PluginOption typeRep (setTrue k) posDumpCompilationTrace desc [])
327-
#ifdef CERTIFY
328320
, let k = "certify"
329321
desc =
330322
"Produce a certificate for the compiled program, with the given name. "
@@ -337,7 +329,6 @@ pluginOptions =
337329
rest <- many (alphaNumChar <|> char '_' <|> char '\\')
338330
pure (firstC : rest)
339331
in (k, PluginOption typeRep (plcParserOption p k) posCertify desc [])
340-
#endif
341332
]
342333

343334
flag :: (a -> a) -> OptionKey -> Maybe OptionValue -> Validation ParseError (a -> a)
@@ -411,9 +402,7 @@ defaultPluginOptions =
411402
, _posPreserveLogging = True
412403
, _posRemoveTrace = False
413404
, _posDumpCompilationTrace = False
414-
#ifdef CERTIFY
415405
, _posCertify = Nothing
416-
#endif
417406
}
418407

419408
processOne

plutus-tx-plugin/src/PlutusTx/Plugin.hs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE DataKinds #-}
32
{-# LANGUAGE FlexibleContexts #-}
43
{-# LANGUAGE LambdaCase #-}
@@ -85,13 +84,10 @@ import PlutusIR.Compiler.Types qualified as PIR
8584
import PlutusIR.Transform.RewriteRules
8685
import PlutusIR.Transform.RewriteRules.RemoveTrace (rewriteRuleRemoveTrace)
8786
import Prettyprinter qualified as PP
88-
import System.IO (openBinaryTempFile)
87+
import System.IO (openBinaryTempFile, hPutStrLn, stderr)
8988
import System.IO.Unsafe (unsafePerformIO)
90-
91-
#ifdef CERTIFY
9289
import Certifier (runCertifier, mkCertifier, prettyCertifierError, prettyCertifierSuccess)
93-
import System.IO (hPutStrLn, stderr)
94-
#endif
90+
9591

9692
data PluginCtx = PluginCtx
9793
{ pcOpts :: PluginOptions
@@ -644,7 +640,6 @@ runCompiler moduleName opts expr = do
644640
modifyError PLC.TypeErrorE $
645641
PLC.inferTypeOfProgram plcTcConfig (plcP $> annMayInline)
646642

647-
#ifdef CERTIFY
648643
let optCertify = opts ^. posCertify
649644
(uplcP, simplTrace) <- flip runReaderT plcOpts $ PLC.compileProgramWithTrace plcP
650645
liftIO $ case optCertify of
@@ -656,9 +651,6 @@ runCompiler moduleName opts expr = do
656651
Left err ->
657652
hPutStrLn stderr $ prettyCertifierError err
658653
Nothing -> pure ()
659-
#else
660-
(uplcP, _) <- flip runReaderT plcOpts $ PLC.compileProgramWithTrace plcP
661-
#endif
662654

663655
dbP <- liftExcept $ modifyError PLC.FreeVariableErrorE $ traverseOf UPLC.progTerm UPLC.deBruijnTerm uplcP
664656
when (opts ^. posDumpUPlc) . liftIO $

0 commit comments

Comments
 (0)