pypa / pypa/setuptools

On the proposed ccompiler.has_flag method

Open
#771 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

There is an ongoing discussion that was triggered by a proposed patch to distutils.

  • The patch consists in adding a new has_flag function to distutils' ccompiler, aside of has_function to detect whether the compiler supports certain compilation flag. It is similar to cmake's CHECK_CXX_COMPILER_FLAG.

    Detecting whether a compiler support such a flag is crucial for extension authors who need e.g. C++11 support in their code, so as to be able to output meaningful error messages when not available, or to use such a flag optionally when it improves performance. This becomes crucial since we have new flavors of the C++ programming language every 3 years (C++11/14/17).

  • This is obviously a backward compatible change since it is a new method, although it triggered a discussion on whether one should allow incremental improvements to distutils.

    Here are links to the top-most messages of two threads:

    1. About the proposed feature: https://mail.python.org/pipermail/distutils-sig/2016-August/029469.html
    2. What is the official position on distutils: https://mail.python.org/pipermail/distutils-sig/2016-August/029595.html

My proposal is the following:

  • add the patch to distutils.ccompiler. Incremental improvement is good! More reasons to adopt more recent python versions.
  • optionally add it to ccompiler via setuptools for earlier versions of python.

ping @jaraco

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed patch to distutils.ccompiler and the two linked distutils-sig discussion threads, since the issue does not name a repository file or test. Done means reaching a decision on the distutils change and, if accepted, adding the has_flag capability with the optional setuptools compatibility path described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.