Closed goliviero closed 7 years ago
This is an issue with the upstream linuxbrew/homebrew-core
repo, and subsequently the upstream source of the patches removing the patch file. The fix is in homebrew/homebrew-core
as of a few hours ago( https://github.com/Homebrew/homebrew-core/pull/9663), so should be merged into linuxbrew
in the next day or two.
In the meantime, you can do the following to patch that formula (assumes brew
is in PATH
):
$ cd $(brew --prefix)
$ cd Library/Taps/homebrew/homebrew-core
$ git remote add upstream https://github.com/homebrew/homebrew-core
$ git fetch upstream
$ git checkout -p upstream/master -- Formula/libxml2.rb
... This will start an interactive session to select parts of the diff - say 'y' to the first (the patches), 'n' to the second (need to retain the zlib dep), 'n' to the third (need linuxbrew additions), and 'y' tp the forth.
...
$ cd $(brew --prefix)
$ brew install git-flow-avh
... or if you prefer ...
$ brew cadfael-bootstrap
The same process can be applied to any other formulae that need updating.
I exactly did what you propose and i have the same issue. When i execute : brew cadfael-bootstrap, it fails again and the link for download is not the updated link but the old one... Is the "Updating brew" restore the old link ? Here is my error after your patch :
Already up-to-date.
==> About to bootstrap cadfael toolchain. This may take some time
==> Bootstrapping Cadfael toolchain
==> Cadfael tool patchelf already installed
==> Cadfael tool python already installed
==> Cadfael tool ninja already installed
==> Cadfael tool cmake already installed
==> Installing Cadfael tool git-flow-avh
==> Installing dependencies for git-flow-avh: libxml2, gettext, gnu-getopt
==> Installing git-flow-avh dependency: libxml2
==> Downloading http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz
Already downloaded: /home/goliviero/.cache/Homebrew/libxml2-2.9.4.tar.gz
==> Downloading https://mirrors.ocf.berkeley.edu/debian/pool/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.1.debian.tar.xz
curl: (22) The requested URL returned error: 404 Not Found
Trying a mirror...
==> Downloading https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.1.debian.tar.xz
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "libxml2--patch"
Download failed: https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.1.debian.tar.xz
Error: Failed to bootstrap cadfael toolchain
Ok it seems to work when i do a 'direct' installation of libxml2.rb
with brew install Library/Taps/homebrew/homebrew-core/Formula/libxml2.rb
I think the brew update
in the cadfael-bootstrap erase my changes.
==> Bootstrap of toolchain complete, installed formulae
unzip 6.0_2
sqlite 3.16.2
gpatch 2.7.5
openssl 1.0.2k
pkg-config 0.29.1_2
zlib 1.2.8
xz 5.2.3
curl 7.52.1
ncurses 6.0_2
m4 1.4.18
ninja 1.7.2
python 2.7.13
cmake 3.7.2
gettext 0.19.8.1
bison 3.0.4
sphinx-doc 1.5.1
gdbm 1.12
readline 7.0.1
git-flow-avh 1.10.2
gnu-getopt 1.1.6
bzip2 1.0.6_1
patchelf 0.9_1
libxml2 2.9.4_2
Bootstrap of CadfaelBrew complete under
I think if it had overwritten the file, the direct install would not have worked - but does the current libxml2.rb
file reflect the upstream changes (i.e. has the "...2.2.debian.tar.xz
patch file?
I do the direct installation just after a new git checkout
of course. The file :
Library/Taps/homebrew/homebrew-core/Formula/libxml2.rb
reflect the upstream changes with this inside :
stable do
url "http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz"
mirror "ftp://xmlsoft.org/libxml2/libxml2-2.9.4.tar.gz"
sha256 "ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c"
# All patches upstream already. Remove whenever 2.9.5 is released.
# Fixes CVE-2016-4658, CVE-2016-5131.
patch do
url "https://mirrors.ocf.berkeley.edu/debian/pool/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2.debian.tar.xz"
mirror "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/libx/libxml2/libxml2_2.9.4+dfsg1-2.2.debian.tar.xz"
sha256 "c038bba02a56164cef7728509ba3c8f1856018573769ee9ffcc48c565e90bdc9"
apply "patches/0003-Fix-NULL-pointer-deref-in-XPointer-range-to.patch",
"patches/0004-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch",
"patches/0005-Fix-XPointer-paths-beginning-with-range-to.patch",
"patches/0006-Disallow-namespace-nodes-in-XPointer-ranges.patch",
"patches/0007-Fix-more-NULL-pointer-derefs-in-xpointer.c.patch",
"patches/0008-Fix-attribute-decoding-during-XML-schema-validation.patch"
end
O.k., just to check the behaviour, you could try
$ brew uninstall libxml2
$ brew update
$ brew install libxml2
That would confirm if the update overwrites. If it does, then the changes to libxml2.rb
should be commited, i.e., after patching:
$ cd $(brew --prefix)
$ cd Library/Taps/homebrew/homebrew-core
... patching ...
$ git add Formula/libxml2.rb
$ git commit -m "Apply patch from homebrew/homebrew-core for missing debian patch file"
Certainly, a commit should prevent any overwriting...
When i do an uninstall / update and reinstall it seems to work. A git diff show me no difference now, maybe the master version was updated with the change ? Thank you anyway for your help, it seems to work now.
Hi Ben, all
I'm reinstalling Cadfael from scratch due to an upgrade of my system (kubuntu 14.04 -> kubuntu 16.04). After the git clone, i try to install cadfael brew with the command :
./brew cadfael-bootstrap
Checkings are good and some things download and install but it failed at :
Here is a brew doctor
Can you help me with this ?
Thanks, Guillaume