Swipl.rc and swipl-win.rc

Dear Jan, dear others,

Greetings from MSYS! I think I have a few minor path issues, and maybe you could give me a bit of guidance. After installation, I get errors in test_xpce, saying that use_module(library(pce)) fails. I can work around this by the steps below, basically loading swipl-win.rc. Note that I don’t seem to have swipl.rc.

I guess swipl.rc and swipl-win.rc belong to swipl.exe and swipl-win.exe, respectively, but swipl-win.exe is actually disabled during cmake. So I end up with swipl.exe and swipl-win.rc, which is probably not indended.

Is my conclusion correct?

Best wishes,

Matthias

Matthias@DESKTOP-A2T8IFC MINGW64 ~/swipl-devel/build
$ ~/swipl/bin/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.3-40-gc92083831-DIRTY)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

1 ?- use_module(swi('swipl-win.rc')).
true.

2 ?-  use_module(library(pce)).
true.

3 ?- use_module("c:/msys64/home/matthias/swipl/lib/swipl/test/packages/xpce/test_xpce.pl")
.
XPCE/SWI-Prolog test suite. (XPCE version 6.6.66, July 2009)
To run all tests run ?- test.

true.

4 ?- test_xpce.
Running test set "name" . done.
Running test set "wname" ... done.
Running test set "fmt" ...... done.
Running test set "srcsink" .. done.
Running test set "file" .... done.
Running test set "unicode_file" .. done.
Running test set "dir" ..... done.
Running test set "unicode_dir" ... done.
Running test set "bom" . done.
Running test set "plterm" . done.
Running test set "real" ... done.
Running test set "textbuffer" .... done.
Running test set "asfile" .... done.
Running test set "selection" .. done.
Running test set "image" . done.
Running test set "regex" ...................... done.
Running test set "type" .. done.

All tests passed
true.

10 ?- use_module(swi('swipl.rc')).
ERROR: source_sink `swi('swipl.rc')' does not exist

swipl-win.exe comes from two places. From packages/swipl-win we get a version based on the portable Qt framework. On Windows we get swipl-win.exe from the main source (inplemented by src/win32/console). That should still be there, no?

An executable loads the .rc file based on the name of the binary. Historically, the console application could not support graphics and the whole purpose of swipl-win.rc is to link xpce into Prolog. This has changed, notably because xpce now by default runs in its own thread and therefore we no longer have to combine the Windows message loop and console input in one thread. You can try using

swipl.exe
?- [swi('swipl-win.rc')].
?- emacs.

On the normal Windows binary this seems to work (only tested some basics).

We could consider installing swipl.rc along with swipl-win.rc (they should be the same). It might give some issues for people creating saved states from swipl.exe as these have the tendency to include xpce unless started using swipl --no-pce or swipl -F none to stop loading the init file.

swipl.exe
?- [swi('swipl-win.rc')].
?- emacs.

Yes, works here as well (under MSYS2). Nice!

Yes—on the other hand, wouldn’t it be my own responsibility whether to install swipl with xpce support or not? I may not get the problem here, and what I am actually trying is do is only to get “test_installation” running on MSYS2.

The packager typically decides on that :slight_smile:

That can also be done using this around

:- if(exists_source(library(pce))).

Pushed a fix this way. That still allows for installing swipl.rc, but prevents the test from failing if the test executable does not have xpce enabled.

It’s on the list, but does not have priority right now.

1 Like