Command Line NI Compiler (6L)

Not sure who can answer this, but one of the requests I’ve been making for awhile now is ni command line help and clearly defined arguments for “alternate” scenarios. It seems to be straight-forward, except I think some of the paths are absolute and some are relative.

I’m trying to run a compile and it’s unclear why it’s failing. I’ve tried to run it from various folders, none of which seem to succeed.

I’m wondering if this is because the IDE is setting a hard parent path before executing…the log is below. You can see the last bits are about writing the files out (the compile seems to be done quickly), so…what’s going wrong?

David C.
www.textfyre.com

C:\projects\i7>“C:\Program Files (x86)\Inform 7 6L02\Compilers\ni” \ -rules “C:
Program Files (x86)\Inform 7 6L02\Inform7\Extensions” -package “C:\Users\David\D
ocuments\Inform\Projects\Reflection.inform” -extension=ulx
Inform 7 build 6L02 has started.
++ 0% (Reading text)
I’ve now read your source text, which is 218 words long.
++ 5% (Analysing sentences)
I’ve also read Standard Rules by Graham Nelson, which is 42560 words long.
I’ve also read English Language by Graham Nelson, which is 2130 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)
++ 50% (Generating code)
++ 53% (Generating code)
++ 56% (Generating code)
++ 59% (Generating code)
++ 62% (Generating code)
++ 65% (Generating code)
++ 68% (Generating code)
++ 71% (Generating code)
++ 74% (Generating code)
++ 77% (Generating code)
++ 80% (Generating code)
++ 83% (Generating code)
++ 86% (Generating code)
++ 89% (Generating code)
++ 92% (Generating code)
++ 95% (Generating code)
++ 98% (Generating code)
Failed to create folder <Inform\Extensions\Reserved>
Unable to open extensions documentation index for writing
Offending filename: <\Inform\Documentation\Extensions.html>

Hello,

first, I’ve heard some years ago the NI compiler, which is the last part of Inform 7 not open source, should be opened (it was supposed to be last year). I do enjoy using open source software, even if I’m not a free software zealot, for various reasons, the first of all being it’s often easier to maintain, to study, to understand what is wrong etc.

I understand the Inform 7 creators wishes to maintain some control over the code of the core, anyway, it’s such a big thing that it would probably never be out of their expertise…

About your question David, I haven’t tried much of 6L, but for the previous version I had no problem with this:

$(INFORMCOMPILERS)/ni \ -rules $(INFORMPATH)/Extensions -extension=ulx -package $(GAME).inform -release # $(INFORMCOMPILERS)/inform-6.32-biplatform \ -wxE2~S~DG $(GAME).inform/Build/auto.inf $(GAME).inform/Build/output.ulx # $(INFORMCOMPILERS)/cBlorb \ -unix $(GAME).inform/Release.blurb $(GAME).gblorb

where:

INFORMPATH=./ INFORMCOMPILERS=compilers/ GAME=mygame

(all being relative paths, and I’m using a makefile)

I don’t think this changed in the latest release. I’m trying to see this for a game I have, but I haven’t converted it yet fully. Maybe you could try to move C:
Program Files (x86)\Inform 7 6L02\Inform7\Extensions to a folder you have full read/write access…

It’s on Linux but it should be the same on windows, and this worked for me:

../I7_6L02/Compilers//ni \                                                                         
        -rules ../I7_6L02//Extensions -extension=ulx -package zefrenchcountrysideisfulloffreshair.inform -release                                                                                     
Inform 7 build 6L02 has started.                                                                   
++ 0% (Reading text)                                                                               
I've now read your source text, which is 1851 words long.                                          
++ 5% (Analysing sentences)
I've also read Standard Rules by Graham Nelson, which is 42560 words long.
I've also read English Language by Graham Nelson, which is 2130 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)
++ 50% (Generating code)
++ 53% (Generating code)
++ 56% (Generating code)
++ 59% (Generating code)
++ 62% (Generating code)
++ 65% (Generating code)
++ 68% (Generating code)
++ 71% (Generating code)
++ 74% (Generating code)
++ 77% (Generating code)
++ 80% (Generating code)
++ 83% (Generating code)
++ 86% (Generating code)
++ 89% (Generating code)
++ 92% (Generating code)
++ 95% (Generating code)
++ 98% (Generating code)

  The 1851-word source text has successfully been translated into an
    intermediate description which can be run through Inform 6 to complete
    compilation. There were 4 rooms and 11 things.
++ 100% (Finishing work)
++ Ended: Translation succeeded: 4 rooms, 11 things
Inform 7 has finished.
#
../I7_6L02/Compilers//inform6 \
        -wxE2~S~DG zefrenchcountrysideisfulloffreshair.inform/Build/auto.inf zefrenchcountrysideisfulloffreshair.inform/Build/output.ulx
Inform 6.33 for Linux (18th April 2014)
::##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
In:  1 source code files             62757 syntactic lines
 56261 textual lines               2051812 characters (ISO 8859-1 Latin1)
Allocated:
  8142 symbols (maximum 20000)    13711954 bytes of memory
Out:   Glulx story file 3.140515 (521K long):
    21 classes (maximum 200)            56 objects (maximum 639)
   229 global vars (maximum 233)     86243 variable/array space (maximum 180000)
    82 verbs (maximum 255)             336 dictionary entries (maximum 2000)
   149 grammar lines (version 2)       232 grammar tokens (unlimited)
    79 actions (maximum 200)            38 attributes (maximum 48)
    38 common props (maximum 62)       217 individual props (unlimited)
 95308 characters used in text       74986 bytes compressed (rate 0.786)
     0 abbreviations (maximum 64)     2863 routines (unlimited)
 58356 instructions of code          37760 sequence points
    60 bytes readable memory used (maximum 65536)
532992 bytes used in machine    1073208832 bytes free in machine
Compiled with 1697 suppressed warnings
Completed in 0 seconds
#
../I7_6L02/Compilers//cBlorb \
        -unix zefrenchcountrysideisfulloffreshair.inform/Release.blurb zefrenchcountrysideisfulloffreshair.gblorb
! cBlorb 1.2 [executing on Thursday 15 May 2014 at 09:27.26]
! The blorb spell (safely protect a small object as though in a strong box).
! Release folder: <zefrenchcountrysideisfulloffreshair.materials/Release>
Copy blorb to: [[zefrenchcountrysideisfulloffreshair.materials/Release/Ze French countryside is full o.gblorb]]
! Completed: wrote blorb file of size 625534 bytes (1 picture(s), 0 sound(s))

Just to complete the previous answer, my relative …/I7_6L02/Extensions/ was not written (the time stamp of the files in it remained the same), and I don’t have any Documentation subfolder and the compiler didn’t complain.

You need to set the HOME environment variable to a location under which Inform\Documentation and Inform\Extensions can be generated. The front-end sets this to the location of “My Documents”, by default.

Aha! I knew it was something sneaky. Maybe if Graham is listening we could add a -home switch to set the path inline with a command?

David C.
www.textfyre.com

Sorry, not to derail this conversation, but can you link me to what it was that predicted a release last year? I’m not trying to advocate for anything here, but I’m trying to understand the history of this process a little better (the recent re-licensing of the Inform 6 library has prompted me to research an update to an essay I wrote a few years ago).

here: https://intfiction.org/t/april-28th-has-been-postponed/5313/1

Sorry, but I read the whole thread and then re-read Graham’s post, and I can’t find any mention of open-sourcing the compiler.

Graham has told me (email) that he intends to open-source ni. I’m pretty sure that Emily has posted this statement too, on the forum, although I can’t find it.

He has never given a target date, however. It’s always been “when the source has been tidied up and documented”.

Reviving this thread. Using a hex editor on ni and some educated guesswork from reading the i7 perl script, I figured out that, in the current version of Inform 7, the argument --external “$HOME/Inform” will pick up extensions located in $HOME/Inform/Extensions. It appears that ni merges the arguments of --internal and --external, and they have a required structure (I mimicked the “Internal” structure). Of course you need the bugfixed release of “ni”, at least on Linux, to avoid the gettimeofday crash.

Inform 7 has perhaps succeeded at being the least user-friendly interactive fiction development system since assembly language went out of fashion. An accomplishment, of sorts. Still, it’s powerful and I want to use that power.

The current command-line invocation on MacOS looks like

ni "-internal" "/Applications/Local Apps/Inform-7/Inform-168-1.app/Contents/Resources/Internal" "-external" "/Users/zarf/Library/Inform" "-project" "/Users/zarf/src/if/new-test.inform" "-format=ulx"

Both of the named paths contain subdirs Extensions, Templates, and so on.

Possibly you’ve gotten that far on your own, but I figure it might be easier knowing that than using a hex editor.

1 Like

Thank you. If ni --help had revealed that I would have been saved a lot of frustration. It really ought to be some sort of pinned Inform 7 documentation, frankly.

there’s also…

  • -release
  • -noindex
  • -noprogress
  • -rng
  • -scoring
  • -sigils
  • -gdb
  • -gdball
  • -census
  • -clock

and for a good time, try

  • --log=list
1 Like

Thank you: this is exceptionally useful. Have you considered writing a manpage? :slight_smile:

I’m currently using a hacked (sigh) version of the i7 perl script so that I can check out the extensions git repo directly into the correct Extensions folder without the perl script trashing it, and I feel like I ought to submit the changes to Adam Thornton, but I haven’t due to extreme suspicion of the current state of the maintenance release process for Inform 7. It would be nice to have an improved CLI kit.

I can’t do that – if I wrote a manpage, everyone would know how little I know about most of those flags beyond their existence! Wait, oops…

Fair enough. It’s nice that I don’t have to do the hexediting to find the flags, though! (And --log=list is actually useful.)