Bug#890703: flex: all amd64 binaries since 2.6.4-1 built with stale skel.c file

2018-02-21 Thread Manoj Srivastava
Hi,

Actually, the problem seems to be that my build setup is too
 clean: it seems not to contain flex. When there is no flex present, we
 do not regenerate files from *.l files. The solution, or course, is to
update the files in the packaged source so we can bootstrap flex.

Thanks for the report.

manoj
-- 
Q:  How did you get into artificial intelligence? A:Seemed logical 
-- I didn't have any real intelligence.  
Manoj Srivastava  
4096R/C5779A1C E37E 5EC5 2A01 DA25 AD20  05B6 CF48 9438 C577 9A1C



Bug#890703: flex: all amd64 binaries since 2.6.4-1 built with stale skel.c file

2018-02-17 Thread James Cowgill
Package: flex
Version: 2.6.4-1
Severity: important

Hi,

I spent some time today looking at why charybdis still fails with newer
flex (since it is blocking my mbedtls transition)[1]. I also had a look
at why it inexplicably builds with amd64 and fails on all other
architectures. I have come to the conclusion that the only way this can
happen is if the amd64 binary was not built in a clean environment and
probably contains a stale "src/skel.c" file.

Running "flex ircd_lexer.l" (from charybdis) using the flex 2.6.4-4
binaries on amd64 and i386 respectively gives this diff which is the
cause if the current failures[2]:

> --- charybdis-cy4e9N/charybdis-3.5.5/src/lex.yy.c   2018-02-17 
> 19:07:14.334607450 +
> +++ charybdis-gRy7cn/charybdis-3.5.5/src/lex.yy.c   2018-02-17 
> 18:38:46.253775565 +
> @@ -16,6 +16,12 @@
>  /* First, we deal with  platform-specific or compiler-specific issues. */
>  
>  /* begin standard C headers. */
> +#ifndef _POSIX_C_SOURCE
> +#define _POSIX_C_SOURCE 200809 /* for fileno() */
> +#ifndef _POSIX_SOURCE
> +#define _POSIX_SOURCE 1
> +#endif
> +#endif
>  #include 
>  #include 
>  #include 
> @@ -556,8 +562,8 @@

Simply rebuilding flex on amd64 and rerunning the above test makes the
diff go away.

This code is embedded into the flex binary, so you can tell if a binary
is bad by running:
 strings /usr/bin/flex | grep POSIX_C_SOURCE

The good binary gives:
> #define _POSIX_C_SOURCE 200809 /* for fileno() */
> [[#ifndef _POSIX_C_SOURCE

Bad binaries print nothing.

Given that this bug is present in 4 debs so far (I cannot check the
binary currently in NEW), binNMUing the package won't fix it for good
(since the next upload will probably be bad). Possible improvements:
forcing skel.c to always be rebuilt, or using source only uploads.

Thanks,
James

[1] https://buildd.debian.org/status/package.php?p=charybdis
[2] charybdis uses certain old BSD defines which are only available
if _POSIX_SOURCE is not defined.



signature.asc
Description: OpenPGP digital signature