AllureOfTheStars / Allure

Allure of the Stars is a near-future Sci-Fi roguelike and tactical squad combat game written in Haskell; please offer feedback, e.g., after trying out the web frontend version at
http://allureofthestars.com
GNU Affero General Public License v3.0
211 stars 16 forks source link

config file access failed when built with ghc 9.6.2 #125

Closed iMichka closed 9 months ago

iMichka commented 10 months ago

Hello

I am trying to build allure with ghc 9.6.2 in homebrew. This worked well, but I get the following runtime error:

/usr/local/Cellar/allureofthestars/0.11.0.0_4/bin/Allure --dbgMsgSer --dbgMsgCli --logPriority 0 --newGame 3 --maxFps 100000 --stopAfterFrames 50 --automateAll --keepAutomated --gameMode battle --setDungeonRng "SMGen 7 7" --setMainRng "SMGen 7 7"
Allure: Error when parsing configuration file. Please fix config.ui.ini or remove it altogether. The details:
Internal failure occurred and the following is to blame:
  config file access failed
  ( ""
, "maxFps"
, fromList
    [ ( "additional_commands"
      , fromList
          [ ( "Cmd_2 "
            , "(\"KP_Insert\", ([CmdAim], \"\", ByAimMode AimModeCmd {exploration = Dashboard, aiming = Accept}))"
            )
          ]
      )
    , ( "fonts"
      , fromList
          [ ( "16x16xwBitmap " , "FontMapBitmap \"16x16xw.bdf\" 0" )
          , ( "16x16xwScalable "
            , "FontMapScalable \"16x16xw.woff\" 16 HintingHeavy 0"
            )
          , ( "8x8xBitmap " , "FontMapBitmap \"8x8x.fnt\" 2" )
          , ( "8x8xbBitmap " , "FontMapBitmap \"8x8xb.fnt\" 2" )
          , ( "binaryBold "
            , "FontProportional \"BinarySansProLH-Semibold.ttf.woff\" 16 HintingHeavy"
            )
          , ( "binaryMono "
            , "FontMonospace \"BinaryCodeProLH-Bold.ttf.woff\" 14 HintingHeavy"
            )
          , ( "binaryRegular "
            , "FontProportional \"BinarySansProLH-Regular.ttf.woff\" 16 HintingHeavy"
            )
          , ( "dejavuBold "
            , "FontProportional \"DejaVuLGCSans-Bold.ttf.woff\" 13 HintingHeavy"
            )
          , ( "dejavuMono "
            , "FontMonospace \"Hack-Bold.ttf.woff\" 13 HintingHeavy"
            )
          , ( "dejavuRegular "
            , "FontProportional \"DejaVuLGCSans.ttf.woff\" 15 HintingHeavy"
            )
          ]
      )
    , ( "fontsets"
      , fromList
          [ ( "16x16xw "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwBitmap\", fontPropRegular = \"\", fontPropBold = \"\", fontMono = \"\"}"
            )
          , ( "8x8x "
            , "FontSet {fontMapScalable = \"\", fontMapBitmap = \"8x8xBitmap\", fontPropRegular = \"\", fontPropBold = \"\", fontMono = \"\"}"
            )
          , ( "8x8xb "
            , "FontSet {fontMapScalable = \"\", fontMapBitmap = \"8x8xbBitmap\", fontPropRegular = \"\", fontPropBold = \"\", fontMono = \"\"}"
            )
          , ( "binary "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwScalable\", fontPropRegular = \"binaryRegular\", fontPropBold = \"binaryBold\", fontMono = \"binaryMono\"}"
            )
          , ( "binaryBold "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwBitmap\", fontPropRegular = \"binaryBold\", fontPropBold = \"binaryBold\", fontMono = \"binaryMono\"}"
            )
          , ( "binaryMono "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwBitmap\", fontPropRegular = \"binaryMono\", fontPropBold = \"binaryMono\", fontMono = \"binaryMono\"}"
            )
          , ( "binary_original "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwBitmap\", fontPropRegular = \"binaryRegular\", fontPropBold = \"binaryBold\", fontMono = \"binaryMono\"}"
            )
          , ( "dejavu "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwBitmap\", fontPropRegular = \"dejavuRegular\", fontPropBold = \"dejavuBold\", fontMono = \"dejavuMono\"}"
            )
          , ( "dejavuBold "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwBitmap\", fontPropRegular = \"dejavuBold\", fontPropBold = \"dejavuBold\", fontMono = \"dejavuMono\"}"
            )
          , ( "dejavuMono "
            , "FontSet {fontMapScalable = \"16x16xwScalable\", fontMapBitmap = \"16x16xwBitmap\", fontPropRegular = \"dejavuMono\", fontPropBold = \"dejavuMono\", fontMono = \"dejavuMono\"}"
            )
          ]
      )
    , ( "hero_names"
      , fromList
          [ ( "HeroName_0 " , "(\"Haskell Alvin\", \"he\")" )
          , ( "HeroName_1 " , "(\"Alonzo Barkley\", \"he\")" )
          , ( "HeroName_2 " , "(\"In\233s Galenti\", \"she\")" )
          , ( "HeroName_3 " , "(\"Ernst Abraham\", \"he\")" )
          , ( "HeroName_4 " , "(\"Samuel Saunders\", \"he\")" )
          , ( "HeroName_5 " , "(\"Roger Robin\", \"he\")" )
          , ( "HeroName_6 " , "(\"Christopher Flatt\", \"he\")" )
          , ( "HeroName_7 " , "(\"Simon Wise\", \"he\")" )
          , ( "HeroName_8 " , "(\"Daniel Homer\", \"he\")" )
          , ( "HeroName_9 " , "(\"Oleg Cracker\", \"he\")" )
          ]
      )
    , ( "ui"
      , fromList
          [ ( "allFontsScale " , "1.0" )
          , ( "chosenFontset " , "\"binary\"" )
          , ( "fullscreenMode " , "NotFullscreen" )
          , ( "historyMax " , "5002" )
          , ( "hpWarningPercent " , "20" )
          , ( "maxFps " , "24" )
          , ( "movementLeftHandKeys_axwdqezc " , "True" )
          , ( "movementViKeys_hjklyubn " , "True" )
          , ( "msgWrapColumn " , "53" )
          , ( "noAnim " , "False" )
          , ( "overrideCmdline " , "\"\"" )
          ]
      )
    , ( "version" , fromList [ ( "version " , "0.11.0" ) ] )
    ]
)
CallStack (from HasCallStack):
  error, called at engine-src/Game/LambdaHack/Client/UI/UIOptionsParse.hs:37:19 in LmbdHck-0.11.0.0-aa13543b:Game.LambdaHack.Client.UI.UIOptionsParse

I'm unsure how to fix this, could you please help us get this fixed? Thanks!

https://github.com/Homebrew/homebrew-core/pull/141617

Mikolaj commented 10 months ago

Thank you for the report. On it.

Mikolaj commented 10 months ago

It fails the same with GHC 9.4.6. A package I'm using must have changed behaviour and I have no upper bounds set in the .cabal file, so it's silently accepted. Such silent breakage is the price. Will diagnose further.

Mikolaj commented 10 months ago

Right. For GHC 9.6 we need a new version of package hsini and the new version changed its behaviour

https://github.com/magthe/hsini/issues/27

Let's see if this can be fixed upstream. Then we don't need to touch the source code of Allure (nor LambdaHack) as long as the newest hsini is used.

If we don't hear back soon, let me know and I'd hack a workaround and release an interim version of LambdaHack and Allure with the workaround included.

iMichka commented 9 months ago

Hi. Looks like upstream did not respond yet. Do you think a workaround is doable to unblock the situation?

Mikolaj commented 9 months ago

The upstream hsini author fixed the problem just now. Could you check? (cabal update is needed.)

I wonder if the SDL implementation on Mac works fine right now. The Windows one was broken recently. Could you kindly start the game and see if colourful characters move on the screen and also if pressing any key makes them stop? If so, it's probably fine on a Mac.

iMichka commented 9 months ago

Yes the rebuild worked!

And I tried to play the game (I have no clue what is going on, but it looks fun). I got hit by a feral home robot:

Screenshot 2023-09-26 at 19 54 20
Mikolaj commented 9 months ago

I got hit by a feral home robot.

It happens to the best of us. :D

Thank you for everything. Cheers!