Skip to content

Commit

Permalink
Merge pull request #590 from objectionary/572-the-output-is-not-escap…
Browse files Browse the repository at this point in the history
…ed-on-error

Set the correct locale automatically
  • Loading branch information
deemp authored Dec 4, 2024
2 parents 6ea0324 + 6c09e3c commit ac7276d
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 80 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/ghc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
pattern: |
eo-phi-normalizer/**/*.hs
!${{ env.syntax-dir }}/**/*.hs
!eo-phi-normalizer/Setup.hs
- uses: haskell-actions/hlint-setup@v2

Expand Down Expand Up @@ -105,10 +104,6 @@ jobs:
submodules: true
ref: ${{ github.ref }}

- name: Set codepage on Windows
if: ${{ runner.os == 'Windows' }}
run: chcp 65001

- name: Restore Syntax files
id: restore-syntax-files
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -163,10 +158,6 @@ jobs:
submodules: true
ref: ${{ github.ref }}

- name: Set codepage on Windows
if: ${{ runner.os == 'Windows' }}
run: chcp 65001

- name: Restore Syntax files
id: restore-syntax-files
uses: actions/cache/restore@v4
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ repos:
exclude: |
(?x)^(
eo-phi-normalizer/src/Language/EO/Phi/Syntax/|
eo-phi-normalizer/Setup.hs
)
)
111 changes: 62 additions & 49 deletions eo-phi-normalizer/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
{- FOURMOLU_ENABLE -}
{-# LANGUAGE CPP #-}

{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}

-- Source: https://github.com/haskell/cabal/issues/6726#issuecomment-918663262
Expand All @@ -30,65 +32,76 @@
-- for the parsers included in Ogma.
module Main (main) where

import Control.Exception (SomeException, catch, displayException, evaluate)
import Data.ByteString as BS (readFile, writeFile)
import Data.List (intercalate)
import Data.Text (Text)
import Data.Text.Encoding (decodeUtf8, encodeUtf8)
import Distribution.Simple (defaultMainWithHooks, hookedPrograms, postConf, preBuild, simpleUserHooks)
import Distribution.Simple.Program (Program (..), findProgramVersion, simpleProgram)
import Main.Utf8 (withUtf8)
import PyF (fmt)
import System.Exit (ExitCode (..))
import System.Exit (ExitCode (..), exitWith)
import System.IO.CodePage (withCP65001)
import System.Process (callCommand)
import Text.Printf (printf)
import Control.Exception (evaluate)

readFile' :: FilePath -> IO Text
readFile' = (decodeUtf8 <$>) . BS.readFile

writeFile' :: FilePath -> Text -> IO ()
writeFile' path = BS.writeFile path . encodeUtf8

withCorrectLocale :: IO a -> IO a
withCorrectLocale act = do
let withCorrectLocale' = withCP65001 . Main.Utf8.withUtf8
withCorrectLocale' act
`catch` ( \(x :: SomeException) ->
withCorrectLocale' do
putStrLn (displayException x)
exitWith (ExitFailure 1)
)

-- | Run BNFC, happy, and alex on the grammar before the actual build step.
--
-- All options for bnfc are hard-coded here.
main :: IO ()
main =
defaultMainWithHooks $
simpleUserHooks
{ hookedPrograms = [bnfcProgram]
, postConf = \args flags packageDesc localBuildInfo -> do
let
isWindows =
#ifdef mingw32_HOST_OS
True
#else
False
#endif
-- See the details on the command form in https://github.com/objectionary/eo-phi-normalizer/issues/347#issuecomment-2117097070
addLicense :: FilePath -> IO ()
addLicense file = do
let readFile' path = do
content <- readFile path
evaluate (length content)
pure content
targetFile = "src/Language/EO/Phi/Syntax/" <> file
license <- readFile' "LICENSE"
let licenseFormatted = printf "{-\n%s-}\n\n" license
code <- readFile' targetFile
evaluate (length license)
writeFile targetFile (licenseFormatted <> code)

command = intercalate "; " $
[ "set -ex" ] <>
[ "chcp.com" | isWindows ] <>
[ "chcp.com 65001" | isWindows ] <>
[ "bnfc --haskell -d -p Language.EO.Phi --generic -o src/ grammar/EO/Phi/Syntax.cf"] <>
[ "cd src/Language/EO/Phi/Syntax" ] <>
[ "alex Lex.x" ] <>
[ "happy Par.y" ] <>
[ "true" ]

fullCommand = [fmt|bash -c ' {command} '|]

putStrLn fullCommand

_ <- callCommand fullCommand
_ <- addLicense "Abs.hs"
_ <- addLicense "Print.hs"

postConf simpleUserHooks args flags packageDesc localBuildInfo
}
withCorrectLocale $
defaultMainWithHooks $
simpleUserHooks
{ hookedPrograms = [bnfcProgram]
, postConf = \args flags packageDesc localBuildInfo -> do
let
addLicense :: FilePath -> IO ()
addLicense file = do
let targetFile = "src/Language/EO/Phi/Syntax/" <> file
license <- readFile' "LICENSE"
let licenseFormatted = [fmt|{{-\n{license}-}}\n\n|] :: Text
code <- readFile' targetFile
writeFile' targetFile (licenseFormatted <> code)

-- See the details on the command form in https://github.com/objectionary/eo-phi-normalizer/issues/347#issuecomment-2117097070
command =
intercalate
"; "
[ "set -ex"
, "bnfc --haskell -d -p Language.EO.Phi --generic -o src/ grammar/EO/Phi/Syntax.cf"
, "cd src/Language/EO/Phi/Syntax"
, "alex Lex.x"
, "happy Par.y"
, "true"
]

fullCommand = [fmt|bash -c ' {command} '|]

putStrLn fullCommand

_ <- callCommand fullCommand
_ <- addLicense "Abs.hs"
_ <- addLicense "Print.hs"

postConf simpleUserHooks args flags packageDesc localBuildInfo
}

-- | NOTE: This should be in Cabal.Distribution.Simple.Program.Builtin.
bnfcProgram :: Program
Expand Down
20 changes: 10 additions & 10 deletions eo-phi-normalizer/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

module Main (main) where

import Control.Exception (Exception (..), SomeException, catch, throw)
import Control.Exception (Exception (..), SomeException, catch, throwIO)
import Control.Lens.Lens ((&))
import Control.Lens.Operators ((?~))
import Control.Monad (forM, unless, when)
Expand All @@ -67,6 +67,7 @@ import Data.Text.Lazy.Manipulate (toOrdinal)
import Data.Version (showVersion)
import Data.Yaml (decodeFileThrow, decodeThrow)
import GHC.Generics (Generic)
import Language.EO.Locale (withCorrectLocale)
import Language.EO.Phi (Binding (..), Bytes (Bytes), Object (..), Program (Program), parseProgram, printTree)
import Language.EO.Phi.Dataize
import Language.EO.Phi.Dataize.Context
Expand All @@ -84,7 +85,6 @@ import Language.EO.Phi.Rules.RunYegor (yegorRuleSet)
import Language.EO.Phi.Rules.Yaml (RuleSet (rules, title), convertRuleNamed, parseRuleSetFromFile)
import Language.EO.Phi.ToLaTeX
import Language.EO.Test.YamlSpec (spec)
import Main.Utf8
import Options.Applicative hiding (metavar)
import Options.Applicative qualified as Optparse (metavar)
import Paths_eo_phi_normalizer (version)
Expand Down Expand Up @@ -470,14 +470,14 @@ getFile = \case
Just file' ->
doesFileExist file' >>= \case
True -> pure (Just file')
False -> throw $ FileDoesNotExist file'
False -> throwIO $ FileDoesNotExist file'

getProgram :: Maybe FilePath -> IO Program
getProgram inputFile = do
inputFile' <- getFile inputFile
src <- maybe getContents' readFile inputFile' `catch` (throw . CouldNotRead . show @SomeException)
src <- maybe getContents' readFile inputFile' `catch` (throwIO . CouldNotRead . show @SomeException)
case parseProgram src of
Left err -> throw $ CouldNotParse err
Left err -> throwIO $ CouldNotParse err
Right program -> pure program

getLoggers :: Maybe FilePath -> IO (String -> IO (), String -> IO ())
Expand Down Expand Up @@ -514,7 +514,7 @@ getMetrics' program bindingsPath = do
getMetrics :: Maybe String -> Maybe FilePath -> IO ProgramMetrics
getMetrics bindingsPath inputFile = do
program <- getProgram inputFile
either throw pure (getMetrics' program bindingsPath)
either throwIO pure (getMetrics' program bindingsPath)

injectLamdbaPackage :: [Binding] -> [Binding]
injectLamdbaPackage bs
Expand Down Expand Up @@ -567,7 +567,7 @@ wrapRawBytesIn = \case
-- * Main

main :: IO ()
main = withUtf8 do
main = withCorrectLocale do
opts <- customExecParser pprefs (cliOpts (showVersion version))
let printAsProgramOrAsObject = \case
Formation bindings' -> printTree $ Program bindings'
Expand Down Expand Up @@ -600,7 +600,7 @@ main = withUtf8 do
return (False, ruleSet.title, convertRuleNamed <$> ruleSet.rules)
unless (single || json || latex) $ logStrLn ruleSetTitle
bindingsWithDeps <- case deepMergePrograms (program' : deps) of
Left err -> throw (CouldNotMergeDependencies err)
Left err -> throwIO (CouldNotMergeDependencies err)
Right (Program bindingsWithDeps) -> return bindingsWithDeps
let Program bindings = program'
uniqueResults
Expand Down Expand Up @@ -629,7 +629,7 @@ main = withUtf8 do
logStrLn "\\begin{phiquation*}"
logStrLn [fmtTrim|{phiExpr}|]
logStrLn "\\end{phiquation*}"
when (null uniqueResults || null (head uniqueResults)) (throw CouldNotNormalize)
when (null uniqueResults || null (head uniqueResults)) (throwIO CouldNotNormalize)
if
| single && json ->
logStrLn
Expand Down Expand Up @@ -690,7 +690,7 @@ main = withUtf8 do
program' <- getProgram inputFile
deps <- mapM (getProgram . Just) dependencies
bindingsWithDeps <- case deepMergePrograms (program' : deps) of
Left err -> throw (CouldNotMergeDependencies err)
Left err -> throwIO (CouldNotMergeDependencies err)
Right (Program bindingsWithDeps) -> return bindingsWithDeps
(builtin, _ruleSetTitle, rules) <-
case rulesPath of
Expand Down
12 changes: 12 additions & 0 deletions eo-phi-normalizer/eo-phi-normalizer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,15 @@ custom-setup
Cabal >=2.4.0.1 && <4.0
, PyF
, base >=4.11.0.0 && <5.0
, bytestring
, code-page
, process >=1.6.3.0
, text
, with-utf8

library
exposed-modules:
Language.EO.Locale
Language.EO.Phi
Language.EO.Phi.Dataize
Language.EO.Phi.Dataize.Atoms
Expand Down Expand Up @@ -255,6 +260,7 @@ library
, blaze-markup
, bytestring
, cereal
, code-page
, containers
, directory
, file-embed >=0.0.16.0
Expand All @@ -271,6 +277,7 @@ library
, text
, text-manipulate
, unordered-containers
, with-utf8
, yaml
default-language: Haskell2010

Expand Down Expand Up @@ -298,6 +305,7 @@ executable eo-phi-normalizer
, blaze-markup
, bytestring
, cereal
, code-page
, containers
, directory
, eo-phi-normalizer
Expand All @@ -324,6 +332,7 @@ test-suite doctests
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
Language.EO.Locale
Language.EO.Phi
Language.EO.Phi.Dataize
Language.EO.Phi.Dataize.Atoms
Expand Down Expand Up @@ -373,6 +382,7 @@ test-suite doctests
, blaze-markup
, bytestring
, cereal
, code-page
, containers
, directory
, doctest-parallel
Expand All @@ -391,6 +401,7 @@ test-suite doctests
, text
, text-manipulate
, unordered-containers
, with-utf8
, yaml
default-language: Haskell2010

Expand Down Expand Up @@ -426,6 +437,7 @@ test-suite spec
, blaze-markup
, bytestring
, cereal
, code-page
, containers
, directory
, eo-phi-normalizer
Expand Down
8 changes: 6 additions & 2 deletions eo-phi-normalizer/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ custom-setup:
dependencies:
- base >= 4.11.0.0 && < 5.0
- Cabal >= 2.4.0.1 && < 4.0
- code-page
- process >= 1.6.3.0
- text
- PyF
- bytestring
- with-utf8

build-tools:
alex: ">= 3.2.4"
Expand Down Expand Up @@ -87,6 +91,8 @@ dependencies:
- hashable
- unordered-containers
- containers
- code-page
- with-utf8

default-extensions:
- ImportQualifiedPost
Expand Down Expand Up @@ -123,7 +129,6 @@ executables:
- -rtsopts
- -with-rtsopts=-N
dependencies:
- with-utf8
- eo-phi-normalizer
- optparse-applicative
- aeson-pretty
Expand All @@ -138,7 +143,6 @@ tests:
- -with-rtsopts=-N
dependencies:
- eo-phi-normalizer
- with-utf8
- hspec
- hspec-discover
- QuickCheck
Expand Down
Loading

1 comment on commit ac7276d

@0pdd
Copy link

@0pdd 0pdd commented on ac7276d Dec 4, 2024

Choose a reason for hiding this comment

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

I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:

set -x && set -e && set -o pipefail && cd /tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA && pdd -v -f /tmp/20241204-10283-sr19uu [1]: + set -e + set -o pipefail + cd...

Please, copy and paste this stack trace to GitHub:

UserError
set -x && set -e && set -o pipefail && cd /tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA && pdd -v -f /tmp/20241204-10283-sr19uu [1]:
+ set -e
+ set -o pipefail
+ cd /tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA
+ pdd -v -f /tmp/20241204-10283-sr19uu

My version is 0.24.0
Ruby version is 3.1.4 at x86_64-linux
Reading from root dir /tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/.markdownlint.jsonc is a binary file (23 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/.vscode/settings.json is a binary file (650 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/flake.lock is a binary file (5296 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/package-lock.json is a binary file (30789 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/package.json is a binary file (126 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/renovate.json is a binary file (114 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/site/docs/src/image.png is a binary file (245811 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/site/docs/src/media/metrics.png is a binary file (95050 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/site/docs/src/media/phi-grammar.png is a binary file (131415 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/site/docs/src/media/print-rules-tex-compact.png is a binary file (235249 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/site/docs/src/media/print-rules-tex.png is a binary file (588712 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/site/docs/src/media/rules.jpg is a binary file (76143 bytes)
/tmp/0pdd20241204-2-6123lk/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L2VvLXBoaS1ub3JtYWxpemVyLmdpdA/stack.nix is a binary file (66 bytes)
Reading .envrc ...
Reading .gitattributes ...
Reading .github/workflows/ghc.yml ...
Puzzle 340-40b07064 10/DEV at .github/workflows/ghc.yml
Reading .github/workflows/release.yml ...
Reading .gitignore ...
Reading .gitmodules ...
Reading .hlint.yaml ...
Reading .pre-commit-config.yaml ...
Reading .prettierignore ...
Reading CONTRIBUTING.md ...
Reading LICENSE.txt ...
Reading README.md ...
Reading cabal.project ...
Reading default.nix ...
Reading eo-phi-normalizer/.gitignore ...
Reading eo-phi-normalizer/CHANGELOG.md ...
Reading eo-phi-normalizer/LICENSE ...
Reading eo-phi-normalizer/README.md ...
Reading eo-phi-normalizer/Setup.hs ...
Reading eo-phi-normalizer/app/Main.hs ...
Reading eo-phi-normalizer/data/0.36.0/dependencies.md ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/as-phi.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/bool.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/bytes.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/cage.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/cti.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/dataized.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/error.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/float.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/go.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/goto.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/heap.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/if.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/int.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/io/stdin.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/io/stdout.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/malloc.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/memory.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/nan.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/negative-infinity.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/nop.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/positive-infinity.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/ram.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/rust.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/seq.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/string.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/switch.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/try.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/tuple.phi ...
Reading eo-phi-normalizer/data/0.36.0/org/eolang/while.phi ...
Reading eo-phi-normalizer/data/0.37.0/dependencies.md ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/as-phi.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/bytes.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/cage.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/cti.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/dataized.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/error.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/false.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/float.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/go.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/int.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/io/stdin.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/io/stdout.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/malloc.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/nan.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/negative-infinity.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/positive-infinity.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/rust.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/seq.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/string.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/switch.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/true.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/try.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/tuple.phi ...
Reading eo-phi-normalizer/data/0.37.0/org/eolang/while.phi ...
Reading eo-phi-normalizer/data/0.38.0/dependencies.md ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/as-phi.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/bytes.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/cage.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/cti.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/dataized.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/error.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/false.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/float.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/go.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/int.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/io/stdin.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/io/stdout.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/malloc.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/nan.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/negative-infinity.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/positive-infinity.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/rust.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/seq.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/string.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/switch.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/true.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/try.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/tuple.phi ...
Reading eo-phi-normalizer/data/0.38.0/org/eolang/while.phi ...
Reading eo-phi-normalizer/data/0.38.4/dependencies.md ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/as-phi.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/bytes.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/cage.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/cti.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/dataized.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/error.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/false.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/float.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/go.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/int.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/io/stdin.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/io/stdout.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/malloc.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/nan.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/negative-infinity.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/positive-infinity.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/rust.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/seq.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/string.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/switch.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/true.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/try.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/tuple.phi ...
Reading eo-phi-normalizer/data/0.38.4/org/eolang/while.phi ...
Reading eo-phi-normalizer/data/0.41.2/dependencies.md ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/as-phi.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/bytes.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/cage.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/cti.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/dataized.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/error.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/false.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/fs/dir.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/fs/file.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/fs/path.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/fs/tmpdir.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/go.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/i16.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/i32.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/i64.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/bytes-as-input.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/console.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/dead-input.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/dead-output.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/input-length.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/malloc-as-output.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/stdin.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/stdout.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/io/tee-input.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/malloc.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/math/angle.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/math/e.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/math/integral.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/math/numbers.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/math/pi.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/math/random.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/math/real.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/nan.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/negative-infinity.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/net/socket.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/number.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/positive-infinity.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/rust.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/seq.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/string.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/structs/bytes-as-array.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/structs/hash-code-of.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/structs/list.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/structs/map.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/structs/range-of-ints.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/structs/range.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/structs/set.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/switch.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/sys/getenv.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/sys/line-separator.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/sys/os.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/sys/posix.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/sys/win32.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/true.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/try.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/tuple.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/txt/regex.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/txt/sprintf.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/txt/sscanf.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/txt/text.phi ...
Reading eo-phi-normalizer/data/0.41.2/org/eolang/while.phi ...
Reading eo-phi-normalizer/eo-phi-normalizer.cabal ...
Reading eo-phi-normalizer/grammar/EO/Phi/Syntax.cf ...
Reading eo-phi-normalizer/package.yaml ...
Reading eo-phi-normalizer/report/main.js ...
Reading eo-phi-normalizer/report/styles.css ...
Reading eo-phi-normalizer/src/Language/EO/Locale.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Dataize/Atoms.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Dataize/Context.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Dataize.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Dependencies.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Metrics/Collect.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Metrics/Data.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Normalize.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Pipeline/Config.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Pipeline/Dataize/PrintConfigs.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Pipeline/EOTests/Data.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Pipeline/EOTests/PrepareTests.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Report/Data.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Report/Html.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Rules/Common.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Rules/Fast.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Rules/PhiPaper.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Rules/RunYegor.hs ...
Reading eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs ...
ERROR: ERROR: eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs; PDD::Error at eo-phi-normalizer/src/Language/EO/Phi/Rules/Yaml.hs:152: TODO found, but puzzle can't be parsed, most probably because TODO is not followed by a puzzle marker, as this page explains: https://github.com/cqfn/pdd#how-to-format
If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/cqfn/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/cqfn/pdd/blob/master/README.md.
Exit code is 1

/app/objects/git_repo.rb:74:in `rescue in block in xml'
/app/objects/git_repo.rb:71:in `block in xml'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tempfile.rb:317:in `open'
/app/objects/git_repo.rb:70:in `xml'
/app/objects/puzzles.rb:46:in `deploy'
/app/objects/jobs/job.rb:38:in `proceed'
/app/objects/jobs/job_starred.rb:32:in `proceed'
/app/objects/jobs/job_recorded.rb:31:in `proceed'
/app/objects/jobs/job_emailed.rb:33:in `proceed'
/app/objects/jobs/job_commiterrors.rb:33:in `proceed'
/app/objects/jobs/job_detached.rb:48:in `exclusive'
/app/objects/jobs/job_detached.rb:36:in `block in proceed'
/app/objects/jobs/job_detached.rb:36:in `fork'
/app/objects/jobs/job_detached.rb:36:in `proceed'
/app/0pdd.rb:549:in `process_request'
/app/0pdd.rb:380:in `block in <top (required)>'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1804:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1804:in `block in compile!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1071:in `block (3 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1089:in `route_eval'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1071:in `block (2 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1120:in `block in process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1118:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1118:in `process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1069:in `block in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1066:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1066:in `route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1190:in `block in dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1185:in `dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1001:in `block in call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1001:in `call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:990:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/rewindable_input.rb:25:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/deflater.rb:47:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/xss_header.rb:20:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/path_traversal.rb:18:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/json_csrf.rb:28:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/frame_options.rb:33:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/logger.rb:19:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/common_logger.rb:43:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:266:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:259:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/head.rb:15:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/method_override.rb:28:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:224:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:2115:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1674:in `block in call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1890:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1674:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rackup-2.1.0/lib/rackup/handler/webrick.rb:111:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in `run'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/server.rb:310:in `block in start_thread'

Please sign in to comment.