What have you found for these years?

2008-11-27

happy 灌不起來真不 happy


godfat ~/p/Agda> ./configure
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ghc... ghc
checking for ghc version... 6.10.1
checking for alex... alex
checking for alex version... 2.1.0
checking for happy... no
configure: error: happy is required


godfat ~/p/Agda> sudo port install happy
Password:
---> Fetching happy
---> Verifying checksum(s) for happy
---> Extracting happy
---> Configuring happy
Error: Target org.macports.configure returned: shell command "cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_happy/work/happy-1.17 && runhaskell Setup configure --ghc --prefix=/opt/local" returned error 1
Command output:
Setup.lhs:30:43: Not in scope: `buildVerbose'

Error: Status 1 encountered during processing.

好像是 cabal 版本問題?

godfat ~/p/Agda> cabal install happy
Resolving dependencies...
Downloading happy-1.18.2...
[1 of 1] Compiling Main
[...]
src/Main.lhs:541:12: Warning: Defined but not used: `target'
Linking dist/build/happy/happy ...
Installing executable(s) in /Users/godfat/.cabal/bin

無用...?

godfat ~/p/Agda> ghc-pkg list | grep happy
godfat ~/p/Agda>

換開發版

godfat ~/p/Agda> darcs get --partial http://darcs.haskell.org/happy/
This is the repository for Happy, see http://www.haskell.org/happy for
more info.

WARNING: to get this repository on Windows, use --partial. Otherwise
you'll get problems due to some old patches that conflict on a
case-insensitive file system.
**********************
Finished getting.

很好,我現在的 mac 也是 case-insensitive file system 啊...
一直沒有重灌就不能改系統。不過可能不會考慮 mac 了...

godfat ~/p/A/happy> runhaskell Setup.lhs configure

Setup.lhs:6:51:
Warning: In the use of `buildVerbose'
(imported from Distribution.Simple.Setup):
Deprecated: "Use buildVerbosity instead"

Setup.lhs:7:51:
Warning: In the use of `defaultUserHooks'
(imported from Distribution.Simple):
Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
compatibility in which case you must stick with defaultUserHooks"
Warning: defaultUserHooks in Setup script is deprecated.
Configuring happy-1.18.2...


godfat ~/p/A/happy> runhaskell Setup.lhs build

Setup.lhs:6:51:
Warning: In the use of `buildVerbose'
(imported from Distribution.Simple.Setup):
Deprecated: "Use buildVerbosity instead"

Setup.lhs:7:51:
Warning: In the use of `defaultUserHooks'
(imported from Distribution.Simple):
Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
compatibility in which case you must stick with defaultUserHooks"
Preprocessing executables for happy-1.18.2...
Setup.lhs: The program happy is required but it could not be found

..................
修改
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_happy/work/happy-1.17/Setup.lhs
buildVerbose 改 buildVerbosity:

godfat /o/l/v/m/b/_/w/happy-1.17> sudo port install happy
Password:
---> Configuring happy
Error: Target org.macports.configure returned: shell command "cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_happy/work/happy-1.17 && runhaskell Setup configure --ghc --prefix=/opt/local" returned error 1
Command output:
Setup.lhs:30:43:
Couldn't match expected type `Distribution.Verbosity.Verbosity'
against inferred type `Distribution.Simple.Setup.Flag
Distribution.Verbosity.Verbosity'
In the first argument of `rawSystemProgramConf', namely
`(buildVerbosity flags)'
In the expression:
rawSystemProgramConf (buildVerbosity flags) p (withPrograms lbi)
In the definition of `runProgram':
runProgram p = rawSystemProgramConf
(buildVerbosity flags) p (withPrograms lbi)

Error: Status 1 encountered during processing.

頭好暈.............

13 retries:

Josh Ko said...

我猜 cabal install happy 應該成功了。happy 會有個執行檔,而不會現身為 Haskell package。

godfat 真常 said...

我也覺得應該成功了,可是 agda configure 不過,
以為一定要是 ghc package. 改改看 configure 看看好了,
如果他只是要執行檔的話,應該跳過檢查即可

godfat 真常 said...

Hmm...
godfat ~/p/Agda> ./configure --with-happy ~/.cabal/bin/happy

configure: error: happy version 1.14 or later required

很好,修改 configure:
> if test "$fp_num1" -ge "0"; then
拜託,1.18 應該大於 1.14 吧...

重跑之後,configure 真的過了,只是 make 沒過

感謝,這樣就可以繼續試了 @@

godfat 真常 said...

QuickCheck 2.1.0.1 灌不起來
根據:
http://lists.osuosl.org/pipermail/darcs-users/2008-November/015959.html
成功 build 起來。

把 QuickCheck/build/* 移動到
~/.cabal/lib/QuickCheck-2.1.0.1/ghc-6.10.1 裡面
rm 掉 1.2.0.0

修改 ~/.ghc/i386-darwin-6.10.1/package.conf
把 QuickCheck-1.2.0.0 的字全改成 QuickCheck-2.1.0.1

修改 /opt/local/lib/ghc-6.10.1/package.conf
把上面的 package.conf 中的 InstalledPackageInfo
全部 copy 到最下面,小心別 copy 錯了

godfat ~/p/Agda> make
runhaskell Setup.hs configure
Configuring Agda-2.1.3...
Setup.hs: At least the following dependencies are missing:
binary >=0.4.4 && <0.5, haskeline ==0.3.*
make: *** [dist/setup-config] Error 1

終於只欠兩樣東西了...

godfat 真常 said...

binary 0.4.4 原來是忘記 copy

haskeline 需要降級,下載 build 之後,
依樣畫狐狸,copy haskeline 0.4 的所有東西,
全部改成 0.3.2, 希望 signature 沒變...

godfat ~/p/Agda> make
runhaskell Setup.hs configure
Configuring Agda-2.1.3...
Setup.hs: happy version >=1.15 && <2 is required but it could not be found.
make: *** [dist/setup-config] Error 1

唉,又卡關了

godfat 真常 said...

我出運了!!

godfat ~/p/Agda> set PATH $PATH ~/.cabal/bin/

godfat ~/p/Agda> make
runhaskell Setup.hs configure
Configuring Agda-2.1.3...
runhaskell Setup.hs build
Preprocessing library Agda-2.1.3...
Building Agda-2.1.3...
[ 1 of 177] Compiling Agda.Version ( src/full/Agda/Version.hs, dist/build/Agda/Version.o )
[...]

耶,洗澡去...

godfat 真常 said...

[...]
[177 of 177] Compiling Agda.Main ( src/full/Agda/Main.hs, dist/build/Agda/Main.o )
ar: creating archive dist/build/libHSAgda-2.1.3.a
runhaskell Setup.hs register --user --inplace
Registering Agda-2.1.3...
Reading package info from "dist/inplace-pkg-config" ... done.
Writing new package config file... done.
make -C ./src/main
runhaskell Setup.hs configure --user
Configuring Agda-executable-2.1.3...
Rebuilding executable...
runhaskell Setup.hs build
Preprocessing executables for Agda-executable-2.1.3...
Building Agda-executable-2.1.3...
[1 of 1] Compiling Main ( Main.hs, dist/build/agda/agda-tmp/Main.o )
Linking dist/build/agda/agda ...
make -C ./src/core
mkdir -p ../../out/core
mkdir -p ../../out/core/Thierry
bnfc -haskell -d Core.cf
make[1]: bnfc: Command not found
make[1]: *** [../../out/core/Core/Par.y] Error 127
make: *** [core] Error 2

啥鬼?

http://www.cs.chalmers.se/Cs/Research/Language-technology/BNFC/

直接下載 binary, 懶得 compile 了
ln -s bndc-2.4b-macosx-i386 ~/.cabal/bin/bnfc

godfat ~/p/Agda> make
make -C ./src/core
bnfc -haskell -d Core.cf
The BNF Converter, 2.4b
(c) Bjorn Bringert, Johan Broberg, Paul Callaghan, Markus Forsberg,
Ola Frid, Peter Gammie, Patrik Jansson, Kristofer Johannisson,
Antti-Juhani Kaijanaho, Ulf Norell, Michael Pellauer
and Aarne Ranta 2002 - 2008.
Free software under GNU General Public License (GPL).
Bug reports to {markus,aarne}@cs.chalmers.se.


Reading grammar from Core.cf
33 rules accepted

Creating directory Core
writing file Core/Abs.hs
writing file Core/Lex.x
(Use Alex 2.0 to compile.)
writing file Core/Par.y
(Tested with Happy 1.15)
writing file Core/Doc.tex
writing file Core/Doc.txt
writing file Core/Skel.hs
writing file Core/Print.hs
writing file Core/Layout.hs
writing file Core/Test.hs
writing file Core/ErrM.hs
Done!
rm -rf ../../out/core/Core
mv Core ../../out/core
yes -agc --info=../../out/core/Core/Par.happy.out ../../out/core/Core/Par.y -o ../../out/core/Core/Par.hs
-agc
-agc
-agc
-agc
[...]

..........
一直瘋狂吐出 -agc 之類的
ctrl + c => interrupt

terminal 看起來快當了,真是一波萬折啊...

godfat 真常 said...

注意到好像是因為他 invoke yes...
godfat ~/p/Agda> which yes
/usr/bin/yes

不知道是啥鬼?
暫時移掉
godfat ~/p/Agda> sudo mv /usr/bin/yes /usr/bin/yes.bak

godfat ~/p/Agda> make
make -C ./src/core
bnfc -haskell -d Core.cf
[...]
writing file Core/ErrM.hs
Done!
rm -rf ../../out/core/Core
mv Core ../../out/core
yes -agc --info=../../out/core/Core/Par.happy.out ../../out/core/Core/Par.y -o ../../out/core/Core/Par.hs
make[1]: yes: Command not found
make[1]: *** [../../out/core/Core/Par.hs] Error 127
rm ../../out/core/Core/Par.y
make: *** [core] Error 2

很好,那我就來偽造 yes 成 happy.
godfat ~/p/Agda> ln -s ~/.cabal/bin/happy ~/.cabal/bin/yes

godfat ~/p/Agda> make
make -C ./src/core
bnfc -haskell -d Core.cf
[...]
yes -agc --info=../../out/core/Core/Par.happy.out ../../out/core/Core/Par.y -o ../../out/core/Core/Par.hs
unused terminals: 1
alex -g ../../out/core/Core/Lex.x -o ../../out/core/Core/Lex.hs
ghc --make -o ../../out/core/agdacore -odir ../../out/core -hidir ../../out/core -i../../out/core -O -Wall -Werror -fno-warn-missing-signatures -fno-warn-name-shadowing -fno-warn-simple-patterns -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports -fno-warn-type-defaults -fno-warn-orphans -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns Main.hs
[1 of 6] Compiling Core.Lex ( ../../out/core/Core/Lex.hs, ../../out/core/Core/Lex.o )
[2 of 6] Compiling Core.Abs ( ../../out/core/Core/Abs.hs, ../../out/core/Core/Abs.o )
[3 of 6] Compiling Core.Print ( ../../out/core/Core/Print.hs, ../../out/core/Core/Print.o )
[4 of 6] Compiling Core.ErrM ( ../../out/core/Core/ErrM.hs, ../../out/core/Core/ErrM.o )
[5 of 6] Compiling Core.Par ( ../../out/core/Core/Par.hs, ../../out/core/Core/Par.o )
[6 of 6] Compiling Main ( Main.hs, ../../out/core/Main.o )
Linking ../../out/core/agdacore ...
rm ../../out/core/Core/Par.y
(cd ./src/transl; runhaskell Setup.hs build)
Setup.hs: Run the 'configure' command first.
make: *** [transl] Error 1

.....重來
godfat ~/p/Agda> runhaskell Setup.hs configure
Configuring Agda-2.1.3...
godfat ~/p/Agda> make
runhaskell Setup.hs build
Preprocessing library Agda-2.1.3...
Building Agda-2.1.3...
ar: creating archive dist/build/libHSAgda-2.1.3.a
runhaskell Setup.hs register --user --inplace
Registering Agda-2.1.3...
Reading package info from "dist/inplace-pkg-config" ... done.
Writing new package config file... done.
make -C ./src/main
make[1]: Nothing to be done for `default'.
make -C ./src/core
make[1]: Nothing to be done for `default'.
(cd ./src/transl; runhaskell Setup.hs build)
Setup.hs: Run the 'configure' command first.
make: *** [transl] Error 1
godfat ~/p/Agda> cd ./src/transl; runhaskell Setup.hs configure
Configuring Agda1to2-2.0.1...
Setup.hs: At least the following dependencies are missing:
Agda >=2.0.1

昏倒... 為什麼灌到一半會需要自己?

godfat 真常 said...

中間還重灌了 bnfc, 根據:
http://www.cs.chalmers.se/Cs/Research/Language-technology/BNFC/

darcs get --partial http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/BNFC/

結果他說改用 http://code.haskell.org/bnfc

改用之後 make 成功建成 bnfc, 丟一個 hard link 到 ~/.cabal/bin

都要凌晨了,明早繼續好了... >_<
本來要十點睡的...

Plumm said...

godfat 應該灌軟體灌成習慣了吧??

godfat 真常 said...

有時候解決疑難雜症是滿有趣的

jaiyalas said...

那趕快來救救我 XD

godfat 真常 said...

咱都是見招拆招,沒有招要怎麼拆? :s

Post a Comment

All texts are licensed under CC Attribution 3.0