質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Haskell

Haskellは高い機能性をもった関数型プログラミング言語で、他の手続き型プログラミング言語では難しいとされている関数でも容易に行うことができます。強い静的型付け、遅延評価などに対応しています。

Q&A

解決済

1回答

1037閲覧

gi-glib > error, called at lib/Data/GI/CodeGen/API.hs

apo

総合スコア349

Haskell

Haskellは高い機能性をもった関数型プログラミング言語で、他の手続き型プログラミング言語では難しいとされている関数でも容易に行うことができます。強い静的型付け、遅延評価などに対応しています。

0グッド

0クリップ

投稿2020/10/30 06:26

haskell-giでGUIを使いたい

下記サイトを参考にhaskell-giを使用しようとしていますが、コンパイルができません。
https://qiita.com/mimaburao/items/47135e641106e9ba7aa8

発生している問題・エラーメッセージ

[apo@myhostname my-project]$ stack build gi-glib > configure gi-glib > [1 of 2] Compiling Main ( /tmp/stack-eb18c6c9fc8b9f64/gi-glib-2.0.23/Setup.hs, /tmp/stack-eb18c6c9fc8b9f64/gi-glib-2.0.23/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup/Main.o ) gi-glib > [2 of 2] Compiling StackSetupShim ( /home/apo/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack-eb18c6c9fc8b9f64/gi-glib-2.0.23/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup/StackSetupShim.o ) gi-glib > Linking /tmp/stack-eb18c6c9fc8b9f64/gi-glib-2.0.23/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup/setup ... gi-glib > Unknown GIR element "docsection" when processing namespace "GLib", aborting. gi-glib > CallStack (from HasCallStack): gi-glib > error, called at lib/Data/GI/CodeGen/API.hs:199:16 in haskell-gi-0.23.1-DyiLFcjpbrwKL7LScvAYXe:Data.GI.CodeGen.API Progress 1/9 -- While building package gi-glib-2.0.23 (scroll up to its section to see the error) using: /tmp/stack-eb18c6c9fc8b9f64/gi-glib-2.0.23/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0 configure --user --package-db=clear --package-db=global --package-db=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/pkgdb --libdir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/lib --bindir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/bin --datadir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/share --libexecdir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/libexec --sysconfdir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/etc --docdir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/doc/gi-glib-2.0.23 --htmldir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/doc/gi-glib-2.0.23 --haddockdir=/home/apo/.stack/snapshots/x86_64-linux-tinfo6/262746d7d19e0457f757fc79a7c431f1c464c0880093c59fb8b9f9bb7ff9ff9c/8.8.4/doc/gi-glib-2.0.23 --dependency=Cabal=Cabal-3.0.1.0 --dependency=base=base-4.13.0.0 --dependency=bytestring=bytestring-0.10.10.1 --dependency=containers=containers-0.6.2.1 --dependency=haskell-gi=haskell-gi-0.23.1-DyiLFcjpbrwKL7LScvAYXe --dependency=haskell-gi-base=haskell-gi-base-0.23.0-8eZFmSUT7kd6BiSIiRePNX --dependency=haskell-gi-overloading=haskell-gi-overloading-1.0-6w3IXGDooXgu3RA2LfTuf --dependency=text=text-1.2.4.0 --dependency=transformers=transformers-0.5.6.2 --exact-configuration --ghc-option=-fhide-source-paths Process exited with code: ExitFailure 1

該当のソースコード

stack.yaml

resolver: lts-16.18 packages: - .

package.yaml

haskell

1[apo@myhostname my-project]$ cat ./package.yaml 2name: my-project 3version: 0.1.0.0 4github: "githubuser/my-project" 5license: BSD3 6author: "Author name here" 7maintainer: "example@example.com" 8copyright: "2020 Author name here" 9 10extra-source-files: 11- README.md 12- ChangeLog.md 13 14description: Please see the README on GitHub at <https://github.com/githubuser/my-project#readme> 15 16dependencies: 17- base >= 4.7 && < 5 18- gi-gtk 19- haskell-gi-base 20 21library: 22 source-dirs: src 23 24executables: 25 my-project-exe: 26 main: Main.hs 27 source-dirs: app 28 ghc-options: 29 - -threaded 30 - -rtsopts 31 - -with-rtsopts=-N 32 dependencies: 33 - my-project 34 35tests: 36 my-project-test: 37 main: Spec.hs 38 source-dirs: test 39 ghc-options: 40 - -threaded 41 - -rtsopts 42 - -with-rtsopts=-N 43 dependencies: 44 - my-project

Main.hs

haskell

1module Main where 2 3import Lib 4 5main :: IO () 6main = hello

Lib.hs

{-# LANGUAGE OverloadedStrings, OverloadedLabels #-} module Lib ( hello ) where import qualified GI.Gtk as Gtk import Data.GI.Base hello :: IO () hello = do Gtk.init Nothing win <- new Gtk.Window [ #title := "こんにちは" ] on win #destroy Gtk.mainQuit button <- new Gtk.Button [ #label := "おしてね" ] on button #clicked (set button [ #sensitive := False, #label := "押してくれてありがとう、テストは成功しました" ] ) #add win button #showAll win Gtk.main

全てのソースコード
https://github.com/ringo-apo/haskell-gi

試したこと

公式サイトに従い、下記パッケージのインストール済み

sudo pacman -S gobject-introspection gobject-introspection-runtime gtksourceview3 webkit2gtk

補足情報(FW/ツールのバージョンなど)

OS: ArchLinux(VirtualBox内)

よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

こちらのIssueと同様の現象のようです。

gi-glib: GIR element 'docsection' is unsupported · Issue #318 · haskell-gi/haskell-gi

まだOpenのままですが、こちらのコメントのとおり修正したコミットがpush済みのようですので試してみてはいかがでしょうか?(根本的に直すコミットではないようですが

投稿2020/10/30 07:25

igrep

総合スコア428

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

apo

2020/10/30 08:12

ご教示ありがとうございます。 とりあえず紹介頂いたサイトを参考に、下記のように修正したら動きました。 ./stack.yaml ``` extra-deps: - gtk2hs-buildtools-0.13.8.0 - glib-0.13.8.1 - cairo-0.13.8.1 - pango-0.13.8.1 - haskell-gi-0.24.5 - haskell-gi-base-0.24.3 - gi-pango-1.0.23 - gi-harfbuzz-0.0.3 - gi-glib-2.0.24 - gi-gobject-2.0.24 ``` $HOME/.stack/config.yaml ``` allow-newer: true ``` Issueページに書かれていたのですね。 こんどから確認するように致します。 ありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問