Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I7 on Linux: Nasty evil hackery

18 views
Skip to first unread message

na...@natecull.org

unread,
May 2, 2006, 5:08:37 AM5/2/06
to
Although the full Inform7.exe doesn't run yet (until the Wine folks
make a workable fake Internet Explorer), I have been able to get at
least the ni.exe compiler sorta-working. Here's what I've done so far,
very quick and nasty hacks:

I'm running Ubuntu Breezy, latest patches. I did upgrade my Wine to the
latest version (9.12) using the instructions in
http://winehq.com/site/download-deb, but otherwise it's pretty
standard. I think. I have Inform 6 and Frotz installed via Synaptic
from the Ubuntu repository.

I deleted my ~/.wine folder and ran 'wine msiexec -i
I73K27_Windows.msi'. This ran with no problems. I'm not sure why others
are having this crash. Try using the latest Wine maybe? It created a
'.wine/drive_c/Program Files/Inform 7' folder with the juicy goodness
inside.

Now, ni.exe lives under Program FIles/Inform 7/Compilers. To run, it
needs to be pointed at the location of the Standard Rules with the
'-rules' flag. To simplify things, I copied the Extensions folder from
'Program Files/Inform 7/Inform7' into the Compilers directory. I also
created a test.i7 with the contents:

"Test Game"

Test Room is a room. "This is a test room."


Having done this, the syntax to compile it is:

wine ni test.i7 -rules Extensions

This runs, but at 78% it crashes with a segfault:

wine: Unhandled page fault on read access to 0x00000000 at address
0xb7e34c20 (thread 0009), starting debugger...
WineDbg starting on pid 0x8
Unhandled exception: page fault on read access to 0x00000000 in 32-bit
code (0xb7e34c20).

Nasty. HOWEVER, before crashing, ni has actually generated the Inform 6
code, in a file 'auto.inf'. Now we just need to compile it against the
I7 libraries.

I used the ordinary Ubuntu inform for this, though there's an
Inform.exe in the Compilers folder. In the spirit of nasty evil
hackery, I just copied the contents of '.wine\drive_c\Program
Files\Inform 7\Library\Natural' into this folder. Now, I can run:

inform auto.inf

and get an error-free compile (though with 193 warnings), giving me an
auto.z5.

Then I can

frotz auto.z5

and get a working game.

Nasty and evil, but at least I can sort of play in the I7 sandpit on my
Linux box now. GUIs are for wimps anyway, right? ;)

PS. I don't know why ni.exe crashes wine. The previous (closed) beta
didn't. It ran rather nicely in fact. I don't think my wine has changed
in the interim, but I couldn't swear by it.

PPS. Obviously a Linux native compilable version of ni would be better
than using wine. Graham, sorry to bug you, but can you give us any idea
of a timeframe for this, or would you prefer we don't even try until
someone writes a full IDE?

David Kinder

unread,
May 2, 2006, 5:14:52 AM5/2/06
to
Nate wrote:
> PS. I don't know why ni.exe crashes wine. The previous (closed) beta
> didn't. It ran rather nicely in fact. I don't think my wine has changed
> in the interim, but I couldn't swear by it.

Something of a guess here, but on Windows NI expects that the caller
has set up the environment variable "HOME" to point to a suitable
directory for it to find extensions and create documentation. Try
creating an env var "HOME" and setting it to a writeable directory.

David

na...@natecull.org

unread,
May 2, 2006, 5:43:37 AM5/2/06
to
I have a bash environment var HOME set to /home/nate, which is outside
of the Wine drive_c sandbox, so maybe that's confusing it. I'm not
entirely sure how wine handles environments. Presumably there's a way
to fake it.

Andrew Cowper

unread,
May 2, 2006, 7:18:23 AM5/2/06
to
na...@natecull.org writes:

>
> PPS. Obviously a Linux native compilable version of ni would be better
> than using wine. Graham, sorry to bug you, but can you give us any idea
> of a timeframe for this, or would you prefer we don't even try until
> someone writes a full IDE?
>

A quick look through the Windows source implies that ni.exe is created
using gcc from C code generated by ctangle from a source file written
in CWEB.

This implies that, given the CWEB source, it would be straightforward
to produce a ni binary for Linux.

This would seem to be the first step towards a Java version of the
Inform 7 IDE.

--
Andrew Cowper

Pick a different user name to email me.
*** Posted via a free Usenet account from http://www.teranews.com ***

Tikitu de Jager

unread,
May 3, 2006, 4:07:59 PM5/3/06
to
na...@natecull.org wrote:
> [ how to quick-and-dirty the I7 compiler under wine ]

Thank you sir. From my heart's bottom.

Wheee! Can't wait to get my hands dirty...

--Tikitu

Stuart "Sslaxx" Moore

unread,
May 3, 2006, 4:39:10 PM5/3/06
to
To confirm ni.exe seems to work with earlier versions of WINE as well
(Debian Etch, here). Crashes at the same point (78%), having
preprocessed the Test.inf. Got it to compile with Inform 7's supplied
Inform 6.31, 195 warnings.

--
Stuart "Sslaxx" Moore
http://sslaxx.livejournal.com/

Malcolm Beattie

unread,
May 7, 2006, 1:59:04 PM5/7/06
to
On 2006-05-02, na...@natecull.org <na...@natecull.org> wrote:
[...]

> I deleted my ~/.wine folder and ran 'wine msiexec -i
> I73K27_Windows.msi'.
[...]

> wine ni test.i7 -rules Extensions
[...]

> inform auto.inf
>
> and get an error-free compile (though with 193 warnings), giving me an
> auto.z5.

I followed these instructions and ran across one extra gotcha with
the I7_3K56_Windows.msi version that I downloaded. The generated
auto.inf was wanting VerbLib.h (uppercase L) whereas the file
provided with the Inform7 distribution is called Verblib.h
(lowercase l). Windows hides the difference but when using the
Linux native "inform auto.inf" to compile it, it wanted case
sensitive accuracy. I did a "ln -s Verblib.h VerbLib.h" (rather
than a rename in case anything else referred to the Verblib.h form)
and the compilation ran fine. I actually compiled with
inform +../Library/Natural auto.inf
to set the library path without needing to copy stuff across.
Thanks for the instructions--I doubt I'd have had the energy to get
this far without them and if it works well enough to sustain my
interest I may spend some time doing proper Linux versions if
enough info is available. (Since I7 is described as "Anti-Perl" it
might be amusing to be the guy that both wrote the Perl compiler and
also ported an Anti-Perl compiler :-)

--Malcolm

--
Malcolm Beattie <mbea...@clueful.co.uk>

Craig Pennington

unread,
May 17, 2006, 5:20:31 PM5/17/06
to
na...@natecull.org wrote:
[snip]

> I'm running Ubuntu Breezy, latest patches. I did upgrade my Wine to the
> latest version (9.12) using the instructions in
> http://winehq.com/site/download-deb, but otherwise it's pretty
> standard. I think. I have Inform 6 and Frotz installed via Synaptic
> from the Ubuntu repository.

> I deleted my ~/.wine folder and ran 'wine msiexec -i
> I73K27_Windows.msi'. This ran with no problems. I'm not sure why others
> are having this crash. Try using the latest Wine maybe? It created a
> '.wine/drive_c/Program Files/Inform 7' folder with the juicy goodness
> inside.

I got a similar setup working with an up-to-date Gentoo(2006.0)/wine(0.9.12)
machine with I7_3L95_Windows.msi.

> Now, ni.exe lives under Program FIles/Inform 7/Compilers. To run, it
> needs to be pointed at the location of the Standard Rules with the
> '-rules' flag. To simplify things, I copied the Extensions folder from
> 'Program Files/Inform 7/Inform7' into the Compilers directory. I also
> created a test.i7 with the contents:

> "Test Game"

> Test Room is a room. "This is a test room."


> Having done this, the syntax to compile it is:

> wine ni test.i7 -rules Extensions

> This runs, but at 78% it crashes with a segfault:

> wine: Unhandled page fault on read access to 0x00000000 at address
> 0xb7e34c20 (thread 0009), starting debugger...
> WineDbg starting on pid 0x8
> Unhandled exception: page fault on read access to 0x00000000 in 32-bit
> code (0xb7e34c20).

> Nasty.

Indeed. This command line, stolen from Fraser in his post "Inform 7
ni.exe on Cedega/Wine, Linux IDE," works for me:

$ wine Program\ Files/Inform\ 7/Compilers/ni.exe -rules 'C:\Program Files\Inform 7\Inform7\Extensions' -package 'C:\Inform\Play.inform'

(NB -- one bit of ugliness is that your current working directory when
you run the above command line should be ~/.wine/drive_c -- there are
some issues with the wine and the linux environments getting confused
looking at and/or creating the contents of `pwd`/Inform [linux] and
C:\Inform [wine] that can be avoided by approprately setting your
current working directory before running wine.)

The key, however, is that I created a one-room project like your Test on
my OSX install and tarred it up to use as a stub. It is that which is
kept in ~/.wine/drive_c/Inform/Play.inform/ -- but the only file that
matters to ni.exe is:

~/.wine/drive_c/Inform/Play.inform/Source/story.ni

and you can edit that with your favorite text editor. This compiles
without making wine barf and you're off (well, it works for me.) The
generated Inform 6 code resides in:

~/.wine/drive_c/Inform/Play.inform/Build/auto.inf

> HOWEVER, before crashing, ni has actually generated the Inform 6
> code, in a file 'auto.inf'. Now we just need to compile it against the
> I7 libraries.

> I used the ordinary Ubuntu inform for this, though there's an
> Inform.exe in the Compilers folder. In the spirit of nasty evil
> hackery, I just copied the contents of '.wine\drive_c\Program
> Files\Inform 7\Library\Natural' into this folder. Now, I can run:

> inform auto.inf

I tried that with inform 6.30.2 (the current ~x86 Gentoo version,) but
haven't really got that working right yet. I can still stumble through
with wine though:

wine Program\ Files/Inform\ 7/Compilers/inform-631.exe +'C:\Program Files\Inform 7\Library\Natural' 'C:\Inform\Play.inform\Build\auto.inf'



> and get an error-free compile (though with 193 warnings), giving me an
> auto.z5.

> Then I can

> frotz auto.z5

> and get a working game.

Likewise.

> Nasty and evil, but at least I can sort of play in the I7 sandpit on my
> Linux box now. GUIs are for wimps anyway, right? ;)

Oh, but the ide is *so* nice.

> PS. I don't know why ni.exe crashes wine. The previous (closed) beta
> didn't. It ran rather nicely in fact. I don't think my wine has changed
> in the interim, but I couldn't swear by it.

I'm pretty sure it has something to do with expecting certain
directories to exist that don't. Tooling around with this idea:

$ find foo.inform/
foo.inform/Source
foo.inform/Source/story.ni
foo.inform/Build
foo.inform/Index
$ wine ~/.wine/drive_c/Program\ Files/Inform\ 7/Compilers/ni.exe -rules 'C:\Program Files\Inform 7\Inform7\Extensions' -package 'C:\foo.inform'
Inform 7 build 3L95 has started.
++ 0% (Lexical analysis)
I've now read your source text, which is 2914 words long.
++ 5% (Semantic analysis)
I've also read Standard Rules by Graham Nelson, which is 11053 words
long.
++ 15% (Drawing inferences)
++ 20% (Binding rulebooks)
++ 23% (Binding rulebooks)
++ 26% (Binding rulebooks)
++ 29% (Binding rulebooks)
++ 32% (Binding rulebooks)
++ 35% (Binding rulebooks)
++ 38% (Binding rulebooks)
++ 41% (Generating code)
++ 44% (Generating code)
++ 73% (Generating code)
++ 92% (Generating code)
++ 95% (Generating code)
++ 98% (Generating code)

The 2914-word source text has successfully been translated into an
intermediate description which can be run through Inform 6 to complete
compilation. There were 1 room and 18 things.

Natural Inform has finished. This run took 0 sec (CPU time, 430 csec).

$

So, all you need is the directory structure:

${ProjectName}/Source/
${ProjectName}/Build/
${ProjectName}/Index/

And your I7 source file needs to be named:

${ProjectName}/Source/story.ni

And it should compile.

> PPS. Obviously a Linux native compilable version of ni would be better
> than using wine. Graham, sorry to bug you, but can you give us any idea
> of a timeframe for this, or would you prefer we don't even try until
> someone writes a full IDE?

It looks like Fraser and a few others are making good headway on this
front.

Cheers,
Craig

--
Corollary to Clarke's Third Law:
Any technology distinguishable from magic is insufficiently
advanced.

Stuart "Sslaxx" Moore

unread,
May 17, 2006, 5:39:13 PM5/17/06
to

Running from within the Inform 7 directory (so I'm using relative versus
absolute paths for one):

<begin>
stuart@sslaxxworks:~/WINEdows/Program Files/Inform 7$ wine
Compilers/ni.exe -package Test/ -rules Inform7/Extensions/


Inform 7 build 3L95 has started.
++ 0% (Lexical analysis)

I've now read your source text, which is 389 words long.


++ 5% (Semantic analysis)
I've also read Standard Rules by Graham Nelson, which is 11053 words long.
++ 15% (Drawing inferences)
++ 20% (Binding rulebooks)
++ 23% (Binding rulebooks)
++ 26% (Binding rulebooks)
++ 29% (Binding rulebooks)
++ 32% (Binding rulebooks)
++ 35% (Binding rulebooks)
++ 38% (Binding rulebooks)
++ 41% (Generating code)
++ 44% (Generating code)

++ 47% (Generating code)
++ 77% (Generating code)
++ 98% (Generating code)
Unable to create dictionary file
Offending filename: <\Inform\Extensions\Reserved\Dictionary.txt>
Wine failed with return code 2
<end>

auto.inf is built within Test/Build though, and still compiles, so it's
not all that bad. Looks, though, like there may be an issue with paths.

fras...@gmail.com

unread,
May 18, 2006, 3:04:38 PM5/18/06
to

Craig Pennington wrote:

> Indeed. This command line, stolen from Fraser in his post "Inform 7
> ni.exe on Cedega/Wine, Linux IDE," works for me:
>
> $ wine Program\ Files/Inform\ 7/Compilers/ni.exe -rules 'C:\Program Files\Inform 7\Inform7\Extensions' -package 'C:\Inform\Play.inform'

Does that work? Well. I've settled on mapping H: to my home
directory, because from what I've seen ni looks for "\Inform\*" for the
local files ... I've just realised that you probably have HOME set in
some way. Since I start ni in a subdirectory of H:, so long as I have
a directory called Inform in \ with the right subdirectories, it will
work by coincidence (a powerful force).

Anyhoo, I have good results with a link in .wine/dosdevices as follows:

[fraser@kimba ~]$ ls -l .wine/dosdevices/
total 0
lrwxrwxrwx 1 fraser fraser 10 May 18 09:59 c: -> ../drive_c
lrwxrwxrwx 1 fraser fraser 12 May 18 12:05 h: -> /home/fraser
lrwxrwxrwx 1 fraser fraser 1 May 18 09:59 z: -> /
[fraser@kimba ~]$

There's one wee problem: the ni proces only ever gets to 78%. This
might be a feature. It seems to generate a game though.

> (NB -- one bit of ugliness is that your current working directory when
> you run the above command line should be ~/.wine/drive_c -- there are
> some issues with the wine and the linux environments getting confused
> looking at and/or creating the contents of `pwd`/Inform [linux] and
> C:\Inform [wine] that can be avoided by approprately setting your
> current working directory before running wine.)

What happens if it's not? I may have avoided this issue with the H:
thing.

> Oh, but the ide is *so* nice.

Well, it's ready to go -- you can even submit bug reports
(thewhitelion.org/bugzilla). I just need to take care of a few little
bits and pieces.

> I'm pretty sure it has something to do with expecting certain
> directories to exist that don't. Tooling around with this idea:

That's exactly right. The IDE automates a bunch of stuff.

Fraser.

0 new messages