Strange error with make/0

On my Mac, I have this strange behaviour when calling goal make/0 immediately after calling swipl
Any idea what I am doing wrong here:

$ swipl -l load.pl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.6)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- make.

% Updating index for library /Applications/SWI-Prolog.app/Contents/swipl/library/
% Updating index for library /Applications/SWI-Prolog.app/Contents/swipl/xpce/prolog/lib/
ERROR: Type error: text' expected, foundlists:select/3’ (a compound)
ERROR: In:
ERROR: [10] notrace(make_no_trace)
ERROR: [9] make:make at /Applications/SWI-Prolog.app/Contents/swipl/library/make.pl:75
ERROR: [8] ‘$tabling’:’$wfs_call’(user:make,user:_8592) at /Applications/SWI-Prolog.app/Contents/swipl/boot/tabling.pl:507
?


Load.pl is as follows:
file_search_path(cddb, data).
:-use_module(lib/cddb).

:- ensure_loaded(import_helper).

import(File):-
open(File, read, Stream)
, load(Stream, L)
, post_data(L)
, close(Stream).

Quite weird. Just installed the latest version on the Mac, but all works just fine. Try

?- debug.
?- make:make_no_trace.

That should give more details. Calling make_no_trace should also allow you to use the debugger.

I can’t do anything with this out put, but here it is:
$ swipl -l load.pl

Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.6)

SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.

Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org

For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- debug.

true.

[debug] ?- make.

ERROR: Type error: text' expected, founderror:must_be/2’ (a compound)

ERROR: In:

ERROR: [10] notrace(make_no_trace)

ERROR: [9] make:make at /Applications/SWI-Prolog.app/Contents/swipl/library/make.pl:75

ERROR: [8] ‘$tabling’:’$wfs_call’(user:make,user:_8840) at /Applications/SWI-Prolog.app/Contents/swipl/boot/tabling.pl:507

[debug] ?- make:make_no_trace.

ERROR: Type error: text' expected, founderror:must_be/2’ (a compound)

ERROR: In:

ERROR: [33] open(error:must_be/2,read,_640)

ERROR: [32] import(error:must_be/2) at /Users/remy/Repos/cdjudo/load.pl:9

ERROR: [31] ‘$autoload2’(cddb,must_be,2) at /Applications/SWI-Prolog.app/Contents/swipl/boot/init.pl:772

ERROR: [30] ‘$autoload’(cddb,must_be,2) at /Applications/SWI-Prolog.app/Contents/swipl/boot/init.pl:756

ERROR: [29] ‘$undefined_procedure’(cddb,must_be,2,retry) at /Applications/SWI-Prolog.app/Contents/swipl/boot/init.pl:743

ERROR: [28] ‘$autoload’:’$define_predicate’(cddb:must_be(atom,_816)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/autoload.pl:109

ERROR: [27] ‘$syspreds’:define_or_generate(cddb:must_be(atom,_858)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/syspred.pl:878

ERROR: [26] ‘$syspreds’:property_predicate(imported_from(_894),cddb:must_be(atom,_906)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/syspred.pl:853

ERROR: [25] ‘$syspreds’:predicate_property(cddb:must_be(atom,_950),imported_from(_954)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/syspred.pl:797

ERROR: [24] prolog_codewalk:walk_called(must_be(atom,_996),cddb,_988,walk_option(trace,true,true,cddb,[user],true,_1012,-,check:found_undef,(0x7f8e61408e20),cddb: …,_1022,error,false,false)) at /Applications/SWI-Prolog.app/Contents/swipl/library/prolog_codewalk.pl:494

ERROR: [23] prolog_codewalk:walk_called((must_be(atom,_1094),…,…),cddb,term_position(_1104,_1106,_1108,_1110,[_1116|…]),walk_option(trace,true,true,cddb,[user],true,_1134,-,check:found_undef,(0x7f8e61408e20),cddb: …,_1144,error,false,false)) at /Applications/SWI-Prolog.app/Contents/swipl/library/prolog_codewalk.pl:455

ERROR: [22] catch(prolog_codewalk:walk_called(…,cddb,…,…),missing(_1216),prolog_codewalk:walk_called_by_body(_1226,…,cddb,…)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/init.pl:386

ERROR: [21] prolog_codewalk:walk_called_by_body((must_be(atom,_1278),…,…),cddb,walk_option(trace,true,true,cddb,[user],true,_1300,-,check:found_undef,(0x7f8e61408e20),cddb: …,_1310,_1312,_1314,false)) at /Applications/SWI-Prolog.app/Contents/swipl/library/prolog_codewalk.pl:356

ERROR: [20] ‘$apply’:forall(prolog_codewalk:catch(…,_1378,fail),prolog_codewalk:walk_called_by_body(…,cddb,…)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/apply.pl:52

ERROR: [19] prolog_codewalk:walk_called_by_pred(cddb:assert_fact/4,walk_option(trace,true,true,cddb,[user],true,_1454,-,check:found_undef,(0x7f8e61408e20),cddb: …,_1464,_1466,_1468,false)) at /Applications/SWI-Prolog.app/Contents/swipl/library/prolog_codewalk.pl:297

ERROR: [18] ‘$apply’:forall(prolog_codewalk:predicate_in_module(cddb,…),prolog_codewalk:walk_called_by_pred(…,…)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/apply.pl:52

ERROR: [17] prolog_codewalk:find_walk_from_module(cddb,walk_option(trace,true,true,cddb,[user],true,_1592,-,check:found_undef,(0x7f8e61408e20),cddb: …,_1602,_1604,_1606,false)) at /Applications/SWI-Prolog.app/Contents/swipl/library/prolog_codewalk.pl:286

ERROR: [16] ‘$apply’:forall(prolog_codewalk:(…,…),prolog_codewalk:find_walk_from_module(cddb,…)) at /Applications/SWI-Prolog.app/Contents/swipl/boot/apply.pl:52

ERROR: [15] prolog_codewalk:prolog_walk_code(1,[undefined(trace),…|…]) at /Applications/SWI-Prolog.app/Contents/swipl/library/prolog_codewalk.pl:200

ERROR: [14] prolog_codewalk:prolog_walk_code(check:[…|…]) at /Applications/SWI-Prolog.app/Contents/swipl/library/prolog_codewalk.pl:198

Exception: (33) open(error:must_be/2, read, _1794) ? abort

% Execution Aborted

[debug] ?-

N.B. my module cddb uses lib persistency, and this is the only place where must_be/2 comes into play

You redefined import/1. I thought this should not affect the libraries, but in this case it apparently does. I’ll make a note to checkout why someday.

renamed my import/1 to import_file/1, this fixes the strange behaviour.
Meaning, it now works as expected…
Thanks for your support.