
OK, I struggled through the instructions at http://haskell.org/haskellwiki/Yhc/Javascript/Users_guide#Downloading and am getting tripped up at (cd src/translator/js; make all install) any advice? ... blah blah blah.... ghc --make -i../../../depends/filepath splitter.hs -o /home/thartman/haskell-installs/yhc-install/yhc/src/translator/js/inst\ /bin/splitter [1 of 4] Compiling System.FilePath.Version_0_11 ( ../../../depends/filepath/System/FilePath/Version_0_11.hs, ../../../depend\ s/filepath/System/FilePath/Version_0_11.o ) [2 of 4] Compiling System.FilePath ( ../../../depends/filepath/System/FilePath.hs, ../../../depends/filepath/System/FilePat\ h.o ) [4 of 4] Compiling Main ( splitter.hs, splitter.o ) Linking /home/thartman/haskell-installs/yhc-install/yhc/src/translator/js/inst/bin/splitter ... echo > W3C/addtags.idl for tag in SUB SUP SPAN BDO I B U S \ STRIKE BIG SMALL EM STRONG DFN CODE \ SAMP KBD VAR CITE ACRONYM ABBR \ DD DT NOFRAMES NOSCRIPT ADDRESS CENTER ; do \ ltag=`echo ${tag:1} | tr [:upper:] [:lower:]` ; \ echo " interface HTML${tag:0:1}${ltag}Element : HTMLElement {" >> W3C/addtags.idl ; \ echo " };" >> W3C/addtags.idl ; \ echo >> W3C/addtags.idl ; \ done /bin/sh: Syntax error: Bad substitution make: *** [W3C/addtags.idl] Error 2

On Nov 24, 2007, at 17:07 , Thomas Hartman wrote:
ltag=`echo ${tag:1} | tr [:upper:] [:lower:] ` ; \ echo " interface HTML${tag:0:1}${ltag}Element : HTMLElement {" >> W3C/addtags.idl ; \
(...)
/bin/sh: Syntax error: Bad substitution
Translation: "This program only works on Linux." That variable substitution is not supported by /bin/sh on any system where /bin/sh is not bash, which is to say any system that is not Linux. (And possibly even not on some Linuxes; I think I've heard at least one distribution has tried to break the bash dependency, but I'm sure they'll go back soon because of all the people complaining about how "broken" it is.) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Thanks Brandon. I'm on ubuntu feisty.
This breakage is a manifestation of
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/61463
Basically, feisty switched the default shell to "dash" (which I'd
never heard of) from bash, because dash runs faster. But it's not 100%
compatible.
This was very controversial, but it appears that the feisty devs are
not amenable to switching /bin/sh back to bash, despite massive script
breakage, because using dash as default saves them tim. I must say, I
disagree with this move; and feel a bit let down by a distro that
overall has been very good to me.
Feisty devs suggest people fix the underlying problem, which is that
/bin/sh should not assume bash as default, but specify bash
explicitly. So I guess this is what should be done in the case of
building ycr2js; either that or make it dash compatible.
I will try to fix this myself by editing the makefile. I'll also
volunteer to the buildbot.
FWIW, this shouldn't affect ubuntu dapper (long term support) as they
still do the expected thing with sh.
thomas.
2007/11/24, Brandon S. Allbery KF8NH
On Nov 24, 2007, at 17:07 , Thomas Hartman wrote:
ltag=`echo ${tag:1} | tr [:upper:] [:lower:] ` ; \ echo " interface HTML${tag:0:1}${ltag}Element : HTMLElement {" >> W3C/addtags.idl ; \
(...)
/bin/sh: Syntax error: Bad substitution
Translation: "This program only works on Linux."
That variable substitution is not supported by /bin/sh on any system where /bin/sh is not bash, which is to say any system that is not Linux. (And possibly even not on some Linuxes; I think I've heard at least one distribution has tried to break the bash dependency, but I'm sure they'll go back soon because of all the people complaining about how "broken" it is.)
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Nov 25, 2007, at 9:45 , Thomas Hartman wrote:
Feisty devs suggest people fix the underlying problem, which is that /bin/sh should not assume bash as default, but specify bash explicitly. So I guess this is what should be done in the case of building ycr2js; either that or make it dash compatible.
They're correct. I now know there is no point in even thinking about YHC on Solaris or FreeBSD because it knows that /bin/sh is always bash. But then, portability is generally not considered a useful feature in the Linux world.... -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

I got through this hurdle following suggestions at
https://wiki.ubuntu.com/DashAsBinSh
SHELL = /bin/bash at the top of the main makefile did not work, and I
did not bother going deeper down this route.
Rather I did sudo dpkg-reconfigure dash
and answered "no" when asked if sh should be dash. Thereafter, sh was bash.
Beh.
I also had to rm -rf ghc and run make again; ((cd src/translator/js;
make clean) was not sufficient. (Something wrong with clean?)
So this got me past the sh mis-aliasing issue but I'm now having
problems on the final ghc make command.
What is System.FilePath.Version_0_09 ?
t.
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js>ghc
--make -i../../compiler98 -i../../libraries/core
-i../../libraries/general -i../../../depends/filepath
-i../../../depends/play -i../../../depends/uniplate ycr2js.hs -o
/home/thartman/haskell-installs/yhc-install/yhc/src/translator/js/inst/bin/ycr2js
ycr2js.hs:8:7:
Could not find module `System.FilePath.Version_0_09':
Use -v to see a list of the files searched for.
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js>ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.1
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js>ghc-pkg
list | grep -i filepath
filepath-1.1.0.0, (ghc-6.8.1), haskell-src-1.0.1.1,
2007/11/25, Brandon S. Allbery KF8NH
On Nov 25, 2007, at 9:45 , Thomas Hartman wrote:
Feisty devs suggest people fix the underlying problem, which is that /bin/sh should not assume bash as default, but specify bash explicitly. So I guess this is what should be done in the case of building ycr2js; either that or make it dash compatible.
They're correct. I now know there is no point in even thinking about YHC on Solaris or FreeBSD because it knows that /bin/sh is always bash. But then, portability is generally not considered a useful feature in the Linux world....
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

I was at least able to get things to build by doing
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js>darcs
whatsnew
{
hunk ./src/translator/js/ycr2js.hs 8
-import System.FilePath.Version_0_09
+import System.FilePath
hunk ./src/translator/js/ycr2js.hs 40
- Just x -> return $ getDirectory $ getDirectory x
+ Just x -> return $ dropFileName x
}
2007/11/25, Thomas Hartman
I got through this hurdle following suggestions at
https://wiki.ubuntu.com/DashAsBinSh
SHELL = /bin/bash at the top of the main makefile did not work, and I did not bother going deeper down this route.
Rather I did sudo dpkg-reconfigure dash
and answered "no" when asked if sh should be dash. Thereafter, sh was bash.
Beh.
I also had to rm -rf ghc and run make again; ((cd src/translator/js; make clean) was not sufficient. (Something wrong with clean?)
So this got me past the sh mis-aliasing issue but I'm now having problems on the final ghc make command.
What is System.FilePath.Version_0_09 ?
t.
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js>ghc --make -i../../compiler98 -i../../libraries/core -i../../libraries/general -i../../../depends/filepath -i../../../depends/play -i../../../depends/uniplate ycr2js.hs -o /home/thartman/haskell-installs/yhc-install/yhc/src/translator/js/inst/bin/ycr2js
ycr2js.hs:8:7: Could not find module `System.FilePath.Version_0_09': Use -v to see a list of the files searched for.
thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js>ghc --version The Glorious Glasgow Haskell Compilation System, version 6.8.1 thartman@none:~/haskell-installs/yhc-install/yhc/src/translator/js>ghc-pkg list | grep -i filepath filepath-1.1.0.0, (ghc-6.8.1), haskell-src-1.0.1.1,
2007/11/25, Brandon S. Allbery KF8NH
: On Nov 25, 2007, at 9:45 , Thomas Hartman wrote:
Feisty devs suggest people fix the underlying problem, which is that /bin/sh should not assume bash as default, but specify bash explicitly. So I guess this is what should be done in the case of building ycr2js; either that or make it dash compatible.
They're correct. I now know there is no point in even thinking about YHC on Solaris or FreeBSD because it knows that /bin/sh is always bash. But then, portability is generally not considered a useful feature in the Linux world....
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Brandon S. Allbery KF8NH
-
Thomas Hartman