Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1936793 - sagemath fails to build with Python 3.10: E subprocess.CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128.
Summary: sagemath fails to build with Python 3.10: E subprocess.CalledPr...
Alias: None
Product: Fedora
Classification: Fedora
Component: sagemath
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Paulo Andrade
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
Reported: 2021-03-09 07:49 UTC by Tomáš Hrnčiar
Modified: 2021-03-09 13:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-03-09 13:58:23 UTC
Type: Bug

Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-03-09 07:49:06 UTC
sagemath fails to build with Python 3.10.0a6.

RPM build errors:
error: Directory not found: /builddir/build/BUILDROOT/sagemath-9.2-4.fc35.x86_64/usr/share/doc/sagemath/html/ca
    absolute symlink: /usr/lib64/sagemath/doc -> /usr/share/doc/sagemath
    absolute symlink: /usr/lib64/sagemath/local/bin/ecm -> /usr/bin/gmp-ecm
    absolute symlink: /usr/lib64/sagemath/local/bin/gap -> /usr/bin/gap
    absolute symlink: /usr/lib64/sagemath/local/bin/jmol -> /usr/bin/jmol
    absolute symlink: /usr/lib64/sagemath/local/bin/python -> /usr/bin/python3
    absolute symlink: /usr/lib64/sagemath/local/bin/sage.bin -> /usr/bin/python3
    absolute symlink: /usr/lib64/sagemath/local/bin/sage_pari -> /usr/bin/gp
    absolute symlink: /usr/lib64/sagemath/local/include -> /usr/include
    absolute symlink: /usr/lib64/sagemath/local/lib -> /usr/lib64
    absolute symlink: /usr/lib64/sagemath/local/share -> /usr/share
    File listed twice: /usr/lib64/sagemath/local/var/lib/sage/installed/database_cremona_ellcurve-2019-10-29
    absolute symlink: /usr/lib64/sagemath/share -> /usr/share/sagemath
    absolute symlink: /usr/lib64/sagemath/src/doc -> /usr/share/doc/sagemath
    absolute symlink: /usr/lib64/sagemath/src/sage -> /usr/lib64/python3.10/site-packages/sage
    absolute symlink: /usr/share/sagemath/etc/sage -> /usr/lib64/python3.10/site-packages
    Directory not found: /builddir/build/BUILDROOT/sagemath-9.2-4.fc35.x86_64/usr/share/doc/sagemath/html/ca

I am not sure if this error is directly connected with Python 3.10, but sagemath builds well on rawhide, so I am reporting it here.

For the build logs, see:

For all our attempts to build sagemath with Python 3.10, see:

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Tomáš Hrnčiar 2021-03-09 13:39:52 UTC
I've tried to rebuild it once more and I got this test failure.

=================================== FAILURES ===================================
______________________________ test_get_repo_info ______________________________

tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_get_repo_info0')

    def test_get_repo_info(tmpdir):
        repo_path = tmpdir.mkdir("repo").strpath
        with open(os.path.join(repo_path, REPO_CONTAINER_CONFIG), 'w') as f:
                    - n:s:v
>       initialize_git_repo(repo_path, files=[REPO_CONTAINER_CONFIG])

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/utils/ in initialize_git_repo
    first_commit_ref = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=rpath)
/usr/lib64/python3.10/ in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'rev-parse', 'HEAD'],)
kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-0/test_get_repo_info0/repo', 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'rev-parse', 'HEAD']>
stdout = b'HEAD\n', stderr = None, retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
        The other arguments are the same as for the Popen constructor.
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
        with Popen(*popenargs, **kwargs) as process:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
            except:  # Including KeyboardInterrupt, communicate handled that.
                # We don't call process.wait() as .__exit__ does that for us.
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128.

Comment 2 Tomáš Hrnčiar 2021-03-09 13:58:23 UTC
Disregard the above comment and entire bugzilla. With another rebuild sagemath builds alright. Appologies for the noise.

Note You need to log in before you can comment on or make changes to this bug.