Skip to content

homebrew: Unused packages (singular, pari, ...) in /usr/local leak into build when using homebrew's python3 #31132

@mkoeppe

Description

@mkoeppe

As previously discussed in #30745, /usr/local is leaking into our build, through wrong orders of include and/or library directives.

In #30745, this problem was not fixed but rather some more packages were found to be usable on homebrew, so distro information was added.

The problem has been reported again with pari (building cypari2) in #31029/#30589.

This is caused by a misconfigured python3. In this ticket, we add code to detect this problem when looking for the system python at configure time.

Checking whether SageMath should install SPKG python3...
checking whether any of libpng bzip2 xz libffi is installed as or will be installed as SPKG... no
checking for python3 >= 3.6.0, < 3.10.0 with modules sqlite3, ctypes, math, hashlib, crypt, readline, socket, zlib, distutils.core... 
checking ... whether /usr/local/bin/python3 is good... no, this is a misconfigured Python whose sysconfig compiler/linker flags contain -I or -L options, which may cause wrong versions of libraries to leak into the build of Python packages - see https://github.com/sagemath/sage-prod/issues/31132; to use it anyway, use ./configure --with-python=/usr/local/bin/python3
checking ... whether /usr/bin/python3 is good... yes
checking for python3 >= 3.6.0, < 3.10.0 with modules sqlite3, ctypes, math, hashlib, crypt, readline, socket, zlib, distutils.core... /usr/bin/python3
configure: will use system package and not install SPKG python3

When --with-python=... is used, only a warning is issued.

See also:

Related homebrew issues and pull requests:

Depends on #30589

Upstream: Reported upstream. No feedback yet.

CC: @orlitzky @jhpalmieri @zlscherr @kiwifb @NathanDunfield @kliem

Component: build

Author: Matthias Koeppe

Branch: 76d5fd1

Reviewer: Zachary Scherr

Issue created by migration from https://trac.sagemath.org/ticket/31132

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions