Re: Flex help needed for eegdev (Was: Re: eegdev: FTBFS: ../../lib/stdio.h:64:3: error: #error "Please include config.h first.")

2023-08-25 Thread Nilesh Patra
On Fri, Aug 25, 2023 at 06:29:34PM +0200, Niels Thykier wrote:
> Nilesh Patra:
> > On Fri, Aug 25, 2023 at 05:17:47PM +0200, Niels Thykier wrote:
> > > [...]
> > 
> > I had figured out this already, but conffile.lex.c does not exist in the
> > project, it is generated as a part of the lexer output. In particular:
> > 
> 
> Ok, apologies it was not clear to me from your opening email, where you were
> stuck. I incorrectly assumed it was an an earlier stage than you are, so my
> input was not useful to you.
> 
> I checked the source of `conffile.l` and it need already has to runes to
> include config.h where I would have assumed you needed to 
> (https://salsa.debian.org/med-team/eegdev/-/blob/master/src/core/conffile.l#L24).
> 
> A bit of searching found the following flex upstream bug:
> 
>   * https://github.com/westes/flex/issues/564
> 
> Which seems related. Hopefully, it can help you.

So, it was a lexer issue after all :)
That did help, and I could fix the package. Thanks a lot!

Best,
Nilesh


signature.asc
Description: PGP signature


Re: Flex help needed for eegdev (Was: Re: eegdev: FTBFS: ../../lib/stdio.h:64:3: error: #error "Please include config.h first.")

2023-08-25 Thread Jeremy Sowden
On 2023-08-25, at 18:29:34 +0200, Niels Thykier wrote:
> Nilesh Patra:
> > On Fri, Aug 25, 2023 at 05:17:47PM +0200, Niels Thykier wrote:
> > > [...]
> > 
> > I had figured out this already, but conffile.lex.c does not exist in the
> > project, it is generated as a part of the lexer output. In particular:
> > 
> 
> Ok, apologies it was not clear to me from your opening email, where you were
> stuck. I incorrectly assumed it was an an earlier stage than you are, so my
> input was not useful to you.
> 
> I checked the source of `conffile.l` and it need already has to runes to
> include config.h where I would have assumed you needed to 
> (https://salsa.debian.org/med-team/eegdev/-/blob/master/src/core/conffile.l#L24).
> 
> A bit of searching found the following flex upstream bug:
> 
>   * https://github.com/westes/flex/issues/564
> 
> Which seems related. Hopefully, it can help you.

Another possibility would be just not to use gnulib.  Debian is a GNU
system, so it shouldn't be needed.  If one removes the dh_autoreconf
override and just lets dh_autoreconf do its thing, the package builds
successfully.

J.


signature.asc
Description: PGP signature


Re: Flex help needed for eegdev (Was: Re: eegdev: FTBFS: ../../lib/stdio.h:64:3: error: #error "Please include config.h first.")

2023-08-25 Thread Niels Thykier

Nilesh Patra:

On Fri, Aug 25, 2023 at 05:17:47PM +0200, Niels Thykier wrote:

[...]


I had figured out this already, but conffile.lex.c does not exist in the
project, it is generated as a part of the lexer output. In particular:



Ok, apologies it was not clear to me from your opening email, where you 
were stuck. I incorrectly assumed it was an an earlier stage than you 
are, so my input was not useful to you.


I checked the source of `conffile.l` and it need already has to runes to 
include config.h where I would have assumed you needed to 
(https://salsa.debian.org/med-team/eegdev/-/blob/master/src/core/conffile.l#L24).


A bit of searching found the following flex upstream bug:

  * https://github.com/westes/flex/issues/564

Which seems related. Hopefully, it can help you.


Best regards,
Niels




Re: Flex help needed for eegdev (Was: Re: eegdev: FTBFS: ../../lib/stdio.h:64:3: error: #error "Please include config.h first.")

2023-08-25 Thread Nilesh Patra
On Fri, Aug 25, 2023 at 05:17:47PM +0200, Niels Thykier wrote:
> Nilesh Patra:
> > 
> > 
> > On 25 August 2023 1:47:26 pm IST, Nilesh Patra  wrote:
> > > On Wed, 26 Jul 2023 21:52:17 +0200 Lucas Nussbaum  
> > > wrote:
> > > > Source: eegdev
> > > > Version: 0.2-6
> > > > Severity: serious
> > > > > In file included from conffile.lex.c:242:
> > > > > ../../lib/stdio.h:64:3: error: #error "Please include config.h first."
> > > > > 64 |  #error "Please include config.h first."
> > > > >|   ^
> > > 
> > > The lexed file conffile.lex.c seems to include some stuff before
> > > config.h is included which is causing it to choke.
> > > 
> > > I'm not acquainted with lexers and not sure what causes this. I'd
> > > appreciate any help.
> > 
> > Adding mentors list as well. If someone can help with this, that'd be great.
> I do not think the lexer has anything to do with this.
> 
> A quick look at the log suggests that the package is "rolling" its own
> "stdio.h" (note the "../../lib/stdio.h" in the error message).  Indeed, the
> full log has "mv stdio.h-t3 stdio.h" as well.
> 
> I believe that this is stdio.h is generated by the embedded gnulib copy and
> that is as far as I am willing to debug that rabbit hole. Based on the
> error, I assume gnulib's generated stdio.h requires the project specific
> "config.h" to be loaded first.
> 
> As for solving it, I would have a look at the "conffile.lex.c" file, see
> where it has its "#include" for stdio.h and then add an `include "config.h"`
> before that to see if it works (via a patch).

I had figured out this already, but conffile.lex.c does not exist in the
project, it is generated as a part of the lexer output. In particular:

$ ls conffile.lex.c
ls: cannot access 'conffile.lex.c': No such file or directory
$ flex conffile.l
$ ls conffile.lex.c
conffile.lex.c

And this indeed has config.h include after a few C-specific includes.
Since this is not a part of the source, there's nothing I can patch in
this file. conffile.l has the config.h include present before everything
else, and hence I'm not sure where this should be fixed.

Did I misunderstand your solution somehow? If not, can you recommend
something else?

Best,
Nilesh


signature.asc
Description: PGP signature


Re: Flex help needed for eegdev (Was: Re: eegdev: FTBFS: ../../lib/stdio.h:64:3: error: #error "Please include config.h first.")

2023-08-25 Thread Niels Thykier

Niels Thykier:

[...]

Hi,

[...]
I believe that this is stdio.h is generated by the embedded gnulib copy 
and that is as far as I am willing to debug that rabbit hole. Based on 
the error, I assume gnulib's generated stdio.h requires the project 
specific "config.h" to be loaded first.

[...]

Best regards,
Niels



Correction; the gnulib was probably not an "embedded copy". The file 
still seems to be generated via gnulib, so the rest of my argument would 
remain the same.




Re: Flex help needed for eegdev (Was: Re: eegdev: FTBFS: ../../lib/stdio.h:64:3: error: #error "Please include config.h first.")

2023-08-25 Thread Niels Thykier

Nilesh Patra:



On 25 August 2023 1:47:26 pm IST, Nilesh Patra  wrote:

On Wed, 26 Jul 2023 21:52:17 +0200 Lucas Nussbaum  wrote:

Source: eegdev
Version: 0.2-6
Severity: serious

In file included from conffile.lex.c:242:
../../lib/stdio.h:64:3: error: #error "Please include config.h first."
64 |  #error "Please include config.h first."
   |   ^


The lexed file conffile.lex.c seems to include some stuff before
config.h is included which is causing it to choke.

I'm not acquainted with lexers and not sure what causes this. I'd
appreciate any help.


Adding mentors list as well. If someone can help with this, that'd be great.

Best,
Nilesh



Hi,

I do not think the lexer has anything to do with this.

A quick look at the log suggests that the package is "rolling" its own 
"stdio.h" (note the "../../lib/stdio.h" in the error message).  Indeed, 
the full log has "mv stdio.h-t3 stdio.h" as well.


I believe that this is stdio.h is generated by the embedded gnulib copy 
and that is as far as I am willing to debug that rabbit hole. Based on 
the error, I assume gnulib's generated stdio.h requires the project 
specific "config.h" to be loaded first.


As for solving it, I would have a look at the "conffile.lex.c" file, see 
where it has its "#include" for stdio.h and then add an `include 
"config.h"` before that to see if it works (via a patch).


Hope that helps.

Best regards,
Niels



Re: Flex help needed for eegdev (Was: Re: eegdev: FTBFS: ../../lib/stdio.h:64:3: error: #error "Please include config.h first.")

2023-08-25 Thread Nilesh Patra



On 25 August 2023 1:47:26 pm IST, Nilesh Patra  wrote:
>On Wed, 26 Jul 2023 21:52:17 +0200 Lucas Nussbaum  wrote:
>> Source: eegdev
>> Version: 0.2-6
>> Severity: serious
>> > In file included from conffile.lex.c:242:
>> > ../../lib/stdio.h:64:3: error: #error "Please include config.h first."
>> >64 |  #error "Please include config.h first."
>> >   |   ^
>
>The lexed file conffile.lex.c seems to include some stuff before
>config.h is included which is causing it to choke.
>
>I'm not acquainted with lexers and not sure what causes this. I'd
>appreciate any help.

Adding mentors list as well. If someone can help with this, that'd be great.

Best,
Nilesh