Subject: Re: bug#52669: 29.0.50; build failure: ‘Qsqlitep’ undeclared

From: Sam Steingold <[email-masked]>
Date: Mon, 20 Dec 2021 12:36:22 -0500

> * Eli Zaretskii <[email-masked]> [2021-12-20 18:45:42 +0200]:
>
>> From: Sam Steingold <[email-masked]>
>> Date: Mon, 20 Dec 2021 09:53:42 -0500
>> Cc: [email-masked], Lars Ingebrigtsen <[email-masked]>
>> 
>> I build in a separate directory.
>> I just did
>> 
>> rm -rf build
>> mkdir build
>> cd build
>> ../configure --with-imagemagick   --with-mailutils --with-native-compilation
>> make bootstrap
>> 
>> and got
>> 
>> make[2]: Entering directory '/home/sds/src/emacs/trunk/build/src'
>>   GEN      globals.h
>>   CC       dispnew.o
>> In file included from ../../src/dispnew.c:27:
>> ../../src/lisp.h: In function ‘CHECK_SQLITE’:
>> ../../src/lisp.h:2677:27: error: ‘Qsqlitep’ undeclared (first use in
>> this function); did you mean ‘Qslice’?
>>  2677 |   CHECK_TYPE (SQLITE (x), Qsqlitep, x);
>>       |                           ^~~~~~~~
>>       |                           Qslice
>
> Qsqlitep is defined in globals.h, and lisp.h includes globals.h on
> line 957, way before line 2677.

Indeed.

> Does your globals.h include the #define for Qsqlitep?

--8<---------------cut here---------------start------------->8---
3 matches for "Qsqlitep" in buffer: globals.h
   3618:#define iQsqlitep 1180
   3619:DEFINE_LISP_SYMBOL (Qsqlitep)
   8109:# define Qsqlitep builtin_lisp_symbol (1180)
--8<---------------cut here---------------end--------------->8---

> So I don't think I understand how this could happen.

me neither.
I tried to investigate this before submitting the bug...

However, I think I know what the problem is!

There are *TWO* `global.h` files:

--8<---------------cut here---------------start------------->8---
  /home/sds/src/emacs/trunk/:
  find . \( -name globals.h \) -ls
    6816176    288 -rw-rw-r--   1      sds      sds        293174 Dec 20 09:47 build/src/globals.h
    1323655    288 -rw-rw-r--   1      sds      sds        291248 Dec  7 14:25 src/globals.h
  
  find finished at Mon Dec 20 12:30:42
--8<---------------cut here---------------end--------------->8---

and since lisp.h includes "globals.h" instead of <globals.h>, it finds
the *SECOND* one, not the *FIRST* one.

I will push the fix shortly.

Thank you!

-- 
Sam Steingold (http://sds.podval.org/) on Pop 21.04 (hirsute) X 11.0.12013000
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
http://think-israel.org https://mideasttruth.com https://memri.org
Democracy is when the Public elects its Servants, not Masters.