To handle the building on Windows using Cygwin, here’s an experience report. TL;DR - so far only one part of the process doesn’t work for me.
When installing Cygwin, I chose:
clang
dos2unix
libclang-devel
libclang8
make
mingw64-i686-clang
mingw64x86_64-clang
Building inweb
git clone https://github.com/ganelson/inweb.git
dos2unix inweb/scripts/first.sh
bash inweb/scripts/first.sh linux
inweb/Tangled/inweb -help
Everything works.
Building intest
git clone https://github.com/ganelson/intest.git
dos2unix intest/scripts/first.sh
bash intest/scripts/first.sh
intest/Tangled/intest -help
Everything works.
Building Inform
git clone https://github.com/ganelson/inform.git
cd inform
dos2unix scripts/first.sh
bash scripts/first.sh
inblorb/Tangled/inblorb -help
../intest/Tangled/intest inform7 -show Acidity
Everything works.
Running Full Tests
make check
That does not work in Cygwin for me.
The following occurs:
$ make check
make -f inform6/inform6.mk test
make[1]: Entering directory '/home/jeffn/i7/inform'
../intest/Tangled/intest -from inform6 all
shell: cd '/home/jeffn/i7/intest/Workspace/T0' ; rm -f *.txt
intest: fatal error: internal error (Execution of the shell failed)
make[1]: *** [inform6/inform6.mk:72: test] Error 2
make[1]: Leaving directory '/home/jeffn/i7/inform'
make: *** [makefile:431: check] Error 2
This looks to be happening with the following line:
$(MAKE) -f $(INFORM6WEB)/inform6.mk test
Given that says it’s leaving the inform directory, I wonder if I don’t have something else set up. My current directory structure is:
i7
--> inform
--> intest
--> inweb
Here my i7 is equivalent to the work directory mentioned in the documentation. Specifically, there is in fact an intest\Workspace\T0 directory, which seems to be where the logic is going.
Looking at the line from inform6.mk that seems to be problematic, it looks to be this:
test: $(INTERPRETERS)/dumb-frotz/dumb-frotz $(INTERPRETERS)/dumb-glulx/glulxe/glulxe
$(INTEST) -from $(ME) all
I’m not sure if this means there’s some other step I should have taken to set up the interpreters. Although I do see a dumb-frotz directory in: inform\inform6\Tests\Assistants.
Specifically I used GCC 11.3.0 + LLVM/Clang/LLD/LLDB 14.0.3 + MinGW-w64 10.0.0 (UCRT) - release 3. I also copied mingw32-make.exe to make.exe.
I also use Git Bash.
Building inweb
git clone https://github.com/ganelson/inweb.git
bash inweb/scripts/first.sh windows
Right away some failures.
make (e=2): The system cannot find the file specified.
make: *** [inweb/inweb.mk:64: initial] Error 2
(Okay, so that failed. Maybe your environment doesn't have the compilers anticipated?)
jkj yuio already noted this issue in his post. So I just copied clang.exe to x86_64-w64-mingw32-clang.exe. That appears to be due to an MinGW oddity. It doesn’t provide that alternate executable for clang while it does for just about all other C/C++ implementations. So try again:
bash inweb/scripts/first.sh windows
inweb/Tangled/inweb -help
Everything works.
Building intest
git clone https://github.com/ganelson/intest.git
bash intest/scripts/first.sh
intest/Tangled/intest -help
Everything works.
Building Inform
git clone https://github.com/ganelson/inform.git
cd inform
bash scripts/first.sh
Got some issues.
cd inform6/Tests/Assistants/dumb-glulx/cheapglk; make
make[1]: Entering directory 'E:/appDev/Projects/i7/inform/inform6/Tests/Assistants/dumb-glulx/cheapglk'
cc -g -Wall -c -o cgfref.o cgfref.c
process_begin: CreateProcess(NULL, cc -g -Wall -c -o cgfref.o cgfref.c, ...) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [<builtin>: cgfref.o] Error 2
make[1]: Leaving directory 'E:/appDev/Projects/i7/inform/inform6/Tests/Assistants/dumb-glulx/cheapglk'
make: *** [inform6/inform6.mk:119: inform6/Tests/Assistants/dumb-glulx/glulxe/glulxe] Error 2
No idea what’s going on there so still investigating. I can say the the path (inform\inform6\Tests\Assistants\dumb-glulx\cheapglk) is accurate and present and the file cgfref.c is present as well.
But I do notice that last entry. It’s looking for:
inform6/Tests/Assistants/dumb-glulx/glulxe/glulxe
Notice the two “glulxe”? But I don’t have that. My build has:
inform\inform6\Tests\Assistants\dumb-glulx\glulxe
Per something jkj yuio also mentioned earlier, I did look at the Makefile in that directory. You’ll see this line:
I did make those changes and it doesn’t seem to work for me. Same error. Specifically, I did the following:
In the inweb\Materials\platforms\windows.mkscript file, added:
SHELL = bash
Then my inweb\Chapter 6\Makefiles.w has been updated for the pathname_slashed function as follows:
void Makefiles::pathname_slashed(OUTPUT_STREAM, pathname *P) {
TEMPORARY_TEXT(PT)
WRITE_TO(PT, "%p", P);
LOOP_THROUGH_TEXT(pos, PT) {
wchar_t c = Str::get(pos);
if (c == '\\') c = '/';
if (c == ' ') WRITE("\\ ");
else PUT(c);
}
DISCARD_TEXT(PT)
}
Then I rebuilt inweb and intest. Both compiled successfully as before.
However, running the compilation for Inform produces the same issue.
But you mention an interesting point: I’m not running msys2 at all. I just have the MinGW-64 installation on my path but I’m using Git Bash as the shell.
I wonder if that’s part of the issue. Is there something in the shell itself that would make this viable?
The end result of all this so far:
In a MinGW context, I can’t (yet) build Inform.
In a Cygwin context, I can build everything (but can’t run the make check).
On my MacOS, I have no issues whatsoever (for obvious POSIX reasons!)
It’s possible the msys shell makes no difference. I ran it because the build didn’t initially work and that can sometimes be the problem. I’ll dig out my list of pacman modules later so you can check.
However, there’s one thing you could check;
IIRC, you have to force rebuild inweb after the changes, or they do not work. have a look in inform7.mk to see if SHELL=bash is there. if not, then inweb didn’t really rebuild.
It’s worth pointing out that I’m using Cygwin (with mingw64-x86_64-clang installed) on Windows to build Inform, so that is the only way that is likely to work without hacking. It would be nice to support other systems, such as MinGW64, not least since that would provide a newer version of clang, but that’s not the priority right now.
It seems to me that the line that is not working is
shell: cd '/home/jeffn/i7/intest/Workspace/T0' ; rm -f *.txt
Does this directory actually exist? At one point there was a problem with workspace directories not being created. I thought that it had been addressed, but possibly not.
There are a few things that aren’t true to life because they reflect some trivial fixes I’ve made locally to make things compile, so you’d see a few more errors if you did it yourself. But it should be the case that there’s nothing on the errors page here that does compile in v10 using the Friends repo as External/Extensions.
(And note that many things on the Errors page never worked in 6M62 either.)
Edited: ah, pits. Some of the compiler error output gets mangled while rewriting it to link to the right line in the source code. But lunch is over and fixing it’ll have to wait.
I did double-check just to be sure and I have confirmed that /home/jeffn/i7/intest/Workspace/T0 does exist. It has a series of directories in it:
Example.inform
Example.materials
Transient
It doesn’t haven’t any .txt files in it so, at the very least, it looks like the rm command did its job. Or, alternatively, is that what’s failing on? The fact that there are no .txt files? None of the other workspace directories (which number from T0 to T15) have text files in them either.
Looking over your notes in more detail, this is wrong
`bash inweb/scripts/first.sh linux`
This needs to be “windows”, not “linux”. We’re using Cygwin as the environment, but we’re building Windows executables (using MinGW’s clang). You’ll need to rebuild everything.
At some point I’ll want to update the FyreVM extensions to work with the new Inform X.
It looks like the following will need to need to be updated:
-) instead of “Starting Up” in “Glulx.i6t”.
-) instead of “Keyboard Input” in “Glulx.i6t”.
-) instead of “Audiovisual Resources” in “Glulx.i6t”.
-) instead of “Typography” in “Glulx.i6t”.
-) instead of “Character Casing” in “Glulx.i6t”.
-) instead of “Glulx-Only Printing Routines” in “Glulx.i6t”.
-) instead of “The Screen” in “Glulx.i6t”.
-) instead of “Window Colours” in “Glulx.i6t”.
-) instead of “Main Window” in “Glulx.i6t”.
-) instead of “Status Line” in “Glulx.i6t”.
-) instead of “Quotation Boxes” in “Glulx.i6t”.
-) instead of “GlkList Command” in “Glulx.i6t”.
-) instead of “Quit The Game Rule” in “Glulx.i6t”.
-) instead of “Restart The Game Rule” in “Glulx.i6t”.
-) instead of “Restore The Game Rule” in “Glulx.i6t”.
-) instead of “Save The Game Rule” in “Glulx.i6t”.
-) instead of “Switch Transcript On Rule” in “Glulx.i6t”.
-) instead of “Switch Transcript Off Rule” in “Glulx.i6t”.
-) instead of “Prompt” in “Printing.i6t”.
-) instead of “Status Line” in “Printing.i6t”.
-) instead of “Yes/No Questions” in “Parser.i6t”.
-) instead of “Glulx Version” in “Text.i6t”.
-) instead of “Print Obituary Headline Rule” in “OrderOfPlay.i6t”.
-) instead of “Virtual Machine Startup Rule” in “OrderOfPlay.i6t”.
-) instead of “Score Notification” in “Printing.i6t”.
Given everything I’m seeing in this thread, this sounds like it will not be trivial. What I’d like to know is if will be impossible.
Thanks. It’s not a priority at the moment, but I do plan to circle back when the new Inform stabilizes. The fyrevmweb-react repo also needs to be completely redone. The code is bad.
That did do part of the trick. Much thanks! I now get a different error and I think it’s what you brought up before. When running make check, I now get:
$ make check
make -f inform6/inform6.mk test
make[1]: Entering directory '/home/jeffn/i7/inform'
../intest/Tangled/intest -from inform6 all
intest: fatal error: unable to write file: E:\appDev\cygwin64\home\jeffn\i7\intest\Workspace\T16\diff_output_0.txt
make[1]: *** [inform6/inform6.mk:68: test] Error 2
make[1]: Leaving directory '/home/jeffn/i7/inform'
make: *** [makefile:427: check] Error 2
But that directory being referenced – T16 – doesn’t exist. There are directories from T0 to T15 – but no T16.
intest uses one directory for each thread Tn. It’s set up for up to 16 threads out of the box, but if your CPU has more, you’ll need to create some extras (T16, T17, … up to the number of logical cores your CPU has).
(Edit: and by “create” I mean “copy the directory structure from one of the existing ones”.)
Ah! That gets me a little further. I manually created directories T16 through T20. Things started running. A different error this time:
Failed: 1=ebook 2=osx_app 3=plain 4=windows_app
make[1]: Leaving directory '/home/jeffn/i7/inform'
make -f inform7/inform7.mk test
make[1]: Entering directory '/home/jeffn/i7/inform'
E:\appDev\cygwin64\home\jeffn\i7\intest/Tangled/intest -from inform7 all
intest: fatal error: unable to write to file: E:\appDev\cygwin64\home\jeffn\i7\intest\Workspace\T17\Example.inform\Source\story.ni
make[1]: *** [inform7/inform7.mk:56: test] Error 2
make[1]: Leaving directory '/home/jeffn/i7/inform'
make: *** [makefile:431: check] Error 2
Looking in that T17 directory, I do see an Example.materials folder but not an Example.inform. That said, I also don’t see that Example.inform in the T16 folder I created either but that didn’t seem to have an error.
That said, this might be legit in terms of an error in the tests. I say that because some tests do fully pass. My output is:
make -f inform6/inform6.mk test
All 307 tests succeeded (time taken 0:17, 19 simultaneous threads)
make -f inblorb/inblorb.mk test
All 6 tests succeeded (time taken 0:07, 6 simultaneous threads)
make -f indoc/indoc.mk test
All 4 tests failed (time taken 0:02, 4 simultaneous threads)
So maybe this is actually fully working and these are just failing tests? Failing, that is, in a Windows context. On my Mac all tests pass without issue.
My next attempt will be trying this on Windows Subsystem for Linux and seeing how that fares.
Windows Subsytem for Linux works up to everything for the make check step. I get:
$ make check
make -f inform6/inform6.mk test
make[1]: Entering directory '/home/jeffn/inform-dev/inform'
../intest/Tangled/intest -from inform6 all
find: ‘/home/jeffn/inform-dev/intest/Workspace/T17/Example.materials’: No such file or directory
find: ‘/home/jeffn/inform-dev/intest/Workspace/T19/Example.materials’: No such file or directory
sh: 1: cd: can't cd to /home/jeffn/inform-dev/intest/Workspace/T17/Example.inform
sh: 1: cd: can't cd to /home/jeffn/inform-dev/intest/Workspace/T19/Example.inform
find: ‘/home/jeffn/inform-dev/intest/Workspace/T16/Example.materials’: No such file or directory
find: ‘/home/jeffn/inform-dev/intest/Workspace/T18/Example.materials’: No such file or directory
sh: 1: cd: can't cd to /home/jeffn/inform-dev/intest/Workspace/T16/Example.inform
sh: 1: cd: can't cd to /home/jeffn/inform-dev/intest/Workspace/T18/Example.inform
intest: fatal error: unable to write file: /home/jeffn/inform-dev/intest/Workspace/T17/diff_output_0.txt
make[1]: *** [inform6/inform6.mk:72: test] Error 2
make[1]: Leaving directory '/home/jeffn/inform-dev/inform'
make: *** [makefile:431: check] Error 2
In this case, even adding the extra T16 through T20 directories (for my cores) doesn’t resolve the issue, which it does in other “Linux/POSIX on Windows” variants. Notice above how it’s referring to various of those new directories but still having issue.
So far I’m finding that Cygwin is really the only reliable way to go if on Windows, which others have stated upthread. It requires the least hacks and/or workarounds although still doesn’t pass the make check bit. (Whether that matters I’m less sure; I’m not sure if the tests are showing actual issues or just issues with running in a Windows context.)
I think you need to actually have a particular directory structure present in the intest “workspace” directories. So rather than creating additional directories empty, you’d need to copy one of the existing ones. (It seems to expect an I7 project structure with “Example.inform”, “Example.materials” and all their usual subdirectories.)