google / codeworld

Educational computer programming environment using Haskell
http://code.world
Apache License 2.0
1.24k stars 197 forks source link

Docker build fails #1596

Open TerrorJack opened 1 year ago

TerrorJack commented 1 year ago

Building with docker fails with:

===== RUNNING: cabal_install --ghcjs ./codeworld-prediction ./codeworld-error-sanitizer ./codeworld-api ./codeworld-base ./codeworld-game-api ./codeworld-available-pkgs
Warning: the --global flag is deprecated -- it is generally considered a bad
idea to install packages into the global store
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: codeworld-available-pkgs-0.1.0.0 (user goal)
[__1] unknown package: prob (dependency of codeworld-available-pkgs)
[__1] fail (backjumping, conflict set: codeworld-available-pkgs, prob)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: codeworld-available-pkgs, prob

========== Aborting: Command failed. ==========
DIRECTORY: .
COMMAND  : cabal_install --ghcjs ./codeworld-prediction ./codeworld-error-sanitizer ./codeworld-api ./codeworld-base ./codeworld-game-api ./codeworld-available-pkgs
EXIT CODE: 1
===============================================
cdsmith commented 1 year ago

Probably needs a cabal update somewhere?

cdsmith commented 1 year ago

It looks like install.sh was setting an old cabal snapshot. I'll fix by updating the snapshot.

TerrorJack commented 1 year ago

It's still failing, but with a different error message:

Downloading  backprop-0.2.6.4
Downloaded   backprop-0.2.6.4
Configuring backprop-0.2.6.4...
Preprocessing library for backprop-0.2.6.4..
Building library for backprop-0.2.6.4..
[ 1 of 10] Compiling Data.Type.Util   ( src/Data/Type/Util.hs, dist/build/Data/Type/Util.js_o )
[ 2 of 10] Compiling Numeric.Backprop.Class ( src/Numeric/Backprop/Class.hs, dist/build/Numeric/Backprop/Class.js_o )

src/Numeric/Backprop/Class.hs:988:12: error:
    • Could not deduce (ToARec rs) arising from a use of ‘toARec’
      from the context: (ReifyConstraint Backprop f rs, RMap rs,
                         RApply rs, RecApplicative rs, NatToInt (RLength rs),
                         RPureConstrained (IndexableField rs) rs)
        bound by the instance declaration
        at src/Numeric/Backprop/Class.hs:(986,10)-(987,29)
    • In the first argument of ‘(.)’, namely ‘toARec’
      In the expression: toARec . zero . fromARec
      In an equation for ‘zero’: zero = toARec . zero . fromARec
    |
988 |     zero = toARec . zero . fromARec
    |            ^^^^^^

src/Numeric/Backprop/Class.hs:990:17: error:
    • Could not deduce (ToARec rs) arising from a use of ‘toARec’
      from the context: (ReifyConstraint Backprop f rs, RMap rs,
                         RApply rs, RecApplicative rs, NatToInt (RLength rs),
                         RPureConstrained (IndexableField rs) rs)
        bound by the instance declaration
        at src/Numeric/Backprop/Class.hs:(986,10)-(987,29)
    • In the expression: toARec $ add (fromARec xs) (fromARec ys)
      In an equation for ‘add’:
          add xs ys = toARec $ add (fromARec xs) (fromARec ys)
      In the instance declaration for ‘Backprop (ARec f rs)’
    |
990 |     add xs ys = toARec $ add (fromARec xs) (fromARec ys)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Numeric/Backprop/Class.hs:992:12: error:
    • Could not deduce (ToARec rs) arising from a use of ‘toARec’
      from the context: (ReifyConstraint Backprop f rs, RMap rs,
                         RApply rs, RecApplicative rs, NatToInt (RLength rs),
                         RPureConstrained (IndexableField rs) rs)
        bound by the instance declaration
        at src/Numeric/Backprop/Class.hs:(986,10)-(987,29)
    • In the first argument of ‘(.)’, namely ‘toARec’
      In the expression: toARec . zero . fromARec
      In an equation for ‘one’: one = toARec . zero . fromARec
    |
992 |     one  = toARec . zero . fromARec
    |            ^^^^^^
Failed to install backprop-0.2.6.4
cabal: Error: some packages failed to install:
backprop-0.2.6.4-Ldn7zatAsbu4r0tCHa5dG5 failed during the building phase. The
exception was:
ExitFailure 1
codeworld-available-pkgs-0.1.0.0-5VYbu0Dyc4H9JoxXyjNmLP depends on
codeworld-available-pkgs-0.1.0.0 which failed to install.

========== Aborting: Command failed. ==========
DIRECTORY: .
COMMAND  : cabal_install --ghcjs ./codeworld-prediction ./codeworld-error-sanitizer ./codeworld-api ./codeworld-base ./codeworld-game-api ./codeworld-available-pkgs
EXIT CODE: 1
===============================================
cdsmith commented 1 year ago

Interesting. On the development server, backprop-0.2.6.4 built successfully and is installed. I'm not sure what's different about the docker environment.

cdsmith commented 1 year ago

Could be something about the version of vinyl, perhaps, since the error is about missing an instance from vinyl. If you still have the build log, can you tell me what vinyl version it installed?

TerrorJack commented 1 year ago

I've reran the build, the log is available at https://gist.githubusercontent.com/TerrorJack/7f0e88c51b441a78b7e9805cc84fa874/raw/361a0917ffdb6237f13c5f370517aef880a66c10/codeworld.log

cdsmith commented 1 year ago

Okay, yes, it looks like backprop just doesn't work with vinyl 0.14. See https://github.com/mstksg/backprop/issues/21 for the underlying issue. I'll add a version constraint on vinyl for now.

cdsmith commented 1 year ago

That's pushed, and should definitely fix this issue. Feel free to reopen if there are more problems.

TerrorJack commented 1 year ago

Another build error: https://gist.githubusercontent.com/TerrorJack/531c3be43d0e100d45b2bfad6633b18f/raw/4af713d1ac8d57e6847393f49f1e3b5de0ce46b7/gistfile1.txt

cdsmith commented 1 year ago

https://github.com/mstksg/auto/issues/19

cdsmith commented 1 year ago

Okay, I actually installed docker, and am trying it myself. There's now an error in hgeometry I'm looking into.

cdsmith commented 1 year ago

Okay, as of latest pushed commit, the docker build is working for me.

TerrorJack commented 1 year ago

It's still failing, not ghcjs-built libraries this time, but in codeworld-auth: https://gist.githubusercontent.com/TerrorJack/f9618fbc752cffa7f529fb9b070fe34d/raw/514ec7bcd524bd08d68a1c8b1442d9187ef6bb05/codeworld.log

cdsmith commented 1 year ago

I'm so sorry. I thought I'd resolved everything, but you're right. I'll push an update there shortly.

nimec01 commented 1 year ago

It's still failing, not ghcjs-built libraries this time, but in codeworld-auth

@TerrorJack In case this is still needed: jwt-0.11.0 has some changed types. Adding a version constraint in codeworld-auth/codeworld-auth.cabal fixes this.

jwt >= 0.10.0 && < 0.11.0

After that, you probably receive some errors in codeworld-game-server about an ambiguous type Key. You can fix this by changing

import Data.Aeson

to

import Data.Aeson hiding (Key)

in codeworld-game-server/src/CodeWorld/GameServer.hs.

Adding a version constraint on aeson should also work (codeworld-game-server/codeworld-game-server.cabal).

aeson < 2.0.0.0