public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* python 3.9 package leaks CFLAGS into user packages via sysconfig
@ 2021-12-28  1:27 Matthias Koeppe
  2021-12-28  2:19 ` Marco Atzeri
  2021-12-31 19:33 ` Matthias Koeppe
  0 siblings, 2 replies; 5+ messages in thread
From: Matthias Koeppe @ 2021-12-28  1:27 UTC (permalink / raw)
  To: cygwin

$ python3.9 -m sysconfig | grep CFLAGS
CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
-ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1
-I/usr/include/uuid/
-fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/build=/usr/src/debug/python39-3.9.9-1
-fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/src/Python-3.9.9=/usr/src/debug/python39-3.9.9-1
-ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1
-I/usr/include/uuid/
-fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/build=/usr/src/debug/python39-3.9.9-1
-fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/src/Python-3.9.9=/usr/src/debug/python39-3.9.9-1"

These flags will end up in builds of user Python packages with extensions
via sysconfig/distutils.
This should be fixed by putting the necessary flags for the Python build
into CFLAGS_NODIST instead -- see similar fix for Homebrew's packaging of
python3 in https://github.com/Homebrew/homebrew-core/pull/68528

Reference: https://trac.sagemath.org/ticket/33078

-- 
Dr. Matthias Koeppe . . . . . . . . http://www.math.ucdavis.edu/~mkoeppe
Professor of Mathematics

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python 3.9 package leaks CFLAGS into user packages via sysconfig
  2021-12-28  1:27 python 3.9 package leaks CFLAGS into user packages via sysconfig Matthias Koeppe
@ 2021-12-28  2:19 ` Marco Atzeri
  2021-12-28 15:16   ` Marco Atzeri
  2021-12-31 19:33 ` Matthias Koeppe
  1 sibling, 1 reply; 5+ messages in thread
From: Marco Atzeri @ 2021-12-28  2:19 UTC (permalink / raw)
  To: cygwin

On 28.12.2021 02:27, Matthias Koeppe wrote:
> $ python3.9 -m sysconfig | grep CFLAGS
> CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
> -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
> -fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1
> -I/usr/include/uuid/
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/build=/usr/src/debug/python39-3.9.9-1
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/src/Python-3.9.9=/usr/src/debug/python39-3.9.9-1
> -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
> -fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1
> -I/usr/include/uuid/
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/build=/usr/src/debug/python39-3.9.9-1
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/src/Python-3.9.9=/usr/src/debug/python39-3.9.9-1"
> 
> These flags will end up in builds of user Python packages with extensions
> via sysconfig/distutils.
> This should be fixed by putting the necessary flags for the Python build
> into CFLAGS_NODIST instead -- see similar fix for Homebrew's packaging of
> python3 in https://github.com/Homebrew/homebrew-core/pull/68528
> 
> Reference: https://trac.sagemath.org/ticket/33078
> 

thanks Matthias
for the report and the reference.

It seems we have built all the pythons in the same way so
all versions always had it.

I will look to build a test version with the suggested change.

regards
Marco

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python 3.9 package leaks CFLAGS into user packages via sysconfig
  2021-12-28  2:19 ` Marco Atzeri
@ 2021-12-28 15:16   ` Marco Atzeri
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Atzeri @ 2021-12-28 15:16 UTC (permalink / raw)
  To: cygwin

On 28.12.2021 03:19, Marco Atzeri wrote:
> On 28.12.2021 02:27, Matthias Koeppe wrote:
>> $ python3.9 -m sysconfig | grep CFLAGS

Hi Matthias,

can you please verify the test package

python39-3.9.9-3 (not the -2)

$ python3.9 -m sysconfig | grep CFLAGS
         BASECFLAGS = "-Wno-unused-result -Wsign-compare"
         CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv 
-O3 -Wall"
         CFLAGSFORSHARED = ""
         CFLAGS_ALIASING = ""
         CONFIGURE_CFLAGS = ""
         CONFIGURE_CFLAGS_NODIST = "-ggdb -O2 -pipe -Wall 
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong 
--param=ssp-buffer-size=4 
-fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-3.x86_64/build=/usr/src/debug/python39-3.9.9-3 
-fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-3.x86_64/src/Python-3.9.9=/usr/src/debug/python39-3.9.9-3 
-DOPENSSL_NO_SSL3=1 -I/usr/include/uuid/ -std=c99 -Wextra 
-Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden"
....

Regards
Marco

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python 3.9 package leaks CFLAGS into user packages via sysconfig
  2021-12-28  1:27 python 3.9 package leaks CFLAGS into user packages via sysconfig Matthias Koeppe
  2021-12-28  2:19 ` Marco Atzeri
@ 2021-12-31 19:33 ` Matthias Koeppe
  2021-12-31 21:22   ` Marco Atzeri
  1 sibling, 1 reply; 5+ messages in thread
From: Matthias Koeppe @ 2021-12-31 19:33 UTC (permalink / raw)
  To: cygwin

On Mon, Dec 27, 2021 at 5:27 PM Matthias Koeppe <mkoeppe@math.ucdavis.edu>
wrote:

> $ python3.9 -m sysconfig | grep CFLAGS
> CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
> -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
> -fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1
> -I/usr/include/uuid/
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/build=/usr/src/debug/python39-3.9.9-1
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/src/Python-3.9.9=/usr/src/debug/python39-3.9.9-1
> -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
> -fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1
> -I/usr/include/uuid/
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/build=/usr/src/debug/python39-3.9.9-1
> -fdebug-prefix-map=/pub/devel/python/python39/python39-3.9.9-1.x86_64/src/Python-3.9.9=/usr/src/debug/python39-3.9.9-1"
>
> These flags will end up in builds of user Python packages with extensions
> via sysconfig/distutils.
> This should be fixed by putting the necessary flags for the Python build
> into CFLAGS_NODIST instead [...]
>

Thanks, Marco, for the python-3.9.9-3 test package.
It has been reported to work well for us (
https://trac.sagemath.org/ticket/33078#comment:34), solving the reported
problem.

Matthias

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: python 3.9 package leaks CFLAGS into user packages via sysconfig
  2021-12-31 19:33 ` Matthias Koeppe
@ 2021-12-31 21:22   ` Marco Atzeri
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Atzeri @ 2021-12-31 21:22 UTC (permalink / raw)
  To: cygwin

On 31.12.2021 20:33, Matthias Koeppe wrote:
> On Mon, Dec 27, 2021 at 5:27 PM Matthias Koeppe <mkoeppe@math.ucdavis.edu>
> wrote:
> 
>> $ python3.9 -m sysconfig | grep CFLAGS
>> CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
..
>>
>> These flags will end up in builds of user Python packages with extensions
>> via sysconfig/distutils.
>> This should be fixed by putting the necessary flags for the Python build
>> into CFLAGS_NODIST instead [...]
>>
> 
> Thanks, Marco, for the python-3.9.9-3 test package.
> It has been reported to work well for us (
> https://trac.sagemath.org/ticket/33078#comment:34), solving the reported
> problem.
> 
> Matthias
> 

Thanks Matthias
for the testing.
I expect to promote it from test to current in few days.


Regards
Marco

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-31 21:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28  1:27 python 3.9 package leaks CFLAGS into user packages via sysconfig Matthias Koeppe
2021-12-28  2:19 ` Marco Atzeri
2021-12-28 15:16   ` Marco Atzeri
2021-12-31 19:33 ` Matthias Koeppe
2021-12-31 21:22   ` Marco Atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).