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


On Monday, April 14, 2025 at 10:22:53 AM UTC-7 dim...@gmail.com wrote:

> 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
>
> On Mon, Apr 14, 2025 at 11:16 AM Jianping Pan <usapan...@gmail.com> wrote:
> >
> > 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!
> >
> > --
> > 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
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/1218a0a7-f769-4eaf-8342-622e8781bcd6n%40googlegroups.com.

Reply via email to