jgm / yst

create static websites from YAML data and string templates
GNU General Public License v2.0
376 stars 38 forks source link

Build fails: yst-0.7.1.3 from Cabal on MacOS -- "writeDocbook5" capitalization? #56

Closed ewa closed 1 year ago

ewa commented 1 year ago

I get the following error attempting to install/build yst from Cabal:

Configuring executable 'yst' for yst-0.7.1.3..
Preprocessing executable 'yst' for yst-0.7.1.3..
Building executable 'yst' for yst-0.7.1.3..
[ 1 of 11] Compiling Paths_yst        ( dist/build/yst/autogen/Paths_yst.hs, dist/build/yst/yst-tmp/Paths_yst.o )
[ 2 of 11] Compiling Yst.Types        ( Yst/Types.hs, dist/build/yst/yst-tmp/Yst/Types.o )
[ 3 of 11] Compiling Yst.Sqlite3      ( Yst/Sqlite3.hs, dist/build/yst/yst-tmp/Yst/Sqlite3.o )
[ 4 of 11] Compiling Yst.Util         ( Yst/Util.hs, dist/build/yst/yst-tmp/Yst/Util.o )
[ 5 of 11] Compiling Yst.CSV          ( Yst/CSV.hs, dist/build/yst/yst-tmp/Yst/CSV.o )
[ 6 of 11] Compiling Yst.Yaml         ( Yst/Yaml.hs, dist/build/yst/yst-tmp/Yst/Yaml.o )
[ 7 of 11] Compiling Yst.Data         ( Yst/Data.hs, dist/build/yst/yst-tmp/Yst/Data.o )
[ 8 of 11] Compiling Yst.Render       ( Yst/Render.hs, dist/build/yst/yst-tmp/Yst/Render.o )

Yst/Render.hs:165:43: error:
    Variable not in scope:
      writeDocbook5 :: WriterOptions -> Pandoc -> m T.Text
    Suggested fix:
      Perhaps use one of these:
        ‘writeDocBook5’ (imported from Text.Pandoc),
        ‘writeDocBook4’ (imported from Text.Pandoc)
    |
165 |                    DocBookFormat       -> writeDocbook5 (wopts "docbook5")
    |                                           ^^^^^^^^^^^^^
[10 of 11] Compiling Yst.Config       ( Yst/Config.hs, dist/build/yst/yst-tmp/Yst/Config.o )
Error: cabal: Failed to build exe:yst from yst-0.7.1.3. See the build log
above for details.
jgm commented 1 year ago

This changed in pandoc 3. I will fix yst to use pandoc 3.

ewa commented 1 year ago

Building from master branch source produces the same results:

ewa-mbp:~/ext andersoe % git clone git@github.com:jgm/yst.git
Cloning into 'yst'...
remote: Enumerating objects: 825, done.
remote: Counting objects: 100% (113/113), done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 825 (delta 57), reused 100 (delta 46), pack-reused 712
Receiving objects: 100% (825/825), 269.57 KiB | 1.38 MiB/s, done.
Resolving deltas: 100% (472/472), done.
ewa-mbp:~/ext andersoe % cd yst
ewa-mbp:~/ext/yst andersoe % cabal v2-build
Resolving dependencies...
Build profile: -w ghc-9.4.4 -O1
In order, the following will be built (use -v for more details):
 - yst-0.7.1.3 (exe:yst) (first run)
Configuring executable 'yst' for yst-0.7.1.3..
Preprocessing executable 'yst' for yst-0.7.1.3..
Building executable 'yst' for yst-0.7.1.3..
[ 1 of 11] Compiling Paths_yst        ( /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/autogen/Paths_yst.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Paths_yst.o )
[ 2 of 11] Compiling Yst.Types        ( Yst/Types.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/Types.o )
[ 3 of 11] Compiling Yst.Sqlite3      ( Yst/Sqlite3.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/Sqlite3.o )
[ 4 of 11] Compiling Yst.Util         ( Yst/Util.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/Util.o )
[ 5 of 11] Compiling Yst.CSV          ( Yst/CSV.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/CSV.o )
[ 6 of 11] Compiling Yst.Yaml         ( Yst/Yaml.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/Yaml.o )
[ 7 of 11] Compiling Yst.Data         ( Yst/Data.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/Data.o )
[ 8 of 11] Compiling Yst.Render       ( Yst/Render.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/Render.o )

Yst/Render.hs:165:43: error:
    Variable not in scope:
      writeDocbook5 :: WriterOptions -> Pandoc -> m T.Text
    Suggested fix:
      Perhaps use one of these:
        ‘writeDocBook5’ (imported from Text.Pandoc),
        ‘writeDocBook4’ (imported from Text.Pandoc)
    |
165 |                    DocBookFormat       -> writeDocbook5 (wopts "docbook5")
    |                                           ^^^^^^^^^^^^^
[10 of 11] Compiling Yst.Config       ( Yst/Config.hs, /Users/andersoe/ext/yst/dist-newstyle/build/aarch64-osx/ghc-9.4.4/yst-0.7.1.3/x/yst/build/yst/yst-tmp/Yst/Config.o )
ewa commented 1 year ago

Thanks for the blazingly-fast response! Making the one-character capitalization change in the source code appears to solve the problem for me locally, but if there's a bigger change/fix involved, I'm not qualified for that.

jgm commented 1 year ago

You could also use the released version and use --constrain "pandoc < 3" with cabal.