Skip to content

Commit d605142

Browse files
authored
Remove certifier from plutus-tx-plugin (#7390)
* Remove certifier from plutus-tx-plugin * Add changelog
1 parent 856319c commit d605142

File tree

4 files changed

+6
-32
lines changed

4 files changed

+6
-32
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Removed
2+
3+
- Removed the experimental compiler certification option temporarily due to ghc issues regarding the profiling build of `plutus-metatheory`.
4+

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,10 @@ library
8282
, extra
8383
, ghc
8484
, lens
85-
, megaparsec
8685
, mtl
8786
, plutus-core ^>=1.54
8887
, plutus-core:flat
8988
, plutus-core:plutus-ir
90-
, plutus-metatheory ^>=1.54
9189
, plutus-tx ^>=1.54
9290
, prettyprinter
9391
, template-haskell

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import PlutusIR.Compiler.Types qualified as PIR
1919
import PlutusTx.Compiler.Types
2020
import UntypedPlutusCore qualified as UPLC
2121

22-
import Control.Applicative (many, optional, (<|>))
2322
import Control.Exception
2423
import Control.Lens
2524
import Data.Bifunctor (first)
@@ -36,7 +35,6 @@ import Data.Text qualified as Text
3635
import Data.Type.Equality
3736
import GHC.Plugins qualified as GHC
3837
import Prettyprinter
39-
import Text.Megaparsec.Char (alphaNumChar, char, upperChar)
4038

4139
import Text.Read (readMaybe)
4240
import Type.Reflection
@@ -78,7 +76,6 @@ data PluginOptions = PluginOptions
7876
-- Which effectively ignores the trace text.
7977
_posRemoveTrace :: Bool
8078
, _posDumpCompilationTrace :: Bool
81-
, _posCertify :: Maybe String
8279
}
8380

8481
makeLenses ''PluginOptions
@@ -310,18 +307,6 @@ pluginOptions =
310307
, let k = "dump-compilation-trace"
311308
desc = "Dump compilation trace for debugging"
312309
in (k, PluginOption typeRep (setTrue k) posDumpCompilationTrace desc [])
313-
, let k = "certify"
314-
desc =
315-
"Produce a certificate for the compiled program, with the given name. "
316-
<> "This certificate provides evidence that the compiler optimizations have "
317-
<> "preserved the functional behavior of the original program. "
318-
<> "Currently, this is only supported for the UPLC compilation pipeline. "
319-
<> "Warning: this is an experimental feature and may not work as expected."
320-
p = optional $ do
321-
firstC <- upperChar
322-
rest <- many (alphaNumChar <|> char '_' <|> char '\\')
323-
pure (firstC : rest)
324-
in (k, PluginOption typeRep (plcParserOption p k) posCertify desc [])
325310
]
326311

327312
flag :: (a -> a) -> OptionKey -> Maybe OptionValue -> Validation ParseError (a -> a)
@@ -394,7 +379,6 @@ defaultPluginOptions =
394379
, _posPreserveLogging = True
395380
, _posRemoveTrace = False
396381
, _posDumpCompilationTrace = False
397-
, _posCertify = Nothing
398382
}
399383

400384
processOne

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,9 @@ import PlutusIR.Compiler.Types qualified as PIR
8383
import PlutusIR.Transform.RewriteRules
8484
import PlutusIR.Transform.RewriteRules.RemoveTrace (rewriteRuleRemoveTrace)
8585
import Prettyprinter qualified as PP
86-
import System.IO (hPutStrLn, openBinaryTempFile, stderr)
86+
import System.IO (openBinaryTempFile)
8787
import System.IO.Unsafe (unsafePerformIO)
8888

89-
import Certifier
90-
9189
data PluginCtx = PluginCtx
9290
{ pcOpts :: PluginOptions
9391
, pcFamEnvs :: GHC.FamInstEnvs
@@ -638,17 +636,7 @@ runCompiler moduleName opts expr = do
638636
modifyError PLC.TypeErrorE $
639637
PLC.inferTypeOfProgram plcTcConfig (plcP $> annMayInline)
640638

641-
let optCertify = opts ^. posCertify
642-
(uplcP, simplTrace) <- flip runReaderT plcOpts $ PLC.compileProgramWithTrace plcP
643-
liftIO $ case optCertify of
644-
Just certName -> do
645-
result <- runCertifier $ mkCertifier simplTrace certName
646-
case result of
647-
Right certSuccess ->
648-
hPutStrLn stderr $ prettyCertifierSuccess certSuccess
649-
Left err ->
650-
hPutStrLn stderr $ prettyCertifierError err
651-
Nothing -> pure ()
639+
(uplcP, _) <- flip runReaderT plcOpts $ PLC.compileProgramWithTrace plcP
652640
dbP <- liftExcept $ modifyError PLC.FreeVariableErrorE $ traverseOf UPLC.progTerm UPLC.deBruijnTerm uplcP
653641
when (opts ^. posDumpUPlc) . liftIO $
654642
dumpFlat

0 commit comments

Comments
 (0)