LoginSignup
3
1

More than 3 years have passed since last update.

Win10 の日本語環境だと spago で PureScript をビルドできなかった問題

Last updated at Posted at 2020-03-26

環境

OS : Windows 10 Pro (64 bit)
OS環境 : 日本語 (not utf-8 な環境なら発症する模様)
PureScript : 0.13.6
spago : 0.14.0
shell : Git Bash (VSCode の integrated terminal)

当然だが PureScript も spago も npm でインストールした。

症状

純粋関数型スクリプト言語PureScriptのはじめかた

を参考にして環境を構築していたところでつまづいた。

spago init は通るけど spago build で以下のエラーが出る。

$ spago build
[info] Installing 4 dependencies.
[info] Searching for packages cache metadata..
[info] Recent packages cache metadata found, using it..
[info] Copying from global cache: "psci-support"
[info] Copying from global cache: "console"
[info] Copying from global cache: "effect"
[info] Copying from global cache: "prelude"
[info] Installation complete.
spago.exe: fd:5: hGetContents: invalid argument (invalid byte sequence)

無効な引数を渡すなって怒られてる。
(いやワシ環境構築段階やからマジで何もしてへんし…)

$ spago

とだけ叩くとオプションのリストが出てくるので、動いてはいる。

$ chcp.com 65001

と叩いて shell の文字コードを UTF-8 に指定しても、同じ結果になる。

対応

GitHub PR : ver 0.14.0 の spago が UTF-8 環境に対応できていない様子

偉い人がエンコード問題を fix した spago.exe を配布してくれていた。
(上記プルリクの末尾を参照)

0.14 with fix to Windows 10

spago.zip を DL して Unzip して npm global module にある spago.exe を差し替える。

もいっかいビルドする。

$ spago build
[info] Installing 4 dependencies.
[info] Searching for packages cache metadata..
[info] Recent packages cache metadata found, using it..
~~~ 中略 ~~~
Compiling Main
Compiling PSCI.Support
Compiling Test.Main
[info] Build succeeded.

やったぜ。

他の人から「動いたよサンキュー!神!」てな報告もあるので、次のリリースでは修正されるんじゃないでしょうか。

新しいMacBook Air 2020 が欲しいなぁ~

すみませんでした。

雑な余談

なんか「プログラミング勉強するかなぁ」という話をしたら、 PureScript をガン推しされたのでやることになりました。
作りたいもの…テキストパーサとかですかね…
あとはこう、 EPUB3.0 を吐く何かとか…

Git 講座の記事。あー。はい。
ですよね。ええと。
頑張ります…(スクショの撮影と整理を…

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1