[patch-2.7.6] Error downloading tarball of patch

125 views
Skip to first unread message

Jianping Pan

unread,
Apr 14, 2025, 12:16:39 PM4/14/25
to sage-devel
Dear sage dec,

I'm trying to install sagemath on my macOS Sonoma 14.6.1  using git

git clone --origin upstream https://github.com/sagemath/sage.git

and I also ran ./configure Then I ran a few brew commands like

brew install gnupg texinfo cbc igraph apaffenholz/polymake/polymake

brew install flint gsl maxima openblas gpatch singular suite-sparse 

source /Users/jianpingpan/sage/.homebred-build-env


Then I ran make reconfigure

However after I do make, I quickly got the error message (log file attached)

[patch-2.7.6]   File "/Users/jianpingpan/sage/build/bin/../sage_bootstrap/expand_class.py", line 126, in apply

[patch-2.7.6]     function(package_name, *args, **kwds)

[patch-2.7.6]   File "/Users/jianpingpan/sage/build/bin/../sage_bootstrap/app.py", line 329, in download_with_args

[patch-2.7.6]     self.download(package, allow_upstream=allow_upstream)

[patch-2.7.6]   File "/Users/jianpingpan/sage/build/bin/../sage_bootstrap/app.py", line 315, in download

[patch-2.7.6]     package.tarball.download(allow_upstream=allow_upstream)

[patch-2.7.6]   File "/Users/jianpingpan/sage/build/bin/../sage_bootstrap/tarball.py", line 187, in download

[patch-2.7.6]     raise FileNotMirroredError('tarball does not exist on mirror network and neither at the upstream URL')

[patch-2.7.6] sage_bootstrap.tarball.FileNotMirroredError: tarball does not exist on mirror network and neither at the upstream URL

[patch-2.7.6] ************************************************************************

[patch-2.7.6] Error downloading tarball of patch

[patch-2.7.6] ************************************************************************

[patch-2.7.6] Please email sage-devel (http://groups.google.com/group/sage-devel)

[patch-2.7.6] explaining the problem and including the log files

[patch-2.7.6]   /Users/jianpingpan/sage/logs/pkgs/patch-2.7.6.log

[patch-2.7.6] and

[patch-2.7.6]   /Users/jianpingpan/sage/config.log

[patch-2.7.6] Describe your computer, operating system, etc.

[patch-2.7.6] ************************************************************************

make[2]: *** [patch-SAGE_LOCAL-no-deps] Error 1

make[1]: *** [/Users/jianpingpan/sage/local/var/lib/sage/installed/patch-2.7.6] Error 2

***************************************************************

Error building Sage.


The following package(s) may have failed to build (not necessarily

during this run of 'make base-toolchain'):


* package:         patch-2.7.6

  last build time: Apr 13 08:30

  log file:        /Users/jianpingpan/sage/logs/pkgs/patch-2.7.6.log


It is safe to delete any log files and build directories, but they

contain information that is helpful for debugging build problems.

WARNING: If you now run 'make' again, the build directory of the

same version of the package will, by default, be deleted. Set the

environment variable SAGE_KEEP_BUILT_SPKGS=yes to prevent this.


make: *** [base-toolchain] Error 1



I tried the method in https://groups.google.com/g/sage-devel/c/_cotG4ONZeY/m/oIM0k21gCQAJ but still have the same issue.

Thanks!

config.log

Dima Pasechnik

unread,
Apr 14, 2025, 1:22:53 PM4/14/25
to sage-...@googlegroups.com
While you can download the tarfile from
https://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.gz into upstream/
it's more economic to use Homebrew for patch, and many more dependencies.

PS. I gather that macOS patch is good enough nowadays, and we can use
it, as proposed on https://github.com/sagemath/sage/issues/30481
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sage-devel/991caaca-3f97-453d-a15e-0b9dcf0e81a1n%40googlegroups.com.

John H Palmieri

unread,
Apr 14, 2025, 1:32:59 PM4/14/25
to sage-devel
It seems that the most recent version of patch in homebrew no longer provides automatic access to a binary "patch" (which I think it used to do); instead it says

    If you need to use it as "patch", you can add a "gnubin" directory
    to your PATH from your bashrc like:

        PATH="/opt/homebrew/opt/gpatch/libexec/gnubin:$PATH"

If I make that change to PATH, then I see

% patch --version                            
GNU patch 2.8
Copyright 1989-2025 Free Software Foundation, Inc.
Copyright 1984-1988 Larry Wall

but Sage doesn't find it and insists on building its own patch. The top-level config.log file shows that this directory is in PATH, but it says

## ------------------------------------------------------ ##
## Checking whether SageMath should install SPKG patch... ##
## ------------------------------------------------------ ##
real_configure:46409: checking for GNU patch >= 2.7.0
real_configure:46495: result:
real_configure:46521: no suitable system package found for SPKG patch

Dima Pasechnik

unread,
Apr 14, 2025, 3:38:09 PM4/14/25
to sage-...@googlegroups.com
On Mon, Apr 14, 2025 at 12:33 PM John H Palmieri <jhpalm...@gmail.com> wrote:
It seems that the most recent version of patch in homebrew no longer provides automatic access to a binary "patch" (which I think it used to do); instead it says

    If you need to use it as "patch", you can add a "gnubin" directory
    to your PATH from your bashrc like:

        PATH="/opt/homebrew/opt/gpatch/libexec/gnubin:$PATH"

If I make that change to PATH, then I see

% patch --version                            
GNU patch 2.8
Copyright 1989-2025 Free Software Foundation, Inc.
Copyright 1984-1988 Larry Wall

but Sage doesn't find it and insists on building its own patch. The top-level config.log file shows that this directory is in PATH, but it says

## ------------------------------------------------------ ##
## Checking whether SageMath should install SPKG patch... ##
## ------------------------------------------------------ ##
real_configure:46409: checking for GNU patch >= 2.7.0
real_configure:46495: result:
real_configure:46521: no suitable system package found for SPKG patch

the macro in spkg-configure doesn't correctly check that 2.8 >= 2.7.0 because it does not match only 2 numeric fields.

e.g.

$ patch --version | sed -n -e 's/GNU patch *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'
2.7.6.211-86ac
$
$ echo "GNU patch 2.8"| sed -n -e 's/GNU patch *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p' # no output!
$
$ echo "GNU patch 2.8.42 "| sed -n -e 's/GNU patch *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'
2.8.42

This ought to be fixed.

Dima

Jianping Pan

unread,
Jun 17, 2025, 4:13:04 AM6/17/25
to sage-devel
Hi all,

Sorry for the  late reply. I tried many things and was not able to fix it. However, I was able to install sage using Conda which was a painless process!

In case it is helpful for anyone, below was what worked for me:

(1) Install conda in the terminal. I used Charlie Parker's new answer using only the terminal for mac zsh from https://stackoverflow.com/questions/49118277/what-is-the-best-way-to-install-conda-on-macos-apple-mac

conda config --add channels conda-forge

conda config --set channel_priority strict

conda create -n sageenv sage python=3.12


(3) activate sageenv environment in conda

conda activate /Users/jianping.pan/anaconda3/envs/sageenv


(4) Install some optional packages, after activating the above environment

conda install pynormaliz

sage -pip install multipolynomial_bases

sage -pip install jupyterlab


(5) run sage from jupyterlab

sage -n jupyterlab



Best,
Jianping

Reply all
Reply to author
Forward
0 new messages