ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.21k stars 348 forks source link

gpatch @ macos #6019

Open zbroyar opened 2 weeks ago

zbroyar commented 2 weeks ago

Hi here.

I was forced to relink gpatch from /usr/local/Cellar/gpatch/2.7.6/bin/patch to /usr/bin/patch on my macOS Ventura 13.6.7 because of errors during installation of several packages:

#=== ERROR while compiling owl.1.0.2-1 ========================================#
These patches didn't apply at /Users/user/.opam/4.14.0/.opam-switch/build/owl.1.0.2-1:
  - 0001-Revert-update-config-file-for-publication.patch: "/usr/local/bin/gpatch -p1 -i /Users/m/.opam/log/processed-patch-97860-df171e" exited with code 2 "/usr/local/bin/gpatch: **** out of memory"

#=== ERROR while compiling ocb-stubblr.0.1.1-1 ================================#
These patches didn't apply at /Users/user/.opam/4.14.0/.opam-switch/build/ocb-stubblr.0.1.1-1:
  - custom-cclib.patch: "/usr/local/bin/gpatch -p1 -i /Users/m/.opam/log/processed-patch-97860-52de48" exited with code 2 "/usr/local/bin/gpatch: **** out of memory"
  - use-OPAM_SWITCH_PREFIX.patch: "/usr/local/bin/gpatch -p1 -i /Users/m/.opam/log/processed-patch-97860-bcc76e" exited with code 2 "/usr/local/bin/gpatch: **** out of memory"

#=== ERROR while compiling ocamlnet.4.1.9-2 ===================================#
These patches didn't apply at /Users/user/.opam/4.14.0/.opam-switch/build/ocamlnet.4.1.9-2:
  - pkg-config.patch: "/usr/local/bin/gpatch -p1 -i /Users/m/.opam/log/processed-patch-97860-551b35" exited with code 2 "/usr/local/bin/gpatch: **** out of memory"

After switching to system-provided patch opam gave a warning about invalid patch utility but errors disappeared.

# opam config report
# opam-version         2.1.6 
# self-upgrade         no
# system               arch=x86_64 os=macos os-distribution=homebrew os-version=13.6.7
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 7
# repositories         1 (http) (default repo at 25b506f8)
# pinned               4 (git)
# current-switch       4.14.0
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       /Users/m/.opam/4.14.0/lib/ocaml/stublibs:/Users/m/.opam/4.14.0/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       4.14.0
kit-ty-kate commented 2 weeks ago

what was this /usr/local/bin/gpatch binary? Was that a custom symlink you made? If so where did it point to?

kit-ty-kate commented 2 weeks ago

If it was a simple symlink could you try to put it back and do:

cd /tmp
curl -LO https://github.com/pqwy/ocb-stubblr/releases/download/v0.1.1/ocb-stubblr-0.1.1.tbz
tar xvf ocb-stubblr-0.1.1.tbz
cd ocb-stubblr-0.1.1
curl -LO https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/ocb-stubblr/custom-cclib.patch
/usr/local/bin/gpatch -p1 -i custom-cclib.patch

and see what it says

zbroyar commented 2 weeks ago

See below:

out-of-memory