Skip to content

Useless error message when distutils fails compiling #55808

Closed

Description

@pitrou
BPO 11599
Nosy @pitrou, @tarekziade, @merwok
Files
  • fix-11599.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/merwok'
    closed_at = <Date 2014-03-13.10:03:44.341>
    created_at = <Date 2011-03-18.18:33:56.293>
    labels = ['type-bug', 'library']
    title = 'Useless error message when distutils fails compiling'
    updated_at = <Date 2014-03-13.10:03:44.340>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2014-03-13.10:03:44.340>
    actor = 'eric.araujo'
    assignee = 'eric.araujo'
    closed = True
    closed_date = <Date 2014-03-13.10:03:44.341>
    closer = 'eric.araujo'
    components = ['Distutils']
    creation = <Date 2011-03-18.18:33:56.293>
    creator = 'pitrou'
    dependencies = []
    files = ['22938']
    hgrepos = []
    issue_num = 11599
    keywords = ['patch']
    message_count = 10.0
    messages = ['131352', '131601', '131602', '138172', '138178', '159314', '159319', '213343', '213379', '213380']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'tarek', 'eric.araujo', 'alexis', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11599'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    Activity

    1. pitrou commented on Mar 18, 2011

      @pitrou
      MemberAuthor

      Really, can't distutils at least display the command-line that failed to execute?

      Traceback (most recent call last):
        File "/home/antoine/cpython/default/Lib/distutils/unixccompiler.py", line 176, in _compile
          extra_postargs)
        File "/home/antoine/cpython/default/Lib/distutils/ccompiler.py", line 911, in spawn
          spawn(cmd, dry_run=self.dry_run)
        File "/home/antoine/cpython/default/Lib/distutils/spawn.py", line 34, in spawn
          _spawn_posix(cmd, search_path, dry_run=dry_run)
        File "/home/antoine/cpython/default/Lib/distutils/spawn.py", line 138, in _spawn_posix
          % (cmd[0], exit_status))
      distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/home/antoine/cpython/default/Lib/test/test_embed.py", line 42, in test_subinterps
          exe = self.make_exe("embed1.c")
        File "/home/antoine/cpython/default/Lib/test/test_embed.py", line 29, in make_exe
          compiler.compile([srcpath], output_dir=build_dir)
        File "/home/antoine/cpython/default/Lib/distutils/ccompiler.py", line 576, in compile
          self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
        File "/home/antoine/cpython/default/Lib/distutils/unixccompiler.py", line 178, in _compile
          raise CompileError(msg)
      distutils.errors.CompileError: command 'gcc' failed with exit status 1
    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 18, 2011
    3. merwok commented on Mar 21, 2011

      @merwok
      Member

      It appears a choice has been made to print only the first argument in the error messages; attached patch changes that, please test.

    4. pitrou commented on Mar 21, 2011

      @pitrou
      MemberAuthor

      It appears a choice has been made to print only the first argument in
      the error messages; attached patch changes that, please test.

      Well, I don't have the failing setup at hand anymore, but the patch
      looks reasonable to me. Thank you!

    5. python-dev commented on Jun 11, 2011

      python-devmannequin
      Mannequin

      New changeset 3ba34c03f2fc by Éric Araujo in branch 'default':
      Adjust logging in packaging.util.spawn (related to bpo-11599)
      http://hg.python.org/cpython/rev/3ba34c03f2fc

    6. merwok commented on Jun 11, 2011

      @merwok
      Member

      I intend to ask on distutils-sig whether doing the change in distutils would break code.

    7. assigned and unassigned on Jun 11, 2011
    8. pitrou commented on Apr 25, 2012

      @pitrou
      MemberAuthor

      Ping.

    9. merwok commented on Apr 25, 2012

      @merwok
      Member

      I will apply this this week; I don’t think I need to ask the ML after all, the output is already different when you run with DISTUTILS_DEBUG — and it’s debug mode anyway, not regular use, so I don’t foresee any compat issue.

    10. python-dev commented on Mar 13, 2014

      python-devmannequin
      Mannequin

      New changeset 37bca30c3e19 by Éric Araujo in branch '2.7':
      Make distutils error messages more helpful (bpo-11599).
      http://hg.python.org/cpython/rev/37bca30c3e19

    11. python-dev commented on Mar 13, 2014

      python-devmannequin
      Mannequin

      New changeset 43b06352221b by Éric Araujo in branch '3.3':
      Make distutils error messages more helpful (bpo-11599).
      http://hg.python.org/cpython/rev/43b06352221b

      New changeset c04260b59e8c by Éric Araujo in branch 'default':
      Merge 3.3 (bpo-11599)
      http://hg.python.org/cpython/rev/c04260b59e8c

    12. merwok commented on Mar 13, 2014

      @merwok
      Member

      Fixed!

    13. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions