# Strange error with make/0

**URL:** <https://swi-prolog.discourse.group/t/strange-error-with-make-0/745>\
**Category:** Help!\
**Created:** [May 30, 2019, 10:59am UTC](https://swi-prolog.discourse.group/t/strange-error-with-make-0/745 "2019-05-30T10:59:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![remy.s](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@remy.s](https://swi-prolog.discourse.group/u/remy.s)\
**Post date:** [May 30, 2019, 10:59am UTC](https://swi-prolog.discourse.group/t/strange-error-with-make-0/745/1 "2019-05-30T10:59:53Z")

</div>

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](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, found`lists: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).

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [May 30, 2019, 11:29am UTC](https://swi-prolog.discourse.group/t/strange-error-with-make-0/745/2 "2019-05-30T11:29:48Z")

</div>

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

```prolog
?- debug.
?- make:make_no_trace.

```

That should give more details. Calling make\_no\_trace should also allow you to use the debugger.

---

<div class="post-metadata">

**Author:** ![remy.s](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@remy.s](https://swi-prolog.discourse.group/u/remy.s)\
**Post date:** [May 30, 2019, 11:41am UTC](https://swi-prolog.discourse.group/t/strange-error-with-make-0/745/3 "2019-05-30T11:41:47Z")

</div>

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](http://www.swi-prolog.org)

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

?- debug.

**true.**

[debug] ?- make.

**ERROR: Type error: `text' expected, found`error: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, found`error: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

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [May 30, 2019, 11:51am UTC](https://swi-prolog.discourse.group/t/strange-error-with-make-0/745/4 "2019-05-30T11:51:30Z")

</div>

> [@remy.s](#):
>
> **ERROR: [32] import(error:must\_be/2) at /Users/remy/Repos/cdjudo/load.pl:9**

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.

---

<div class="post-metadata">

**Author:** ![remy.s](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@remy.s](https://swi-prolog.discourse.group/u/remy.s)\
**Post date:** [May 30, 2019, 11:56am UTC](https://swi-prolog.discourse.group/t/strange-error-with-make-0/745/5 "2019-05-30T11:56:26Z")

</div>

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